@whoz-oss/coday-client 0.107.0 → 0.107.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/3rdpartylicenses.txt +9 -9
  2. package/browser/chunk-3GO76XRI.js +1 -0
  3. package/browser/chunk-3HILRADK.js +1 -0
  4. package/browser/chunk-3L6R63CU.js +2 -0
  5. package/browser/chunk-3PJTGTYA.js +5 -0
  6. package/browser/{chunk-VEECA5F5.js → chunk-6PIG2VOY.js} +1 -1
  7. package/browser/chunk-73KZBPKL.js +2 -0
  8. package/browser/{chunk-EJVKODM4.js → chunk-7Z4NSMUU.js} +1 -1
  9. package/browser/chunk-BZ6FJXKL.js +1 -0
  10. package/browser/chunk-DE6SQRNU.js +10 -0
  11. package/browser/chunk-E5N6SPGL.js +1 -0
  12. package/browser/chunk-EAI5JJMU.js +1 -0
  13. package/browser/{chunk-JRTXKFZ4.js → chunk-FYXAYEQE.js} +1 -1
  14. package/browser/{chunk-F4BEHTG5.js → chunk-G4KHFN3J.js} +1 -1
  15. package/browser/chunk-HX462B7L.js +1 -0
  16. package/browser/{chunk-7Z6CCK6M.js → chunk-L6CLRLNN.js} +1 -1
  17. package/browser/{chunk-EWWRCRRE.js → chunk-LTOBM4YC.js} +1 -1
  18. package/browser/{chunk-2Q4GTKJ2.js → chunk-MHSKFGOG.js} +1 -1
  19. package/browser/{chunk-PGXMHE2X.js → chunk-OOJRZK5J.js} +1 -1
  20. package/browser/chunk-PBAXETHQ.js +1 -0
  21. package/browser/chunk-PGYHJCYD.js +1 -0
  22. package/browser/chunk-Q7H3QAH2.js +4 -0
  23. package/browser/chunk-TUBWUEXF.js +2 -0
  24. package/browser/chunk-VDUM46KL.js +1 -0
  25. package/browser/chunk-VQANVQD7.js +10 -0
  26. package/browser/chunk-WBWVKD3X.js +1 -0
  27. package/browser/chunk-WW2QH6WR.js +1 -0
  28. package/browser/chunk-X2YT3IIX.js +1 -0
  29. package/browser/chunk-XPN4U7ES.js +3 -0
  30. package/browser/chunk-Z3DOM3WM.js +3 -0
  31. package/browser/index.html +2 -2
  32. package/browser/main-3UUK4DYF.js +361 -0
  33. package/browser/polyfills-2FSRUXKO.js +2 -0
  34. package/browser/styles-TOOGLXPX.css +1 -0
  35. package/package.json +11 -11
  36. package/browser/chunk-2B5XG6ZC.js +0 -1
  37. package/browser/chunk-3PAE676O.js +0 -5
  38. package/browser/chunk-5WM75OPU.js +0 -1
  39. package/browser/chunk-6JUYUYZH.js +0 -1
  40. package/browser/chunk-6Q3JNJG6.js +0 -2
  41. package/browser/chunk-6RMKWFVF.js +0 -2
  42. package/browser/chunk-A7523AT7.js +0 -2
  43. package/browser/chunk-AH6TYV5V.js +0 -1
  44. package/browser/chunk-BIUQ3CWO.js +0 -1
  45. package/browser/chunk-ECRX3VCL.js +0 -10
  46. package/browser/chunk-EUUZ73WW.js +0 -3
  47. package/browser/chunk-IRHH5YY3.js +0 -3
  48. package/browser/chunk-JYIVUOA3.js +0 -1
  49. package/browser/chunk-LD7RXVSY.js +0 -1
  50. package/browser/chunk-MGZWX34A.js +0 -4
  51. package/browser/chunk-MLXAGMR7.js +0 -1
  52. package/browser/chunk-MROX7XZW.js +0 -1
  53. package/browser/chunk-QCZB5V35.js +0 -1
  54. package/browser/chunk-RFL5X6B6.js +0 -1
  55. package/browser/chunk-YLMEJS73.js +0 -10
  56. package/browser/chunk-ZLBM7VXJ.js +0 -1
  57. package/browser/favicon.ico +0 -0
  58. package/browser/main-BP7WLMUS.js +0 -361
  59. package/browser/polyfills-7R4CRVNH.js +0 -2
  60. package/browser/styles-QZI2VRZO.css +0 -1
@@ -1 +1 @@
1
- import{a as _e}from"./chunk-LD7RXVSY.js";import{b as ue}from"./chunk-EJVKODM4.js";import{c as he,g as fe,k as be,r as ve,s as xe,t as ye,y as Ce}from"./chunk-ZLBM7VXJ.js";import{$a as m,Ba as L,Ea as Q,Jb as y,Lb as w,Mb as j,P as H,Pa as b,Qa as se,Qb as p,Ra as v,Sa as x,T,Va as N,Wa as U,X as $,Xa as S,Y as V,Ya as s,Z as O,Za as r,_ as ae,_a as Z,a as R,ab as _,b as A,ba as re,bb as k,ec as D,fa as h,fb as de,hb as P,ib as ce,jb as g,kc as ee,mc as pe,qa as le,rc as ge,s as ie,sa as l,ub as me,xb as i,yb as c,zb as E}from"./chunk-3PAE676O.js";var Ie=(o,t)=>t.date,Be=(o,t)=>t.x,Fe=(o,t)=>t.label;function Re(o,t){o&1&&(m(0,"div",0),i(1,"No daily data points for this period."),_())}function Ae(o,t){if(o&1&&(O(),k(0,"rect",18)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH)}}function He(o,t){if(o&1&&(O(),k(0,"rect",19)(1,"rect",20)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),l(),b("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0)}}function $e(o,t){if(o&1){let e=de();O(),m(0,"g",15),ce("mouseenter",function(a){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(a,d.point))})("mousemove",function(a){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(a,d.point))})("mouseleave",function(){$(e);let a=g(2);return V(a.hideTooltip())}),k(1,"rect",16)(2,"rect",17),v(3,Ae,1,4,":svg:rect",18)(4,He,2,8),_()}if(o&2){let e=t.$implicit,n=g(2);b("transform","translate("+e.xGroup+",0)"),l(),b("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),l(),b("y",n.yBase-e.costH)("width",e.w)("height",e.costH),l(),x(e.tokensStubH!==null?3:4)}}function Ve(o,t){if(o&1&&(O(),m(0,"text",5),i(1),_()),o&2){let e=t.$implicit,n=g(2);b("x",e.x)("y",n.yAxis),l(),c(e.label)}}function Le(o,t){if(o&1&&(m(0,"div",24),i(1),_(),m(2,"div",25),i(3),_()),o&2){let e=t.$implicit;l(),c(e.label),l(2),c(e.value)}}function je(o,t){if(o&1&&(m(0,"div",21)(1,"div",22),i(2),_(),m(3,"div",23),N(4,Le,4,2,null,null,Fe),_()()),o&2){let e=g(2);me("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),l(2),c(e.tooltip().data.date),l(2),U(e.tooltipLines())}}function Ge(o,t){if(o&1&&(m(0,"div",8)(1,"span",10),i(2),_()()),o&2){let e=g(2);l(2),c(e.tokenCoverageLabel())}}function Ye(o,t){if(o&1&&(m(0,"div",1),O(),m(1,"svg",2),k(2,"line",3)(3,"line",3),N(4,$e,5,8,":svg:g",4,Ie),N(6,Ve,2,3,":svg:text",5,Be),_(),v(8,je,6,5,"div",6),ae(),m(9,"div",7)(10,"div",8),k(11,"span",9),m(12,"span",10),i(13,"Cost (per day)"),_(),m(14,"span",11),i(15),_()(),m(16,"div",8),k(17,"span",12),m(18,"span",10),i(19,"Prompt tokens"),_()(),m(20,"div",8),k(21,"span",13),m(22,"span",10),i(23,"Completion tokens"),_()(),m(24,"div",8),k(25,"span",14),m(26,"span",10),i(27,"Tokens missing"),_()(),m(28,"div",8)(29,"span",10),i(30,"Tokens scale"),_(),m(31,"span",11),i(32),_()(),v(33,Ge,3,1,"div",8),_()()),o&2){let e=g();l(),b("viewBox",e.viewBox),l(),b("y1",e.yTop)("x2",720)("y2",e.yTop),l(),b("y1",e.yBase)("x2",720)("y2",e.yBase),l(),U(e.bars()),l(2),U(e.axisLabels()),l(2),x(e.tooltip().visible&&e.tooltip().data?8:-1),l(7),E("max ",e.maxCostLabel()),l(17),E("max ",e.maxTokensLabel()),l(),x(e.tokenCoverageLabel()?33:-1)}}var G=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=p(()=>(this.points??[]).filter(t=>!!t.date));maxCost=p(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=p(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,a=e.completionTokens??null;return n===null&&a===null?null:(n??0)+(a??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=p(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=p(()=>"$"+(new D("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=p(()=>new D("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=h({visible:!1,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,a=e===null&&n===null?null:(e??0)+(n??0);return{date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:a,callCount:t.callCount??0}}showTooltip(t,e){let a=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=a?t.clientX-a.left:t.clientX,u=a?t.clientY-a.top:t.clientY,f=320,M=170,I=12,C=a?Math.max(0,a.width-f-I):d,B=a?Math.max(0,a.height-M-I):u,F=a?Math.min(Math.max(0,d),C):d,te=a?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:!0,x:F,y:te,data:this.toTooltipData(e)})}hideTooltip(){this.tooltip.update(t=>A(R({},t),{visible:!1}))}formatTokens(t){return t===null?"\u2014":new D("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return"$"+(new D("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=p(()=>{let t=this.tooltip(),e=t.data;return!t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let n=(this.innerW-(e-1)*this.groupGap)/e,a=Math.max(2,n),d=(a-this.barGap)/2,u=Math.max(1,d),f=this.maxCost()||1,M=this.maxTokens()||1,I=45;return t.map((C,B)=>{let F=this.paddingX+B*(a+this.groupGap),we=(C.cost??0)/f*this.innerH,ne=C.promptTokens,oe=C.completionTokens,K=ne!==null||oe!==null,De=ne??0,Ee=oe??0,Oe=K?De/M*this.innerH:null,Ne=K?Ee/M*this.innerH:null;return{date:C.date,point:C,xGroup:F,groupW:a,xCost:F,w:u,costH:we,xTokens:F+u+this.barGap,promptH:Oe,completionH:Ne,tokensStubH:K?null:I}})});axisLabels=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let a=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((f,M)=>({p:f,i:M})).filter(({i:f})=>f%a===0||f===e-1).map(({p:f,i:M})=>{let C=this.paddingX+M*(u+this.groupGap)+u/2,B=f.date.slice(5);return{x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&v(0,Re,2,0,"div",0)(1,Ye,34,11,"div",1),e&2&&x(n.safePoints().length===0?0:1)},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"],changeDetection:0})};var z=class o{http=T(pe);getTokenUsage(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};function Te(o){return`${o}`.padStart(2,"0")}function ke(o){return`${o.getUTCFullYear()}-${Te(o.getUTCMonth()+1)}-${Te(o.getUTCDate())}`}function ze(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function We(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var W=class o{api=T(z);destroyRef=T(re);defaultFrom=ke(ze());defaultTo=ke(We());draftFilters=h({from:this.defaultFrom,to:this.defaultTo});appliedFilters=h({from:this.defaultFrom,to:this.defaultTo});loading=h(!1);error=h(null);aggregation=h(null);seriesResponse=h(null);series=h(null);tokenDataPartial=h(!1);aggregationByModelId=h(null);seriesByModelId=h(null);init(){this.reload()}setDraftFrom(t){this.draftFilters.update(e=>A(R({},e),{from:t}))}setDraftTo(t){this.draftFilters.update(e=>A(R({},e),{to:t}))}clearDraftFrom(){this.setDraftFrom(null)}clearDraftTo(){this.setDraftTo(null)}apply(){this.appliedFilters.set(this.draftFilters()),this.reload()}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let a=n.modelId,d=e.get(a);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(a,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,a)=>(a.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let a=`${n.date}|${n.modelId}`,d=e.get(a);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(a,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,a)=>n.date<a.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(!0),this.error.set(null),ie({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(_e(this.destroyRef)).subscribe({next:({aggregation:n,series:a})=>{this.aggregation.set(n),this.seriesResponse.set(a);let d=a.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||a.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(!1)},error:n=>{this.loading.set(!1),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(!1),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage")}})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};var X=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},Me=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:X,set:X,deleteProperty:X,has:X}),J=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(Me,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"call",type:o,pure:!0})},q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(Me,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"apply",type:o,pure:!0})};function Xe(o,t){o&1&&(s(0,"div",24),i(1," Partial data \u2014 token counts may not cover the full period "),r())}function Je(o,t){o&1&&(s(0,"div",25),i(1," No token data collected for this period "),r())}function qe(o,t){if(o&1&&(s(0,"div",20)(1,"div",21)(2,"div",22),i(3,"Total tokens"),r(),s(4,"div",23),i(5),y(6,"call"),r()(),s(7,"div",21)(8,"div",22),i(9,"Total calls"),r(),s(10,"div",23),i(11),r()(),s(12,"div",21)(13,"div",22),i(14,"Total cost"),r(),s(15,"div",23),i(16),y(17,"apply"),r()()(),v(18,Xe,2,0,"div",24),v(19,Je,2,0,"div",25)),o&2){let e=g();l(5),c(w(6,5,e.totalRow().totalTokens,e.formatTokenValue)),l(6),c(e.totalRow().callCount),l(5),c(j(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),l(2),x(e.isPartialPeriod()?18:-1),l(),x(e.isMissingPeriod()?19:-1)}}function Ke(o,t){o&1&&(s(0,"div",17)(1,"div",26),i(2,"Loading token usage\u2026"),r()())}function Qe(o,t){if(o&1&&(s(0,"div",18)(1,"div",27),i(2,"Failed to load"),r(),s(3,"div",26),i(4),r()()),o&2){let e=g();l(4),c(e.state.error())}}function Ze(o,t){o&1&&(s(0,"div",17)(1,"div",27),i(2,"No data"),r(),s(3,"div",26),i(4,"No token usage recorded yet for this period."),r()())}function et(o,t){if(o&1&&(s(0,"div",33)(1,"div",30),i(2),r(),s(3,"div",30),i(4),r(),s(5,"div",30),i(6),r(),s(7,"div",31),i(8),y(9,"call"),r(),s(10,"div",31),i(11),y(12,"call"),r(),s(13,"div",31),i(14),y(15,"call"),r(),s(16,"div",31),i(17),r(),s(18,"div",31),i(19),y(20,"apply"),r()()),o&2){let e=t.$implicit,n=g(2);l(2),c(e.agentName),l(2),c(e.providerName),l(2),c(e.modelId),l(2),c(w(9,8,e.promptTokens,n.formatTokenValue)),l(3),c(w(12,11,e.completionTokens,n.formatTokenValue)),l(3),c(w(15,14,e.totalTokens,n.formatTokenValue)),l(3),c(e.callCount),l(2),E(" ",j(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ")}}function tt(o,t){if(o&1&&(s(0,"div",34)(1,"div",30),i(2),r(),s(3,"div",30),i(4),r(),s(5,"div",30),i(6),r(),s(7,"div",31),i(8),y(9,"call"),r(),s(10,"div",31),i(11),y(12,"call"),r(),s(13,"div",31),i(14),y(15,"call"),r(),s(16,"div",31),i(17),r(),s(18,"div",31),i(19),y(20,"apply"),r()()),o&2){let e=g(2);l(2),c(e.totalRow().agentName),l(2),c(e.totalRow().providerName),l(2),c(e.totalRow().modelId),l(2),c(w(9,8,e.totalRow().promptTokens,e.formatTokenValue)),l(3),E(" ",w(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),l(3),c(w(15,14,e.totalRow().totalTokens,e.formatTokenValue)),l(3),c(e.totalRow().callCount),l(2),E(" ",j(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ")}}function nt(o,t){if(o&1&&(s(0,"div",19)(1,"section",17)(2,"div",27),i(3,"Summary"),r(),s(4,"div",28)(5,"div",29)(6,"div",30),i(7,"agentName"),r(),s(8,"div",30),i(9,"providerName"),r(),s(10,"div",30),i(11,"modelId"),r(),s(12,"div",31),i(13,"promptTokens"),r(),s(14,"div",31),i(15,"completionTokens"),r(),s(16,"div",31),i(17,"totalTokens"),r(),s(18,"div",31),i(19,"callCount"),r(),s(20,"div",31),i(21,"cost"),r()(),s(22,"div",32),N(23,et,21,21,"div",33,se().trackRow,!0),v(25,tt,21,21,"div",34),r()()(),s(26,"section",17)(27,"div",27),i(28,"Daily series"),r(),Z(29,"app-daily-series-chart",35),r()()),o&2){let e=g();l(23),U(e.rows()),l(2),x(e.totalRow()?25:-1),l(4),S("points",e.chartPoints())}}var Se="\u2014",Pe=class o{router=T(ge);projectState=T(ue);state=T(W);view=h("byModel");rowsByAgent=p(()=>this.state.aggregation()?.models??[]);totalRow=p(()=>this.state.aggregation()?.total??null);rowsByModel=p(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=p(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=p(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=p(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=p(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=p(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:!1});ngOnInit(){this.state.init()}onFromChange(t){this.state.setDraftFrom(t||null)}onToChange(t){this.state.setDraftTo(t||null)}clearFrom(){this.state.clearDraftFrom()}clearTo(){this.state.clearDraftTo()}apply(){this.state.apply()}aggregateDailyPoints(t){let e=new Map;for(let n of t){let a=e.get(n.date);if(!a)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else{let d=(u,f)=>u===null&&f===null?null:(u??0)+(f??0);a.promptTokens=d(a.promptTokens,n.promptTokens),a.completionTokens=d(a.completionTokens,n.completionTokens),a.cost=(a.cost??0)+(n.cost??0),a.callCount=(a.callCount??0)+(n.callCount??0)}}return[...e.values()].sort((n,a)=>n.date<a.date?-1:1)}trackRow(t,e){return`${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=p(()=>{if(this.state.loading())return!1;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):!1});isPartialPeriod=p(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBackToProject(){let t=this.projectState.getSelectedProjectId();this.router.navigate(t?["project",t]:["/"])}formatTokenValue(t){return t===null?Se:new D("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?Se:"$"+(new D("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-token-usage"]],decls:40,vars:9,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["type","button","title","Back to project",1,"page__logo-btn",3,"click"],["alt","Coday",1,"page__logo"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(s(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),P("click",function(){return n.navigateBackToProject()}),Z(4,"img",4),r(),s(5,"div")(6,"h1",5),i(7,"Token Usage"),r(),s(8,"p",6),i(9,"Track prompt and completion token usage by agent and model."),r()()(),s(10,"div",7)(11,"label",8)(12,"span",9),i(13,"From"),r(),s(14,"div",10)(15,"input",11),P("ngModelChange",function(d){return n.onFromChange(d)}),r(),s(16,"button",12),P("click",function(){return n.clearFrom()}),i(17," Clear "),r()()(),s(18,"label",8)(19,"span",9),i(20,"To"),r(),s(21,"div",10)(22,"input",11),P("ngModelChange",function(d){return n.onToChange(d)}),r(),s(23,"button",12),P("click",function(){return n.clearTo()}),i(24," Clear "),r()()(),s(25,"label",8)(26,"span",9),i(27,"View"),r(),s(28,"select",13),P("ngModelChange",function(d){return n.view.set(d)}),s(29,"option",14),i(30,"By model"),r(),s(31,"option",15),i(32,"By agent"),r()()(),s(33,"button",16),P("click",function(){return n.apply()}),i(34,"Apply"),r()()(),v(35,qe,20,12),v(36,Ke,3,0,"div",17)(37,Qe,5,1,"div",18)(38,Ze,5,0,"div",17)(39,nt,30,2,"div",19),r()),e&2&&(l(4),b("src","CODAY-Logo.png",le),l(11),S("ngModel",n.state.draftFilters().from),l(),S("disabled",!n.state.draftFilters().from),l(6),S("ngModel",n.state.draftFilters().to),l(),S("disabled",!n.state.draftFilters().to),l(5),S("ngModel",n.view()),l(5),S("disabled",n.state.loading()),l(2),x(n.totalRow()?35:-1),l(),x(n.state.loading()?36:n.state.error()?37:n.isEmpty()?38:39))},dependencies:[Ce,xe,ye,he,ve,fe,be,G,J,q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__logo-btn[_ngcontent-%COMP%]{flex:0 0 auto;width:40px;height:40px;padding:0;border-radius:12px;border:1px solid var(--glass-border, rgba(255, 255, 255, .18));background:var(--glass-bg, rgba(255, 255, 255, .72));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08));cursor:pointer}.page__logo-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .03))}.page__logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;padding:6px}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media (max-width: 900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media (max-width: 1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"]})};export{Pe as TokenUsageComponent};
1
+ import{a as _e}from"./chunk-X2YT3IIX.js";import{b as ue}from"./chunk-7Z4NSMUU.js";import{c as he,g as be,k as fe,r as ve,s as ye,t as xe,y as Ce}from"./chunk-WW2QH6WR.js";import{$a as Z,Ab as E,Ea as L,Ha as Q,Kb as x,Mb as w,Nb as j,P as H,Qa as f,Qb as p,Ra as se,Sa as v,T,Ta as y,Wa as N,X as $,Xa as U,Y as V,Ya as S,Z as O,Za as s,_ as ie,_a as r,a as R,ab as m,b as A,ba as re,bb as _,cb as k,fc as D,ga as h,gb as de,ib as P,jb as ce,kb as g,mc as ee,nc as pe,sa as le,sc as ge,t as ae,ua as l,vb as me,yb as a,zb as c}from"./chunk-3PJTGTYA.js";var Ie=(o,t)=>t.date,Be=(o,t)=>t.x,Fe=(o,t)=>t.label;function Re(o,t){o&1&&(m(0,"div",0),a(1,"No daily data points for this period."),_())}function Ae(o,t){if(o&1&&(O(),k(0,"rect",18)),o&2){let e=g().$implicit,n=g(2);f("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH)}}function He(o,t){if(o&1&&(O(),k(0,"rect",19)(1,"rect",20)),o&2){let e=g().$implicit,n=g(2);f("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),l(),f("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0)}}function $e(o,t){if(o&1){let e=de();O(),m(0,"g",15),ce("mouseenter",function(i){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(i,d.point))})("mousemove",function(i){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(i,d.point))})("mouseleave",function(){$(e);let i=g(2);return V(i.hideTooltip())}),k(1,"rect",16)(2,"rect",17),v(3,Ae,1,4,":svg:rect",18)(4,He,2,8),_()}if(o&2){let e=t.$implicit,n=g(2);f("transform","translate("+e.xGroup+",0)"),l(),f("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),l(),f("y",n.yBase-e.costH)("width",e.w)("height",e.costH),l(),y(e.tokensStubH!==null?3:4)}}function Ve(o,t){if(o&1&&(O(),m(0,"text",5),a(1),_()),o&2){let e=t.$implicit,n=g(2);f("x",e.x)("y",n.yAxis),l(),c(e.label)}}function Le(o,t){if(o&1&&(m(0,"div",24),a(1),_(),m(2,"div",25),a(3),_()),o&2){let e=t.$implicit;l(),c(e.label),l(2),c(e.value)}}function je(o,t){if(o&1&&(m(0,"div",21)(1,"div",22),a(2),_(),m(3,"div",23),N(4,Le,4,2,null,null,Fe),_()()),o&2){let e=g(2);me("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),l(2),c(e.tooltip().data.date),l(2),U(e.tooltipLines())}}function Ge(o,t){if(o&1&&(m(0,"div",8)(1,"span",10),a(2),_()()),o&2){let e=g(2);l(2),c(e.tokenCoverageLabel())}}function Ye(o,t){if(o&1&&(m(0,"div",1),O(),m(1,"svg",2),k(2,"line",3)(3,"line",3),N(4,$e,5,8,":svg:g",4,Ie),N(6,Ve,2,3,":svg:text",5,Be),_(),v(8,je,6,5,"div",6),ie(),m(9,"div",7)(10,"div",8),k(11,"span",9),m(12,"span",10),a(13,"Cost (per day)"),_(),m(14,"span",11),a(15),_()(),m(16,"div",8),k(17,"span",12),m(18,"span",10),a(19,"Prompt tokens"),_()(),m(20,"div",8),k(21,"span",13),m(22,"span",10),a(23,"Completion tokens"),_()(),m(24,"div",8),k(25,"span",14),m(26,"span",10),a(27,"Tokens missing"),_()(),m(28,"div",8)(29,"span",10),a(30,"Tokens scale"),_(),m(31,"span",11),a(32),_()(),v(33,Ge,3,1,"div",8),_()()),o&2){let e=g();l(),f("viewBox",e.viewBox),l(),f("y1",e.yTop)("x2",720)("y2",e.yTop),l(),f("y1",e.yBase)("x2",720)("y2",e.yBase),l(),U(e.bars()),l(2),U(e.axisLabels()),l(2),y(e.tooltip().visible&&e.tooltip().data?8:-1),l(7),E("max ",e.maxCostLabel()),l(17),E("max ",e.maxTokensLabel()),l(),y(e.tokenCoverageLabel()?33:-1)}}var G=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=p(()=>(this.points??[]).filter(t=>!!t.date));maxCost=p(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=p(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,i=e.completionTokens??null;return n===null&&i===null?null:(n??0)+(i??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=p(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=p(()=>"$"+(new D("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=p(()=>new D("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=h({visible:!1,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,i=e===null&&n===null?null:(e??0)+(n??0);return{date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:i,callCount:t.callCount??0}}showTooltip(t,e){let i=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=i?t.clientX-i.left:t.clientX,u=i?t.clientY-i.top:t.clientY,b=320,M=170,I=12,C=i?Math.max(0,i.width-b-I):d,B=i?Math.max(0,i.height-M-I):u,F=i?Math.min(Math.max(0,d),C):d,te=i?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:!0,x:F,y:te,data:this.toTooltipData(e)})}hideTooltip(){this.tooltip.update(t=>A(R({},t),{visible:!1}))}formatTokens(t){return t===null?"\u2014":new D("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return"$"+(new D("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=p(()=>{let t=this.tooltip(),e=t.data;return!t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let n=(this.innerW-(e-1)*this.groupGap)/e,i=Math.max(2,n),d=(i-this.barGap)/2,u=Math.max(1,d),b=this.maxCost()||1,M=this.maxTokens()||1,I=45;return t.map((C,B)=>{let F=this.paddingX+B*(i+this.groupGap),we=(C.cost??0)/b*this.innerH,ne=C.promptTokens,oe=C.completionTokens,K=ne!==null||oe!==null,De=ne??0,Ee=oe??0,Oe=K?De/M*this.innerH:null,Ne=K?Ee/M*this.innerH:null;return{date:C.date,point:C,xGroup:F,groupW:i,xCost:F,w:u,costH:we,xTokens:F+u+this.barGap,promptH:Oe,completionH:Ne,tokensStubH:K?null:I}})});axisLabels=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let i=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((b,M)=>({p:b,i:M})).filter(({i:b})=>b%i===0||b===e-1).map(({p:b,i:M})=>{let C=this.paddingX+M*(u+this.groupGap)+u/2,B=b.date.slice(5);return{x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&v(0,Re,2,0,"div",0)(1,Ye,34,11,"div",1),e&2&&y(n.safePoints().length===0?0:1)},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"],changeDetection:0})};var z=class o{http=T(pe);getTokenUsage(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};function Te(o){return`${o}`.padStart(2,"0")}function ke(o){return`${o.getUTCFullYear()}-${Te(o.getUTCMonth()+1)}-${Te(o.getUTCDate())}`}function ze(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function We(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var W=class o{api=T(z);destroyRef=T(re);defaultFrom=ke(ze());defaultTo=ke(We());draftFilters=h({from:this.defaultFrom,to:this.defaultTo});appliedFilters=h({from:this.defaultFrom,to:this.defaultTo});loading=h(!1);error=h(null);aggregation=h(null);seriesResponse=h(null);series=h(null);tokenDataPartial=h(!1);aggregationByModelId=h(null);seriesByModelId=h(null);init(){this.reload()}setDraftFrom(t){this.draftFilters.update(e=>A(R({},e),{from:t}))}setDraftTo(t){this.draftFilters.update(e=>A(R({},e),{to:t}))}clearDraftFrom(){this.setDraftFrom(null)}clearDraftTo(){this.setDraftTo(null)}apply(){this.appliedFilters.set(this.draftFilters()),this.reload()}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let i=n.modelId,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,i)=>(i.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let i=`${n.date}|${n.modelId}`,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,i)=>n.date<i.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(!0),this.error.set(null),ae({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(_e(this.destroyRef)).subscribe({next:({aggregation:n,series:i})=>{this.aggregation.set(n),this.seriesResponse.set(i);let d=i.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||i.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(!1)},error:n=>{this.loading.set(!1),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(!1),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage")}})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};var X=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},Me=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:X,set:X,deleteProperty:X,has:X}),J=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(Me,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"call",type:o,pure:!0})},q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(Me,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"apply",type:o,pure:!0})};function Xe(o,t){o&1&&(s(0,"div",24),a(1," Partial data \u2014 token counts may not cover the full period "),r())}function Je(o,t){o&1&&(s(0,"div",25),a(1," No token data collected for this period "),r())}function qe(o,t){if(o&1&&(s(0,"div",20)(1,"div",21)(2,"div",22),a(3,"Total tokens"),r(),s(4,"div",23),a(5),x(6,"call"),r()(),s(7,"div",21)(8,"div",22),a(9,"Total calls"),r(),s(10,"div",23),a(11),r()(),s(12,"div",21)(13,"div",22),a(14,"Total cost"),r(),s(15,"div",23),a(16),x(17,"apply"),r()()(),v(18,Xe,2,0,"div",24),v(19,Je,2,0,"div",25)),o&2){let e=g();l(5),c(w(6,5,e.totalRow().totalTokens,e.formatTokenValue)),l(6),c(e.totalRow().callCount),l(5),c(j(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),l(2),y(e.isPartialPeriod()?18:-1),l(),y(e.isMissingPeriod()?19:-1)}}function Ke(o,t){o&1&&(s(0,"div",17)(1,"div",26),a(2,"Loading token usage\u2026"),r()())}function Qe(o,t){if(o&1&&(s(0,"div",18)(1,"div",27),a(2,"Failed to load"),r(),s(3,"div",26),a(4),r()()),o&2){let e=g();l(4),c(e.state.error())}}function Ze(o,t){o&1&&(s(0,"div",17)(1,"div",27),a(2,"No data"),r(),s(3,"div",26),a(4,"No token usage recorded yet for this period."),r()())}function et(o,t){if(o&1&&(s(0,"div",33)(1,"div",30),a(2),r(),s(3,"div",30),a(4),r(),s(5,"div",30),a(6),r(),s(7,"div",31),a(8),x(9,"call"),r(),s(10,"div",31),a(11),x(12,"call"),r(),s(13,"div",31),a(14),x(15,"call"),r(),s(16,"div",31),a(17),r(),s(18,"div",31),a(19),x(20,"apply"),r()()),o&2){let e=t.$implicit,n=g(2);l(2),c(e.agentName),l(2),c(e.providerName),l(2),c(e.modelId),l(2),c(w(9,8,e.promptTokens,n.formatTokenValue)),l(3),c(w(12,11,e.completionTokens,n.formatTokenValue)),l(3),c(w(15,14,e.totalTokens,n.formatTokenValue)),l(3),c(e.callCount),l(2),E(" ",j(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ")}}function tt(o,t){if(o&1&&(s(0,"div",34)(1,"div",30),a(2),r(),s(3,"div",30),a(4),r(),s(5,"div",30),a(6),r(),s(7,"div",31),a(8),x(9,"call"),r(),s(10,"div",31),a(11),x(12,"call"),r(),s(13,"div",31),a(14),x(15,"call"),r(),s(16,"div",31),a(17),r(),s(18,"div",31),a(19),x(20,"apply"),r()()),o&2){let e=g(2);l(2),c(e.totalRow().agentName),l(2),c(e.totalRow().providerName),l(2),c(e.totalRow().modelId),l(2),c(w(9,8,e.totalRow().promptTokens,e.formatTokenValue)),l(3),E(" ",w(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),l(3),c(w(15,14,e.totalRow().totalTokens,e.formatTokenValue)),l(3),c(e.totalRow().callCount),l(2),E(" ",j(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ")}}function nt(o,t){if(o&1&&(s(0,"div",19)(1,"section",17)(2,"div",27),a(3,"Summary"),r(),s(4,"div",28)(5,"div",29)(6,"div",30),a(7,"agentName"),r(),s(8,"div",30),a(9,"providerName"),r(),s(10,"div",30),a(11,"modelId"),r(),s(12,"div",31),a(13,"promptTokens"),r(),s(14,"div",31),a(15,"completionTokens"),r(),s(16,"div",31),a(17,"totalTokens"),r(),s(18,"div",31),a(19,"callCount"),r(),s(20,"div",31),a(21,"cost"),r()(),s(22,"div",32),N(23,et,21,21,"div",33,se().trackRow,!0),v(25,tt,21,21,"div",34),r()()(),s(26,"section",17)(27,"div",27),a(28,"Daily series"),r(),Z(29,"app-daily-series-chart",35),r()()),o&2){let e=g();l(23),U(e.rows()),l(2),y(e.totalRow()?25:-1),l(4),S("points",e.chartPoints())}}var Se="\u2014",Pe=class o{router=T(ge);projectState=T(ue);state=T(W);view=h("byModel");rowsByAgent=p(()=>this.state.aggregation()?.models??[]);totalRow=p(()=>this.state.aggregation()?.total??null);rowsByModel=p(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=p(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=p(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=p(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=p(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=p(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:!1});ngOnInit(){this.state.init()}onFromChange(t){this.state.setDraftFrom(t||null)}onToChange(t){this.state.setDraftTo(t||null)}clearFrom(){this.state.clearDraftFrom()}clearTo(){this.state.clearDraftTo()}apply(){this.state.apply()}aggregateDailyPoints(t){let e=new Map;for(let n of t){let i=e.get(n.date);if(!i)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else{let d=(u,b)=>u===null&&b===null?null:(u??0)+(b??0);i.promptTokens=d(i.promptTokens,n.promptTokens),i.completionTokens=d(i.completionTokens,n.completionTokens),i.cost=(i.cost??0)+(n.cost??0),i.callCount=(i.callCount??0)+(n.callCount??0)}}return[...e.values()].sort((n,i)=>n.date<i.date?-1:1)}trackRow(t,e){return`${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=p(()=>{if(this.state.loading())return!1;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):!1});isPartialPeriod=p(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBackToProject(){let t=this.projectState.getSelectedProjectId();this.router.navigate(t?["project",t]:["/"])}formatTokenValue(t){return t===null?Se:new D("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?Se:"$"+(new D("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-token-usage"]],decls:40,vars:9,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["type","button","title","Back to project",1,"page__logo-btn",3,"click"],["alt","Coday",1,"page__logo"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(s(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),P("click",function(){return n.navigateBackToProject()}),Z(4,"img",4),r(),s(5,"div")(6,"h1",5),a(7,"Token Usage"),r(),s(8,"p",6),a(9,"Track prompt and completion token usage by agent and model."),r()()(),s(10,"div",7)(11,"label",8)(12,"span",9),a(13,"From"),r(),s(14,"div",10)(15,"input",11),P("ngModelChange",function(d){return n.onFromChange(d)}),r(),s(16,"button",12),P("click",function(){return n.clearFrom()}),a(17," Clear "),r()()(),s(18,"label",8)(19,"span",9),a(20,"To"),r(),s(21,"div",10)(22,"input",11),P("ngModelChange",function(d){return n.onToChange(d)}),r(),s(23,"button",12),P("click",function(){return n.clearTo()}),a(24," Clear "),r()()(),s(25,"label",8)(26,"span",9),a(27,"View"),r(),s(28,"select",13),P("ngModelChange",function(d){return n.view.set(d)}),s(29,"option",14),a(30,"By model"),r(),s(31,"option",15),a(32,"By agent"),r()()(),s(33,"button",16),P("click",function(){return n.apply()}),a(34,"Apply"),r()()(),v(35,qe,20,12),v(36,Ke,3,0,"div",17)(37,Qe,5,1,"div",18)(38,Ze,5,0,"div",17)(39,nt,30,2,"div",19),r()),e&2&&(l(4),f("src","CODAY-Logo.png",le),l(11),S("ngModel",n.state.draftFilters().from),l(),S("disabled",!n.state.draftFilters().from),l(6),S("ngModel",n.state.draftFilters().to),l(),S("disabled",!n.state.draftFilters().to),l(5),S("ngModel",n.view()),l(5),S("disabled",n.state.loading()),l(2),y(n.totalRow()?35:-1),l(),y(n.state.loading()?36:n.state.error()?37:n.isEmpty()?38:39))},dependencies:[Ce,ye,xe,he,ve,be,fe,G,J,q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__logo-btn[_ngcontent-%COMP%]{flex:0 0 auto;width:40px;height:40px;padding:0;border-radius:12px;border:1px solid var(--glass-border, rgba(255, 255, 255, .18));background:var(--glass-bg, rgba(255, 255, 255, .72));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08));cursor:pointer}.page__logo-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .03))}.page__logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;padding:6px}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media(max-width:900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media(max-width:1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"]})};export{Pe as TokenUsageComponent};
@@ -1 +1 @@
1
- import{Ka as G,P as m,R as F,S as C,T as O,U as W,a as u,b as f,f as N,jc as k,lc as h,mc as E}from"./chunk-3PAE676O.js";var x=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:b,apiKeys:t,basePath:r,credentials:s,encodeParam:o,encoder:n,password:e,username:l,withCredentials:p}={}){t&&(this.apiKeys=t),l!==void 0&&(this.username=l),e!==void 0&&(this.password=e),b!==void 0&&(this.accessToken=b),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),n&&(this.encoder=n),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=s??{}}selectHeaderContentType(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}selectHeaderAccept(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}isJsonMime(b){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return b!==null&&(t.test(b)||b.toLowerCase()==="application/json-patch+json")}lookupCredential(b){let t=this.credentials[b];return typeof t=="function"?t():t}addCredentialToHeaders(b,t,r,s){let o=this.lookupCredential(b);return o?r.set(t,(s??"")+o):r}addCredentialToQuery(b,t,r){let s=this.lookupCredential(b);return s?r.set(t,s):r}defaultEncodeParam(b){let t=b.dataFormat==="date-time"&&b.value instanceof Date?b.value.toISOString():b.value;return encodeURIComponent(String(t))}};var A=new F("basePath");var R=class{encodeKey(b){return encodeURIComponent(b)}encodeValue(b){return encodeURIComponent(b)}decodeKey(b){return decodeURIComponent(b)}decodeValue(b){return decodeURIComponent(b)}};var P=class{basePath="http://localhost:8123";defaultHeaders=new k;configuration;encoder;constructor(b,t){if(this.configuration=t||new x,typeof this.configuration.basePath!="string"){let r=Array.isArray(b)?b[0]:void 0;r!=null&&(b=r),typeof b!="string"&&(b=this.basePath),this.configuration.basePath=b}this.encoder=this.configuration.encoder||new R}canConsumeForm(b){return b.indexOf("multipart/form-data")!==-1}addToHttpParams(b,t,r,s=!1){return typeof t=="object"&&!(t instanceof Date)?this.addToHttpParamsRecursive(b,t,s?r:void 0,s):this.addToHttpParamsRecursive(b,t,r)}addToHttpParamsRecursive(b,t,r,s=!1){if(t==null)return b;if(typeof t=="object"){if(r!=null)return s?Object.keys(t).reduce((o,n)=>o.append(`${r}[${n}]`,t[n]),b):b.append(r,JSON.stringify(t));if(Array.isArray(t))t.forEach(o=>b=this.addToHttpParamsRecursive(b,o,r));else if(t instanceof Date)if(r!=null)b=b.append(r,t.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(t).forEach(o=>{let n=r?`${r}.${o}`:o;b=this.addToHttpParamsRecursive(b,t[o],n)});return b}else if(r!=null)return b.append(r,t);throw Error("key may not be null if value is not object or array")}};var V=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}addMessage(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling addMessage.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessage.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}create1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter _case was null or undefined when calling create1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}killCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling stopCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update1(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update1.");if(r==null)throw new Error("Required parameter _case was null or undefined when calling update1.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var I=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}_delete(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling _delete.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}create(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter namespace was null or undefined when calling create.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listAll(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/namespaces",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}listByParent(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling update.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var S=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}create2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling create2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update2(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update2.");if(r==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling update2.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var $=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}debugAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}debugPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}getPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}reloadAllAgents(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}reloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}startPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}unloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}uploadPlugin(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var q=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}streamEvents(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling streamEvents.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var B=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}executeTool(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling executeTool.");if(r==null)throw new Error("Required parameter requestBody was null or undefined when calling executeTool.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/execute`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}getTool(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling getTool.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listTools(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/tools",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};function Lt(g){return W([typeof g=="string"?{provide:A,useValue:g}:{provide:x,useValue:new x(u({},g))}])}var M=class g{config=O(x);zone=O(G);connect(b){let t=`${this.config.basePath}/api/cases/${b}/events`;return new N(r=>{let s=this.zone.runOutsideAngular(()=>new EventSource(t));return s.onmessage=o=>{try{let n=JSON.parse(o.data);this.zone.run(()=>r.next(n))}catch(n){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${n}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${b}`))),s.close()},()=>s.close()})}static \u0275fac=function(t){return new(t||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{x as a,V as b,I as c,$ as d,Lt as e};
1
+ import{P as m,R as F,S as C,T as O,U as W,a as u,b as f,da as G,f as N,kc as k,lc as h,nc as E}from"./chunk-3PJTGTYA.js";var x=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:b,apiKeys:t,basePath:r,credentials:s,encodeParam:o,encoder:n,password:e,username:l,withCredentials:p}={}){t&&(this.apiKeys=t),l!==void 0&&(this.username=l),e!==void 0&&(this.password=e),b!==void 0&&(this.accessToken=b),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),n&&(this.encoder=n),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=s??{}}selectHeaderContentType(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}selectHeaderAccept(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}isJsonMime(b){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return b!==null&&(t.test(b)||b.toLowerCase()==="application/json-patch+json")}lookupCredential(b){let t=this.credentials[b];return typeof t=="function"?t():t}addCredentialToHeaders(b,t,r,s){let o=this.lookupCredential(b);return o?r.set(t,(s??"")+o):r}addCredentialToQuery(b,t,r){let s=this.lookupCredential(b);return s?r.set(t,s):r}defaultEncodeParam(b){let t=b.dataFormat==="date-time"&&b.value instanceof Date?b.value.toISOString():b.value;return encodeURIComponent(String(t))}};var A=new F("basePath");var R=class{encodeKey(b){return encodeURIComponent(b)}encodeValue(b){return encodeURIComponent(b)}decodeKey(b){return decodeURIComponent(b)}decodeValue(b){return decodeURIComponent(b)}};var P=class{basePath="http://localhost:8123";defaultHeaders=new k;configuration;encoder;constructor(b,t){if(this.configuration=t||new x,typeof this.configuration.basePath!="string"){let r=Array.isArray(b)?b[0]:void 0;r!=null&&(b=r),typeof b!="string"&&(b=this.basePath),this.configuration.basePath=b}this.encoder=this.configuration.encoder||new R}canConsumeForm(b){return b.indexOf("multipart/form-data")!==-1}addToHttpParams(b,t,r,s=!1){return typeof t=="object"&&!(t instanceof Date)?this.addToHttpParamsRecursive(b,t,s?r:void 0,s):this.addToHttpParamsRecursive(b,t,r)}addToHttpParamsRecursive(b,t,r,s=!1){if(t==null)return b;if(typeof t=="object"){if(r!=null)return s?Object.keys(t).reduce((o,n)=>o.append(`${r}[${n}]`,t[n]),b):b.append(r,JSON.stringify(t));if(Array.isArray(t))t.forEach(o=>b=this.addToHttpParamsRecursive(b,o,r));else if(t instanceof Date)if(r!=null)b=b.append(r,t.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(t).forEach(o=>{let n=r?`${r}.${o}`:o;b=this.addToHttpParamsRecursive(b,t[o],n)});return b}else if(r!=null)return b.append(r,t);throw Error("key may not be null if value is not object or array")}};var V=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}addMessage(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling addMessage.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessage.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}create1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter _case was null or undefined when calling create1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}killCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling stopCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update1(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update1.");if(r==null)throw new Error("Required parameter _case was null or undefined when calling update1.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var I=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}_delete(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling _delete.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}create(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter namespace was null or undefined when calling create.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listAll(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/namespaces",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}listByParent(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling update.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var S=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}create2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling create2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update2(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update2.");if(r==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling update2.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var $=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}debugAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}debugPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}getPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}reloadAllAgents(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}reloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}startPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}unloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}uploadPlugin(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var q=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}streamEvents(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling streamEvents.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var B=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}executeTool(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling executeTool.");if(r==null)throw new Error("Required parameter requestBody was null or undefined when calling executeTool.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/execute`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}getTool(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling getTool.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listTools(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/tools",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};function Lt(g){return W([typeof g=="string"?{provide:A,useValue:g}:{provide:x,useValue:new x(u({},g))}])}var M=class g{config=O(x);zone=O(G);connect(b){let t=`${this.config.basePath}/api/cases/${b}/events`;return new N(r=>{let s=this.zone.runOutsideAngular(()=>new EventSource(t));return s.onmessage=o=>{try{let n=JSON.parse(o.data);this.zone.run(()=>r.next(n))}catch(n){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${n}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${b}`))),s.close()},()=>s.close()})}static \u0275fac=function(t){return new(t||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{x as a,V as b,I as c,$ as d,Lt as e};
@@ -0,0 +1 @@
1
+ import{M as c,P as p,T as l,l as s,nc as g,p as a}from"./chunk-3PJTGTYA.js";var m=class n{http=l(g);agentsCache=new Map;getAgents(e){let t=this.agentsCache.get(e);return t?s(t):this.http.get(`/api/projects/${e}/agents`).pipe(c(r=>{this.agentsCache.set(e,r)}))}getAgentsAutocomplete(e,t){return this.getAgents(e).pipe(a(r=>{if(!t)return r;let o=t.toLowerCase();return r.filter(i=>{let h=i.name.toLowerCase(),u=i.description?.toLowerCase()||"";return h.includes(o)||u.includes(o)})}))}clearCache(e){this.agentsCache.delete(e)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})};export{m as a};
@@ -1 +1 @@
1
- import{v as E}from"./chunk-ECRX3VCL.js";import{a as S}from"./chunk-LD7RXVSY.js";import{c as A,e as v,g as j,h as G,j as h,l as U,p as H,z as J}from"./chunk-ZLBM7VXJ.js";import{c as B}from"./chunk-F4BEHTG5.js";import{Ba as y,J as k,Ja as w,Jb as q,Kb as F,Qa as I,Ra as u,Sa as C,T as N,Va as L,Wa as R,X as l,Xa as f,Y as m,Ya as o,Za as r,_a as V,a as D,b as P,ba as T,cc as z,fa as g,fb as b,h as O,hb as d,jb as s,rc as $,sa as c,xb as p,yb as x}from"./chunk-3PAE676O.js";function X(i,t){if(i&1&&(o(0,"span",3),p(1),r()),i&2){let e=s();c(),x(e.namespace.description)}}function Y(i,t){if(i&1){let e=b();o(0,"span",5),p(1,"Delete?"),r(),o(2,"ds-icon-button",6),d("action",function(){l(e);let n=s();return m(n.onDeleteConfirmed())}),r(),o(3,"ds-icon-button",7),d("action",function(){l(e);let n=s();return m(n.onDeleteCancelled())}),r()}}function Z(i,t){if(i&1){let e=b();o(0,"ds-icon-button",8),d("action",function(){l(e);let n=s();return m(n.onEdit())}),r(),o(1,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.onDeleteArmed())}),r()}}var M=class i{namespace;selected=new w;editRequested=new w;deleteRequested=new w;pendingDelete=g(!1);onSelect(){this.selected.emit(this.namespace)}onEdit(){this.editRequested.emit(this.namespace)}onDeleteArmed(){this.pendingDelete.set(!0)}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=y({type:i,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:8,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[1,"namespace-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","edit","title","Edit namespace",3,"action"],["icon","delete","variant","danger","title","Delete namespace",3,"action"]],template:function(e,a){e&1&&(o(0,"div",0)(1,"button",1),d("click",function(){return a.onSelect()}),o(2,"span",2),p(3),r(),u(4,X,2,1,"span",3),r(),o(5,"div",4),u(6,Y,4,0)(7,Z,2,0),r()()),e&2&&(c(3),x(a.namespace.name),c(),C(a.namespace.description?4:-1),c(2),C(a.pendingDelete()?6:7))},dependencies:[E],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}.namespace-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};function ee(i,t){if(i&1){let e=b();o(0,"form",5),d("ngSubmit",function(){l(e);let n=s();return m(n.submitCreate())}),V(1,"input",6)(2,"input",7),o(3,"div",8)(4,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.submitCreate())}),r(),o(5,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelCreate())}),r()()()}if(i&2){let e=s();c(),f("formControl",e.nameControl),c(),f("formControl",e.descriptionControl),c(2),f("disabled",e.nameControl.invalid||e.isSubmitting())}}function te(i,t){if(i&1){let e=b();o(0,"form",11),d("ngSubmit",function(){l(e);let n=s();return m(n.submitEdit())}),o(1,"p",12),p(2," Editing: "),o(3,"strong"),p(4),r()(),V(5,"input",6)(6,"input",7),o(7,"div",8)(8,"ds-icon-button",13),d("action",function(){l(e);let n=s();return m(n.submitEdit())}),r(),o(9,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelEdit())}),r()()()}if(i&2){let e=s();c(4),x(t.name),c(),f("formControl",e.editNameControl),c(),f("formControl",e.editDescriptionControl),c(2),f("disabled",e.editNameControl.invalid||e.isEditSubmitting())}}function ne(i,t){i&1&&(o(0,"div",14)(1,"p"),p(2,"No namespaces yet. Create one above."),r()())}function ie(i,t){if(i&1){let e=b();o(0,"agentos-namespace-item",17),d("selected",function(n){l(e);let _=s(3);return m(_.select(n))})("editRequested",function(n){l(e);let _=s(3);return m(_.openEditForm(n))})("deleteRequested",function(n){l(e);let _=s(3);return m(_.deleteNamespace(n))}),r()}if(i&2){let e=t.$implicit;f("namespace",e)}}function oe(i,t){if(i&1&&(o(0,"ul",15),L(1,ie,1,1,"agentos-namespace-item",16,I().trackById,!0),r()),i&2){let e=s();c(),R(e)}}function ae(i,t){i&1&&u(0,ne,3,0,"div",14)(1,oe,3,0,"ul",15),i&2&&C(t.length===0?0:1)}var K=class i{router=N($);namespaceController=N(B);destroyRef=N(T);refresh$=new O(void 0);namespaces$=this.refresh$.pipe(k(()=>this.namespaceController.listAll()));nameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});descriptionControl=new h("",{nonNullable:!0});isCreating=g(!1);isSubmitting=g(!1);editNameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});editDescriptionControl=new h("",{nonNullable:!0});editingNamespace=g(null);isEditSubmitting=g(!1);select(t){this.router.navigate(["/agentos",t.id,"cases"])}openCreateForm(){this.nameControl.reset(),this.descriptionControl.reset(),this.isCreating.set(!0),this.editingNamespace.set(null)}cancelCreate(){this.isCreating.set(!1)}submitCreate(){if(this.nameControl.invalid||this.isSubmitting())return;let t=D({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{});this.isSubmitting.set(!0),this.namespaceController.create(t).pipe(S(this.destroyRef)).subscribe({next:()=>{this.isCreating.set(!1),this.isSubmitting.set(!1),this.refresh$.next()},error:()=>this.isSubmitting.set(!1)})}openEditForm(t){this.editNameControl.setValue(t.name),this.editDescriptionControl.setValue(t.description??""),this.editingNamespace.set(t),this.isCreating.set(!1)}cancelEdit(){this.editingNamespace.set(null)}submitEdit(){let t=this.editingNamespace();if(!t||this.editNameControl.invalid||this.isEditSubmitting())return;let e=P(D({},t),{name:this.editNameControl.value.trim(),description:this.editDescriptionControl.value.trim()||void 0});this.isEditSubmitting.set(!0),this.namespaceController.update(t.id,e).pipe(S(this.destroyRef)).subscribe({next:()=>{this.editingNamespace.set(null),this.isEditSubmitting.set(!1),this.refresh$.next()},error:()=>this.isEditSubmitting.set(!1)})}deleteNamespace(t){this.namespaceController._delete(t.id).pipe(S(this.destroyRef)).subscribe(()=>this.refresh$.next())}trackById(t,e){return e.id}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=y({type:i,selectors:[["agentos-namespace-list"]],decls:9,vars:5,consts:[[1,"namespace-list"],[1,"namespace-list__header"],["icon","add","variant","primary","title","Create namespace",3,"action"],[1,"namespace-list__create-form"],[1,"namespace-list__create-form","namespace-list__edit-form"],[1,"namespace-list__create-form",3,"ngSubmit"],["type","text","placeholder","Namespace name *",1,"namespace-list__input",3,"formControl"],["type","text","placeholder","Description (optional)",1,"namespace-list__input",3,"formControl"],[1,"namespace-list__create-actions"],["icon","check","variant","primary","title","Confirm",3,"action","disabled"],["icon","close","title","Cancel",3,"action"],[1,"namespace-list__create-form","namespace-list__edit-form",3,"ngSubmit"],[1,"namespace-list__edit-label"],["icon","check","variant","primary","title","Save changes",3,"action","disabled"],[1,"namespace-list__empty"],["role","list",1,"namespace-list__items"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","namespace"]],template:function(e,a){if(e&1&&(o(0,"div",0)(1,"header",1)(2,"h2"),p(3,"Namespaces"),r(),o(4,"ds-icon-button",2),d("action",function(){return a.openCreateForm()}),r()(),u(5,ee,6,3,"form",3),u(6,te,10,4,"form",4),u(7,ae,2,1),q(8,"async"),r()),e&2){let n,_;c(5),C(a.isCreating()?5:-1),c(),C((n=a.editingNamespace())?6:-1,n),c(),C((_=F(8,3,a.namespaces$))?7:-1,_)}},dependencies:[J,U,A,j,G,H,E,M,z],styles:[".namespace-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem;gap:1.5rem;max-width:640px;margin:0 auto}.namespace-list__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.namespace-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-list__create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1rem;border-radius:12px;border:1px solid var(--color-primary, #007aff);background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.namespace-list__input[_ngcontent-%COMP%]{width:100%;padding:.6rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-list__create-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.namespace-list__items[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.namespace-list__edit-form[_ngcontent-%COMP%]{border-color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%]{margin:0 0 .25rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f)}.namespace-list__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}"]})};export{M as a,K as b};
1
+ import{w as E}from"./chunk-VQANVQD7.js";import{a as S}from"./chunk-X2YT3IIX.js";import{c as A,e as v,g as j,h as G,j as h,l as U,p as H,z as J}from"./chunk-WW2QH6WR.js";import{c as B}from"./chunk-G4KHFN3J.js";import{$a as V,Ea as w,J as k,Kb as q,Lb as F,Ra as I,Sa as u,T as y,Ta as C,Wa as L,X as l,Xa as R,Y as m,Ya as f,Za as o,_a as r,a as D,b as P,ba as T,ca as N,dc as z,ga as g,gb as b,h as O,ib as d,kb as s,sc as $,ua as c,yb as p,zb as x}from"./chunk-3PJTGTYA.js";function X(i,t){if(i&1&&(o(0,"span",3),p(1),r()),i&2){let e=s();c(),x(e.namespace.description)}}function Y(i,t){if(i&1){let e=b();o(0,"span",5),p(1,"Delete?"),r(),o(2,"ds-icon-button",6),d("action",function(){l(e);let n=s();return m(n.onDeleteConfirmed())}),r(),o(3,"ds-icon-button",7),d("action",function(){l(e);let n=s();return m(n.onDeleteCancelled())}),r()}}function Z(i,t){if(i&1){let e=b();o(0,"ds-icon-button",8),d("action",function(){l(e);let n=s();return m(n.onEdit())}),r(),o(1,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.onDeleteArmed())}),r()}}var M=class i{namespace;selected=new N;editRequested=new N;deleteRequested=new N;pendingDelete=g(!1);onSelect(){this.selected.emit(this.namespace)}onEdit(){this.editRequested.emit(this.namespace)}onDeleteArmed(){this.pendingDelete.set(!0)}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=w({type:i,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:8,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[1,"namespace-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","edit","title","Edit namespace",3,"action"],["icon","delete","variant","danger","title","Delete namespace",3,"action"]],template:function(e,a){e&1&&(o(0,"div",0)(1,"button",1),d("click",function(){return a.onSelect()}),o(2,"span",2),p(3),r(),u(4,X,2,1,"span",3),r(),o(5,"div",4),u(6,Y,4,0)(7,Z,2,0),r()()),e&2&&(c(3),x(a.namespace.name),c(),C(a.namespace.description?4:-1),c(2),C(a.pendingDelete()?6:7))},dependencies:[E],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}.namespace-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};function ee(i,t){if(i&1){let e=b();o(0,"form",5),d("ngSubmit",function(){l(e);let n=s();return m(n.submitCreate())}),V(1,"input",6)(2,"input",7),o(3,"div",8)(4,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.submitCreate())}),r(),o(5,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelCreate())}),r()()()}if(i&2){let e=s();c(),f("formControl",e.nameControl),c(),f("formControl",e.descriptionControl),c(2),f("disabled",e.nameControl.invalid||e.isSubmitting())}}function te(i,t){if(i&1){let e=b();o(0,"form",11),d("ngSubmit",function(){l(e);let n=s();return m(n.submitEdit())}),o(1,"p",12),p(2," Editing: "),o(3,"strong"),p(4),r()(),V(5,"input",6)(6,"input",7),o(7,"div",8)(8,"ds-icon-button",13),d("action",function(){l(e);let n=s();return m(n.submitEdit())}),r(),o(9,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelEdit())}),r()()()}if(i&2){let e=s();c(4),x(t.name),c(),f("formControl",e.editNameControl),c(),f("formControl",e.editDescriptionControl),c(2),f("disabled",e.editNameControl.invalid||e.isEditSubmitting())}}function ne(i,t){i&1&&(o(0,"div",14)(1,"p"),p(2,"No namespaces yet. Create one above."),r()())}function ie(i,t){if(i&1){let e=b();o(0,"agentos-namespace-item",17),d("selected",function(n){l(e);let _=s(3);return m(_.select(n))})("editRequested",function(n){l(e);let _=s(3);return m(_.openEditForm(n))})("deleteRequested",function(n){l(e);let _=s(3);return m(_.deleteNamespace(n))}),r()}if(i&2){let e=t.$implicit;f("namespace",e)}}function oe(i,t){if(i&1&&(o(0,"ul",15),L(1,ie,1,1,"agentos-namespace-item",16,I().trackById,!0),r()),i&2){let e=s();c(),R(e)}}function ae(i,t){i&1&&u(0,ne,3,0,"div",14)(1,oe,3,0,"ul",15),i&2&&C(t.length===0?0:1)}var K=class i{router=y($);namespaceController=y(B);destroyRef=y(T);refresh$=new O(void 0);namespaces$=this.refresh$.pipe(k(()=>this.namespaceController.listAll()));nameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});descriptionControl=new h("",{nonNullable:!0});isCreating=g(!1);isSubmitting=g(!1);editNameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});editDescriptionControl=new h("",{nonNullable:!0});editingNamespace=g(null);isEditSubmitting=g(!1);select(t){this.router.navigate(["/agentos",t.id,"cases"])}openCreateForm(){this.nameControl.reset(),this.descriptionControl.reset(),this.isCreating.set(!0),this.editingNamespace.set(null)}cancelCreate(){this.isCreating.set(!1)}submitCreate(){if(this.nameControl.invalid||this.isSubmitting())return;let t=D({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{});this.isSubmitting.set(!0),this.namespaceController.create(t).pipe(S(this.destroyRef)).subscribe({next:()=>{this.isCreating.set(!1),this.isSubmitting.set(!1),this.refresh$.next()},error:()=>this.isSubmitting.set(!1)})}openEditForm(t){this.editNameControl.setValue(t.name),this.editDescriptionControl.setValue(t.description??""),this.editingNamespace.set(t),this.isCreating.set(!1)}cancelEdit(){this.editingNamespace.set(null)}submitEdit(){let t=this.editingNamespace();if(!t||this.editNameControl.invalid||this.isEditSubmitting())return;let e=P(D({},t),{name:this.editNameControl.value.trim(),description:this.editDescriptionControl.value.trim()||void 0});this.isEditSubmitting.set(!0),this.namespaceController.update(t.id,e).pipe(S(this.destroyRef)).subscribe({next:()=>{this.editingNamespace.set(null),this.isEditSubmitting.set(!1),this.refresh$.next()},error:()=>this.isEditSubmitting.set(!1)})}deleteNamespace(t){this.namespaceController._delete(t.id).pipe(S(this.destroyRef)).subscribe(()=>this.refresh$.next())}trackById(t,e){return e.id}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=w({type:i,selectors:[["agentos-namespace-list"]],decls:9,vars:5,consts:[[1,"namespace-list"],[1,"namespace-list__header"],["icon","add","variant","primary","title","Create namespace",3,"action"],[1,"namespace-list__create-form"],[1,"namespace-list__create-form","namespace-list__edit-form"],[1,"namespace-list__create-form",3,"ngSubmit"],["type","text","placeholder","Namespace name *",1,"namespace-list__input",3,"formControl"],["type","text","placeholder","Description (optional)",1,"namespace-list__input",3,"formControl"],[1,"namespace-list__create-actions"],["icon","check","variant","primary","title","Confirm",3,"action","disabled"],["icon","close","title","Cancel",3,"action"],[1,"namespace-list__create-form","namespace-list__edit-form",3,"ngSubmit"],[1,"namespace-list__edit-label"],["icon","check","variant","primary","title","Save changes",3,"action","disabled"],[1,"namespace-list__empty"],["role","list",1,"namespace-list__items"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","namespace"]],template:function(e,a){if(e&1&&(o(0,"div",0)(1,"header",1)(2,"h2"),p(3,"Namespaces"),r(),o(4,"ds-icon-button",2),d("action",function(){return a.openCreateForm()}),r()(),u(5,ee,6,3,"form",3),u(6,te,10,4,"form",4),u(7,ae,2,1),q(8,"async"),r()),e&2){let n,_;c(5),C(a.isCreating()?5:-1),c(),C((n=a.editingNamespace())?6:-1,n),c(),C((_=F(8,3,a.namespaces$))?7:-1,_)}},dependencies:[J,U,A,j,G,H,E,M,z],styles:[".namespace-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem;gap:1.5rem;max-width:640px;margin:0 auto}.namespace-list__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.namespace-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-list__create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1rem;border-radius:12px;border:1px solid var(--color-primary, #007aff);background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.namespace-list__input[_ngcontent-%COMP%]{width:100%;padding:.6rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-list__create-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.namespace-list__items[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.namespace-list__edit-form[_ngcontent-%COMP%]{border-color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%]{margin:0 0 .25rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f)}.namespace-list__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}"]})};export{M as a,K as b};
@@ -1 +1 @@
1
- import{a as y,b as P}from"./chunk-7Z6CCK6M.js";import{a as E}from"./chunk-2Q4GTKJ2.js";import{a as k}from"./chunk-MROX7XZW.js";import{v as _}from"./chunk-ECRX3VCL.js";import"./chunk-YLMEJS73.js";import"./chunk-LD7RXVSY.js";import"./chunk-ZLBM7VXJ.js";import{a as A}from"./chunk-PGXMHE2X.js";import{a as h,b as M,c as O}from"./chunk-VEECA5F5.js";import"./chunk-F4BEHTG5.js";import{Ba as p,Ra as g,Sa as b,Xa as f,Ya as e,Za as t,_a as u,fa as m,hb as a,jb as x,sa as l,xb as o,yb as C}from"./chunk-3PAE676O.js";var c=()=>!0;var z=[{path:"",loadComponent:()=>import("./chunk-5WM75OPU.js").then(n=>n.AgentosShellComponent),children:[{path:"",loadComponent:()=>import("./chunk-AH6TYV5V.js").then(n=>n.LayoutComponent),children:[{path:"namespaces",canActivate:[c],loadComponent:()=>import("./chunk-MLXAGMR7.js").then(n=>n.NamespaceListComponent)},{path:":namespaceId/cases",canActivate:[c],loadComponent:()=>import("./chunk-BIUQ3CWO.js").then(n=>n.CaseListComponent)},{path:":namespaceId/cases/:caseId",canActivate:[c],loadComponent:()=>import("./chunk-RFL5X6B6.js").then(n=>n.CaseChatComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function S(n,s){if(n&1&&(e(0,"p",11),o(1," Last action: "),e(2,"strong"),o(3),t()()),n&2){let r=x();l(3),C(r.lastAction())}}var v=class n{lastAction=m(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=p({type:n,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(r,i){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2),o(3,"AgentOS UI"),t(),e(4,"h1"),o(5,"Hello AgentOS"),t(),e(6,"p"),o(7," This component lives in "),e(8,"code"),o(9,"libs/agentos-ui"),t(),o(10," \u2014 isolated from Coday internals, ready to be published as "),e(11,"code"),o(12,"@whoz-oss/agentos-ui"),t(),o(13,". "),t(),u(14,"agentos-backend-status"),e(15,"ul",3)(16,"li"),o(17,"\u2726 No imports from Coday app"),t(),e(18,"li"),o(19,"\u2726 CSS custom properties as host contract"),t(),e(20,"li"),o(21,"\u2726 Standalone Angular components"),t(),e(22,"li"),o(23,"\u2726 Signals-first reactive state"),t()(),e(24,"div",4)(25,"p",5),o(26,"ds-icon-button from "),e(27,"code"),o(28,"@whoz-oss/design-system"),t()(),e(29,"div",6)(30,"ds-icon-button",7),a("action",function(){return i.onSend()}),t(),e(31,"ds-icon-button",8),a("action",function(){return i.onStop()}),t(),e(32,"ds-icon-button",9),a("action",function(){return i.onAttach()}),t(),e(33,"ds-icon-button",10),a("action",function(){return i.onAttach()}),t()(),g(34,S,4,1,"p",11),t()()()),r&2&&(l(33),f("disabled",!0),l(),b(i.lastAction()?34:-1))},dependencies:[_,h],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{z as AGENTOS_ROUTES,A as AgentosShellComponent,h as BackendStatusComponent,k as CaseChatComponent,E as CaseListComponent,M as HeaderComponent,v as HelloAgentosComponent,O as LayoutComponent,y as NamespaceItemComponent,P as NamespaceListComponent,c as agentosReadyGuard};
1
+ import{a as O,b as P}from"./chunk-L6CLRLNN.js";import{a as E}from"./chunk-MHSKFGOG.js";import{a as k}from"./chunk-PBAXETHQ.js";import{w as _}from"./chunk-VQANVQD7.js";import"./chunk-DE6SQRNU.js";import"./chunk-X2YT3IIX.js";import"./chunk-WW2QH6WR.js";import{a as y}from"./chunk-OOJRZK5J.js";import{a as h,b as A,c as M}from"./chunk-6PIG2VOY.js";import"./chunk-G4KHFN3J.js";import{$a as u,Ea as p,Sa as g,Ta as b,Ya as f,Za as e,_a as t,ga as m,ib as i,kb as x,ua as l,yb as o,zb as C}from"./chunk-3PJTGTYA.js";var c=()=>!0;var z=[{path:"",loadComponent:()=>import("./chunk-PGYHJCYD.js").then(n=>n.AgentosShellComponent),children:[{path:"",loadComponent:()=>import("./chunk-3HILRADK.js").then(n=>n.LayoutComponent),children:[{path:"namespaces",canActivate:[c],loadComponent:()=>import("./chunk-3GO76XRI.js").then(n=>n.NamespaceListComponent)},{path:":namespaceId/cases",canActivate:[c],loadComponent:()=>import("./chunk-WBWVKD3X.js").then(n=>n.CaseListComponent)},{path:":namespaceId/cases/:caseId",canActivate:[c],loadComponent:()=>import("./chunk-E5N6SPGL.js").then(n=>n.CaseChatComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function S(n,s){if(n&1&&(e(0,"p",11),o(1," Last action: "),e(2,"strong"),o(3),t()()),n&2){let r=x();l(3),C(r.lastAction())}}var v=class n{lastAction=m(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=p({type:n,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(r,a){r&1&&(e(0,"div",0)(1,"div",1)(2,"div",2),o(3,"AgentOS UI"),t(),e(4,"h1"),o(5,"Hello AgentOS"),t(),e(6,"p"),o(7," This component lives in "),e(8,"code"),o(9,"libs/agentos-ui"),t(),o(10," \u2014 isolated from Coday internals, ready to be published as "),e(11,"code"),o(12,"@whoz-oss/agentos-ui"),t(),o(13,". "),t(),u(14,"agentos-backend-status"),e(15,"ul",3)(16,"li"),o(17,"\u2726 No imports from Coday app"),t(),e(18,"li"),o(19,"\u2726 CSS custom properties as host contract"),t(),e(20,"li"),o(21,"\u2726 Standalone Angular components"),t(),e(22,"li"),o(23,"\u2726 Signals-first reactive state"),t()(),e(24,"div",4)(25,"p",5),o(26,"ds-icon-button from "),e(27,"code"),o(28,"@whoz-oss/design-system"),t()(),e(29,"div",6)(30,"ds-icon-button",7),i("action",function(){return a.onSend()}),t(),e(31,"ds-icon-button",8),i("action",function(){return a.onStop()}),t(),e(32,"ds-icon-button",9),i("action",function(){return a.onAttach()}),t(),e(33,"ds-icon-button",10),i("action",function(){return a.onAttach()}),t()(),g(34,S,4,1,"p",11),t()()()),r&2&&(l(33),f("disabled",!0),l(),b(a.lastAction()?34:-1))},dependencies:[_,h],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{z as AGENTOS_ROUTES,y as AgentosShellComponent,h as BackendStatusComponent,k as CaseChatComponent,E as CaseListComponent,A as HeaderComponent,v as HelloAgentosComponent,M as LayoutComponent,O as NamespaceItemComponent,P as NamespaceListComponent,c as agentosReadyGuard};
@@ -1 +1 @@
1
- import{a as k,b as O}from"./chunk-F4BEHTG5.js";import{$a as i,Ba as f,Jb as x,Kb as E,Qa as C,Ra as p,Sa as m,T as a,Va as g,Wa as v,ab as o,cc as P,fa as u,gb as b,ib as h,jb as y,mc as w,pc as I,rc as M,sa as r,xb as s,yb as _}from"./chunk-3PAE676O.js";function S(t,e){t&1&&(i(0,"p",6),s(1,"No cases yet. Start one below."),o())}function T(t,e){if(t&1&&(i(0,"div",7)(1,"span",8),s(2),o(),i(3,"span",9),s(4),o()()),t&2){let n=e.$implicit;r(2),_(n.id),r(2),_(n.status)}}function z(t,e){if(t&1&&g(0,T,5,2,"div",7,C().trackById,!0),t&2){let n=y();v(n)}}function V(t,e){t&1&&p(0,S,2,0,"p",6)(1,z,2,0),t&2&&m(e.length===0?0:1)}var L=class t{http=a(w);router=a(M);route=a(I);config=a(k);caseController=a(O);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParent1(this.namespaceId);inputValue=u("");onInput(e){this.inputValue.set(e.target.value)}onKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id])})}trackById(e,n){return n.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=f({type:t,selectors:[["agentos-case-list"]],decls:11,vars:4,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,l){if(n&1&&(i(0,"div",0)(1,"header",1)(2,"h2"),s(3,"Cases"),o()(),i(4,"div",2),p(5,V,2,1),x(6,"async"),o(),i(7,"div",3)(8,"textarea",4),h("input",function(d){return l.onInput(d)})("keydown",function(d){return l.onKeydown(d)}),o(),i(9,"p",5),s(10,"Press Enter to send, Shift+Enter for new line"),o()()()),n&2){let c;r(5),m((c=E(6,2,l.cases$))?5:-1,c),r(3),b("value",l.inputValue())}},dependencies:[P],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};export{L as a};
1
+ import{a as k,b as O}from"./chunk-G4KHFN3J.js";import{Ea as f,Kb as x,Lb as E,Ra as C,Sa as m,T as a,Ta as p,Wa as g,Xa as y,ab as i,bb as o,dc as P,ga as u,hb as b,jb as v,kb as h,nc as w,qc as I,sc as M,ua as s,yb as r,zb as _}from"./chunk-3PJTGTYA.js";function S(t,e){t&1&&(i(0,"p",6),r(1,"No cases yet. Start one below."),o())}function T(t,e){if(t&1&&(i(0,"div",7)(1,"span",8),r(2),o(),i(3,"span",9),r(4),o()()),t&2){let n=e.$implicit;s(2),_(n.id),s(2),_(n.status)}}function z(t,e){if(t&1&&g(0,T,5,2,"div",7,C().trackById,!0),t&2){let n=h();y(n)}}function V(t,e){t&1&&m(0,S,2,0,"p",6)(1,z,2,0),t&2&&p(e.length===0?0:1)}var L=class t{http=a(w);router=a(M);route=a(I);config=a(k);caseController=a(O);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParent1(this.namespaceId);inputValue=u("");onInput(e){this.inputValue.set(e.target.value)}onKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id])})}trackById(e,n){return n.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=f({type:t,selectors:[["agentos-case-list"]],decls:11,vars:4,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,l){if(n&1&&(i(0,"div",0)(1,"header",1)(2,"h2"),r(3,"Cases"),o()(),i(4,"div",2),m(5,V,2,1),x(6,"async"),o(),i(7,"div",3)(8,"textarea",4),v("input",function(d){return l.onInput(d)})("keydown",function(d){return l.onKeydown(d)}),o(),i(9,"p",5),r(10,"Press Enter to send, Shift+Enter for new line"),o()()()),n&2){let c;s(5),p((c=E(6,2,l.cases$))?5:-1,c),s(3),b("value",l.inputValue())}},dependencies:[P],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};export{L as a};
@@ -1 +1 @@
1
- import{Ba as t,_a as o,qc as r}from"./chunk-3PAE676O.js";var s=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=t({type:n,selectors:[["agentos-shell"]],decls:1,vars:0,template:function(e,i){e&1&&o(0,"router-outlet")},dependencies:[r],styles:[".shell-loader[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;gap:1rem;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}.shell-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid var(--color-border, rgba(0, 0, 0, .1));border-top-color:var(--color-primary, #007aff);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"]})};export{s as a};
1
+ import{$a as o,Ea as t,rc as r}from"./chunk-3PJTGTYA.js";var s=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=t({type:n,selectors:[["agentos-shell"]],decls:1,vars:0,template:function(e,i){e&1&&o(0,"router-outlet")},dependencies:[r],styles:[".shell-loader[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;gap:1rem;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}.shell-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid var(--color-border, rgba(0, 0, 0, .1));border-top-color:var(--color-primary, #007aff);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"]})};export{s as a};
@@ -0,0 +1 @@
1
+ import{w as Q}from"./chunk-VQANVQD7.js";import{a as K}from"./chunk-G4KHFN3J.js";import{$a as D,Ea as R,Qa as N,Qb as k,Sa as g,T as b,Ta as h,Wa as A,X as E,Xa as F,Y as S,Ya as T,Za as i,_a as r,da as I,ga as v,gb as M,ha as P,ib as y,kb as p,nc as $,ob as q,pb as V,qb as z,qc as L,ua as l,wb as w,yb as d,zb as C}from"./chunk-3PJTGTYA.js";var G=["composerInput"],H=(o,t)=>t.kind==="message"?t.event.id:t.kind==="tool"?t.call.requestId:"streaming";function U(o,t){o&1&&(i(0,"div",3)(1,"p"),d(2,"No messages yet."),r()())}function Y(o,t){if(o&1&&(i(0,"div",14)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);w("case-chat__message--user",e.event.actor.role==="USER")("case-chat__message--agent",e.event.actor.role==="AGENT"),l(2),C(e.event.actor.displayName),l(2),C(n.extractText(e.event))}}function J(o,t){if(o&1&&(i(0,"div",12)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);l(2),C(n.agentDisplayName()),l(2),C(e.text)}}function Z(o,t){o&1&&d(0," \u23F3 ")}function W(o,t){o&1&&d(0," \u2705 ")}function X(o,t){o&1&&d(0," \u274C ")}function ee(o,t){if(o&1&&(i(0,"div",23)(1,"span",24),d(2,"Payload"),r(),i(3,"pre"),d(4),r()()),o&2){let e=p(3).$implicit;l(4),C(e.call.args)}}function te(o,t){o&1&&(i(0,"pre"),d(1),r()),o&2&&(l(),C(t))}function ne(o,t){o&1&&(i(0,"span",25),d(1,"Running\u2026"),r())}function oe(o,t){o&1&&(i(0,"span",26),d(1,"No output"),r())}function ae(o,t){if(o&1&&(i(0,"div",22),g(1,ee,5,1,"div",23),i(2,"div",23)(3,"span",24),d(4,"Output"),r(),g(5,te,2,1,"pre")(6,ne,2,0,"span",25)(7,oe,2,0,"span",26),r()()),o&2){let e,n=p(2).$implicit,a=p(2);l(),h(n.call.args?1:-1),l(4),h((e=a.extractToolOutput(n.call))?5:n.call.response?7:6,e)}}function ie(o,t){if(o&1){let e=M();i(0,"div",17)(1,"button",18),y("click",function(){E(e);let a=p().$implicit,m=p(2);return S(m.toggleToolCall(a.call.requestId))}),i(2,"span",19),g(3,Z,1,0)(4,W,1,0)(5,X,1,0),r(),i(6,"span",20),d(7),r(),i(8,"span",21),d(9),r()(),g(10,ae,8,2,"div",22),r()}if(o&2){let e=p().$implicit,n=p(2);w("case-chat__tool-call--pending",!e.call.response)("case-chat__tool-call--success",(e.call.response==null?null:e.call.response.success)===!0)("case-chat__tool-call--error",(e.call.response==null?null:e.call.response.success)===!1),l(),N("aria-expanded",n.isToolCallExpanded(e.call.requestId)),l(2),h(e.call.response?e.call.response.success?4:5:3),l(4),C(e.call.toolName),l(2),C(n.isToolCallExpanded(e.call.requestId)?"\u25BC":"\u25B6"),l(),h(n.isToolCallExpanded(e.call.requestId)?10:-1)}}function se(o,t){if(o&1&&g(0,Y,5,6,"div",11)(1,J,5,2,"div",12)(2,ie,11,11,"div",13),o&2){let e=t.$implicit;h(e.kind==="message"?0:e.kind==="streaming"?1:2)}}function re(o,t){if(o&1&&A(0,se,3,1,null,null,H),o&2){let e=p();F(e.timeline())}}function le(o,t){o&1&&(i(0,"div",4),D(1,"span",27)(2,"span",27)(3,"span",27),r())}function ce(o,t){if(o&1){let e=M();i(0,"ds-icon-button",28),y("action",function(){E(e);let a=p();return S(a.interrupt())}),r()}}function de(o,t){if(o&1){let e=M();i(0,"ds-icon-button",29),y("action",function(){E(e);let a=p();return S(a.submit())}),r()}if(o&2){let e=p();T("disabled",!e.canSend)}}var j=class o{route=b(L);http=b($);zone=b(I);config=b(K);caseId=this.route.snapshot.params.caseId;namespaceId=this.route.snapshot.params.namespaceId;agentDisplayName=k(()=>{let t=this.events();for(let e=t.length-1;e>=0;e--){let n=t[e];if(n){if(n.type==="AgentRunningEvent"||n.type==="AgentSelectedEvent"||n.type==="AgentFinishedEvent"){let a=n.agentName;if(a&&a.trim().length>0)return a}if(n.type==="MessageEvent"){let a=n;if(a.actor?.role==="AGENT"&&a.actor.displayName)return a.actor.displayName}}}return"Assistant"});eventSource=null;composerInput;events=v([]);inputValue=v("");isRunning=v(!1);isTerminal=v(!1);streamingText=v("");collapsedTools=v(new Set);constructor(){P(()=>{this.isRunning()||this.isTerminal()||queueMicrotask(()=>this.composerInput?.nativeElement.focus())})}timeline=k(()=>{let t=this.events(),e=this.streamingText(),n=new Map;for(let c of t)if(c.type==="ToolRequestEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:_.toolName??"unknown",args:_.args??null,response:f?.response})}else if(c.type==="ToolResponseEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:f?.toolName??_.toolName??"unknown",args:f?.args??null,response:_})}let a=[],m=new Set;for(let c of t)if(c.type==="MessageEvent")a.push({kind:"message",event:c});else if(c.type==="ToolRequestEvent"||c.type==="ToolResponseEvent"){let s=c.toolRequestId??c.id;m.has(s)||(m.add(s),a.push({kind:"tool",call:n.get(s)}))}return e.trim().length>0&&a.push({kind:"streaming",text:e}),a});get canSend(){return!!this.inputValue().trim()&&!this.isRunning()&&!this.isTerminal()}ngOnInit(){this.connectSse()}ngOnDestroy(){this.eventSource?.close()}connectSse(){let t=`${this.config.basePath}/api/cases/${this.caseId}/events`;console.log("[AgentOS SSE] connecting",{url:t,basePath:this.config.basePath,caseId:this.caseId,namespaceId:this.namespaceId,now:new Date().toISOString()}),this.eventSource=this.zone.runOutsideAngular(()=>new EventSource(t));let e=a=>{let m=performance.now(),c=a.type,_=a.data;console.log("[AgentOS SSE] frame received",{sseEventName:c,dataLength:_?.length??0,dataPreview:_?.slice(0,120),receivedAtMs:m});try{let s=JSON.parse(_);this.zone.run(()=>{let f=this.events().length;this.events.update(u=>u.some(x=>x.id===s.id)?u:[...u,s]);let B=this.events().length;if(console.log("[AgentOS SSE] event processed",{sseEventName:c,eventType:s.type,eventId:s.id,beforeLen:f,afterLen:B,running:this.isRunning(),terminal:this.isTerminal()}),s.type==="TextChunkEvent"){let u=s.chunk;u&&this.streamingText.update(x=>x+u);return}if(s.type==="CaseStatusEvent"){let u=s.status,x=u==="KILLED"||u==="ERROR";if(this.isTerminal.set(x),x)this.isRunning.set(!1),this.eventSource?.close(),this.eventSource=null;else{let O=u==="RUNNING";this.isRunning.set(O),O||this.streamingText.set("")}return}if(s.type==="AgentFinishedEvent"){this.isRunning.set(!1),this.streamingText.set("");return}})}catch(s){console.warn("[AgentOS SSE] failed to parse event data",{sseEventName:c,error:s,dataPreview:_?.slice(0,500)})}},n=["MessageEvent","CaseStatusEvent","AgentSelectedEvent","AgentRunningEvent","AgentFinishedEvent","ThinkingEvent","TextChunkEvent","ToolRequestEvent","ToolResponseEvent"];for(let a of n)console.log("[AgentOS SSE] addEventListener",a),this.eventSource.addEventListener(a,e);this.eventSource.onopen=()=>{console.log("[AgentOS SSE] connection open",{readyState:this.eventSource?.readyState,at:new Date().toISOString()})},this.eventSource.onmessage=a=>{console.log("[AgentOS SSE] onmessage (unnamed event) received",{dataLength:a.data?.length??0,dataPreview:a.data?.slice(0,120)})},this.eventSource.onerror=a=>{console.warn("[AgentOS SSE] connection error",{err:a,readyState:this.eventSource?.readyState,at:new Date().toISOString()}),this.zone.run(()=>{this.isRunning.set(!1)})}}onInput(t){this.inputValue.set(t.target.value)}onKeydown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.submit())}submit(){if(!this.canSend)return;let t=this.inputValue().trim();this.inputValue.set(""),this.isRunning.set(!0),this.streamingText.set(""),this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/messages`,{content:t,userId:"default-user"}).subscribe({error:e=>{console.error("[CaseChat] Failed to send message",e),this.isRunning.set(!1)}})}interrupt(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/interrupt`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to interrupt case",t)})}kill(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/kill`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to kill case",t)})}extractText(t){return t.content?.filter(e=>"content"in e).map(e=>e.content).join("")??""}extractToolOutput(t){if(!t.response)return null;let e=t.response.output;return e?e.content??null:null}toggleToolCall(t){this.collapsedTools.update(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}isToolCallExpanded(t){return this.collapsedTools().has(t)}_namespaceId=this.namespaceId;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=R({type:o,selectors:[["agentos-case-chat"]],viewQuery:function(e,n){if(e&1&&q(G,5),e&2){let a;V(a=z())&&(n.composerInput=a.first)}},decls:12,vars:6,consts:[["composerInput",""],[1,"case-chat"],[1,"case-chat__messages"],[1,"case-chat__empty"],[1,"case-chat__thinking"],[1,"case-chat__composer"],["placeholder","Reply\u2026","rows","3",1,"case-chat__input",3,"input","keydown","value","disabled"],[1,"case-chat__actions"],["icon","stop","variant","danger","title","Interrupt"],["icon","send","variant","primary","title","Send (Enter)",3,"disabled"],["icon","cancel","variant","danger","title","Kill",3,"action","disabled"],[1,"case-chat__message",3,"case-chat__message--user","case-chat__message--agent"],[1,"case-chat__message","case-chat__message--agent","case-chat__message--streaming"],[1,"case-chat__tool-call",3,"case-chat__tool-call--pending","case-chat__tool-call--success","case-chat__tool-call--error"],[1,"case-chat__message"],[1,"case-chat__message-author"],[1,"case-chat__message-text"],[1,"case-chat__tool-call"],["type","button",1,"case-chat__tool-call-header",3,"click"],[1,"case-chat__tool-call-icon"],[1,"case-chat__tool-call-name"],[1,"case-chat__tool-call-chevron"],[1,"case-chat__tool-call-output"],[1,"case-chat__tool-call-section"],[1,"case-chat__tool-call-label"],[1,"case-chat__tool-call-pending"],[1,"case-chat__tool-call-empty"],[1,"thinking-dot"],["icon","stop","variant","danger","title","Interrupt",3,"action"],["icon","send","variant","primary","title","Send (Enter)",3,"action","disabled"]],template:function(e,n){e&1&&(i(0,"div",1)(1,"div",2),g(2,U,3,0,"div",3)(3,re,2,0),g(4,le,4,0,"div",4),r(),i(5,"div",5)(6,"textarea",6,0),y("input",function(m){return n.onInput(m)})("keydown",function(m){return n.onKeydown(m)}),r(),i(8,"div",7),g(9,ce,1,0,"ds-icon-button",8)(10,de,1,1,"ds-icon-button",9),i(11,"ds-icon-button",10),y("action",function(){return n.kill()}),r()()()()),e&2&&(l(2),h(n.timeline().length===0?2:3),l(2),h(n.isRunning()?4:-1),l(2),T("value",n.inputValue())("disabled",n.isRunning()||n.isTerminal()),l(3),h(n.isRunning()?9:10),l(2),T("disabled",n.isTerminal()))},dependencies:[Q],styles:['.case-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:800px;margin:0 auto;padding:1.5rem;gap:1rem}.case-chat__messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.75rem;padding-bottom:.5rem}.case-chat__empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex:1}.case-chat__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-chat__tool-calls[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;margin-top:.25rem}.case-chat__tool-call[_ngcontent-%COMP%]{border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));font-size:.8rem;overflow:hidden;transition:border-color .2s ease}.case-chat__tool-call--pending[_ngcontent-%COMP%]{border-color:var(--color-warning, #f5a623);opacity:.8}.case-chat__tool-call--success[_ngcontent-%COMP%]{border-color:var(--color-success, #34c759)}.case-chat__tool-call--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.case-chat__tool-call-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;padding:.4rem .6rem;background:transparent;border:none;cursor:pointer;text-align:left;color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.8rem}.case-chat__tool-call-header[_ngcontent-%COMP%]:hover{background:#0000000a}.case-chat__tool-call-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem}.case-chat__tool-call-name[_ngcontent-%COMP%]{font-weight:600;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);color:var(--color-primary, #0071e3);flex-shrink:0}.case-chat__tool-call-args[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.case-chat__tool-call-chevron[_ngcontent-%COMP%]{flex-shrink:0;font-size:.6rem;color:var(--color-text-secondary, #6e6e73);margin-left:auto}.case-chat__tool-call-output[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .08));display:flex;flex-direction:column}.case-chat__tool-call-section[_ngcontent-%COMP%]{padding:.4rem .6rem .5rem}.case-chat__tool-call-section[_ngcontent-%COMP%] + .case-chat__tool-call-section[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .06))}.case-chat__tool-call-section[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap;word-break:break-all;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);font-size:.75rem;color:var(--color-text, #1d1d1f);max-height:200px;overflow-y:auto}.case-chat__tool-call-label[_ngcontent-%COMP%]{display:block;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-secondary, #6e6e73)}.case-chat__tool-call-pending[_ngcontent-%COMP%], .case-chat__tool-call-empty[_ngcontent-%COMP%]{display:block;margin-top:.25rem;color:var(--color-text-secondary, #6e6e73);font-style:italic;font-size:.75rem}.case-chat__thinking[_ngcontent-%COMP%]{display:flex;gap:.3rem;padding:.75rem 1rem;align-self:flex-start}.case-chat__message--streaming[_ngcontent-%COMP%]{opacity:.95}.case-chat__composer[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:16px;padding:.5rem .5rem .5rem 1rem}.case-chat__input[_ngcontent-%COMP%]{flex:1;resize:none;padding:.5rem 0;border:none;background:transparent;color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;min-height:40px}.case-chat__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-chat__input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.case-chat__actions[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0}.thinking-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--color-text-secondary, #6e6e73);animation:_ngcontent-%COMP%_thinking-bounce 1.2s ease-in-out infinite}.thinking-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.thinking-dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_thinking-bounce{0%,80%,to{transform:translateY(0);opacity:.4}40%{transform:translateY(-6px);opacity:1}}']})};export{j as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OOJRZK5J.js";import"./chunk-3PJTGTYA.js";export{a as AgentosShellComponent};
@@ -0,0 +1,4 @@
1
+ import{a as D,b as ct,c as lt,e as E,f as dt,m as mt,q as ht,s as ut,v as ft}from"./chunk-VQANVQD7.js";import{E as it,G as M,N as st,P as ot,R as rt,e as tt,m as et,q as nt,s as at}from"./chunk-DE6SQRNU.js";import{$ as u,$a as G,Ab as w,Ea as y,Fa as H,Ga as b,Ja as Z,K as O,Ka as Q,P,Q as j,Qa as U,R as v,Sa as W,T as o,Ta as X,Wb as Y,X as F,Y as N,Za as k,_a as _,a as d,aa as L,da as z,g as c,gb as K,ib as A,ka as V,kb as x,l as I,ob as $,pb as B,qb as S,ua as f,wa as g,wb as J,xa as q,yb as C}from"./chunk-3PJTGTYA.js";function vt(a,l){if(a&1){let t=K();k(0,"div",1)(1,"button",2),A("click",function(){F(t);let n=x();return N(n.action())}),C(2),_()()}if(a&2){let t=x();f(2),w(" ",t.data.action," ")}}var gt=["label"];function yt(a,l){}var At=Math.pow(2,31)-1,p=class{_overlayRef;instance;containerInstance;_afterDismissed=new c;_afterOpened=new c;_onAction=new c;_durationTimeoutId;_dismissedByAction=!1;constructor(l,t){this._overlayRef=t,this.containerInstance=l,l._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(l){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(l,At))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},_t=new v("MatSnackBarData"),m=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},xt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return a})(),Bt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return a})(),St=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return a})(),pt=(()=>{class a{snackBarRef=o(p);data=o(_t);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(e,n){e&1&&(k(0,"div",0),C(1),_(),W(2,vt,3,1,"div",1)),e&2&&(f(),w(" ",n.data.message,`
2
+ `),f(),X(n.hasAction?2:-1))},dependencies:[ot,xt,Bt,St],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
3
+ `],encapsulation:2,changeDetection:0})}return a})(),R="_mat-snack-bar-enter",T="_mat-snack-bar-exit",Ct=(()=>{class a extends lt{_ngZone=o(z);_elementRef=o(V);_changeDetectorRef=o(Y);_platform=o(tt);_animationsDisabled=M();snackBarConfig=o(m);_document=o(L);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=o(u);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new c;_onExit=new c;_onEnter=new c;_animationState="void";_live;_label;_role;_liveElementId=o(at).getId("mat-snack-bar-container-live-");constructor(){super();let t=this.snackBarConfig;t.politeness==="assertive"&&!t.announcementMessage?this._live="assertive":t.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();let e=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),e}attachTemplatePortal(t){this._assertNotAttached();let e=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),e}attachDomPortal=t=>{this._assertNotAttached();let e=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),e};onAnimationEnd(t){t===T?this._completeExit():t===R&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?g(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(R)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(R)},200)))}exit(){return this._destroyed?I(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?g(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(T)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(T),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(s=>t.classList.add(s)):t.classList.add(e)),this._exposeToModals();let n=this._label.nativeElement,i="mdc-snackbar__label";n.classList.toggle(i,!n.querySelector(`.${i}`))}_exposeToModals(){let t=this._liveElementId,e=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<e.length;n++){let i=e[n],s=i.getAttribute("aria-owns");this._trackedModals.add(i),s?s.indexOf(t)===-1&&i.setAttribute("aria-owns",s+" "+t):i.setAttribute("aria-owns",t)}}_clearFromModals(){this._trackedModals.forEach(t=>{let e=t.getAttribute("aria-owns");if(e){let n=e.replace(this._liveElementId,"").trim();n.length>0?t.setAttribute("aria-owns",n):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let t=this._elementRef.nativeElement,e=t.querySelector("[aria-hidden]"),n=t.querySelector("[aria-live]");if(e&&n){let i=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&e.contains(document.activeElement)&&(i=document.activeElement),e.removeAttribute("aria-hidden"),n.appendChild(e),i?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["mat-snack-bar-container"]],viewQuery:function(e,n){if(e&1&&$(E,7)(gt,7),e&2){let i;B(i=S())&&(n._portalOutlet=i.first),B(i=S())&&(n._label=i.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(e,n){e&1&&A("animationend",function(s){return n.onAnimationEnd(s.animationName)})("animationcancel",function(s){return n.onAnimationEnd(s.animationName)}),e&2&&J("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[Z],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,n){e&1&&(k(0,"div",1)(1,"div",2,0)(3,"div",3),Q(4,yt,0,0,"ng-template",4),_(),G(5,"div"),_()()),e&2&&(f(5),U("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[E],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
4
+ `],encapsulation:2})}return a})(),wt=new v("mat-snack-bar-default-options",{providedIn:"root",factory:()=>new m}),Mt=(()=>{class a{_live=o(nt);_injector=o(u);_breakpointObserver=o(et);_parentSnackBar=o(a,{optional:!0,skipSelf:!0});_defaultConfig=o(wt);_animationsDisabled=M();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=pt;snackBarContainerComponent=Ct;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){let i=d(d({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector,i=u.create({parent:n||this._injector,providers:[{provide:m,useValue:e}]}),s=new D(this.snackBarContainerComponent,e.viewContainerRef,i),r=t.attach(s);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){let n=d(d(d({},new m),this._defaultConfig),e),i=this._createOverlay(n),s=this._attachSnackBarContainer(i,n),r=new p(s,i);if(t instanceof q){let h=new ct(t,null,{$implicit:n.data,snackBarRef:r});r.instance=s.attachTemplatePortal(h)}else{let h=this._createInjector(n,r),bt=new D(t,void 0,h),kt=s.attachComponentPortal(bt);r.instance=kt.instance}return this._breakpointObserver.observe(it.HandsetPortrait).pipe(O(i.detachments())).subscribe(h=>{i.overlayElement.classList.toggle(this.handsetCssClass,h.matches)}),n.announcementMessage&&s._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(r,n),this._openedSnackBarRef=r,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter()}_createOverlay(t){let e=new mt;e.direction=t.direction;let n=ht(this._injector),i=t.direction==="rtl",s=t.horizontalPosition==="left"||t.horizontalPosition==="start"&&!i||t.horizontalPosition==="end"&&i,r=!s&&t.horizontalPosition!=="center";return s?n.left("0"):r?n.right("0"):n.centerHorizontally(),t.verticalPosition==="top"?n.top("0"):n.bottom("0"),e.positionStrategy=n,e.disableAnimations=this._animationsDisabled,ut(this._injector,e)}_createInjector(t,e){let n=t&&t.viewContainerRef&&t.viewContainerRef.injector;return u.create({parent:n||this._injector,providers:[{provide:p,useValue:e},{provide:_t,useValue:t.data}]})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=P({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var Xt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275mod=H({type:a});static \u0275inj=j({providers:[Mt],imports:[ft,dt,rt,pt,st]})}return a})();export{Mt as a,Xt as b};