@whoz-oss/coday-client 0.91.1 → 0.92.1

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.
@@ -1 +1 @@
1
- import{b as ue}from"./chunk-ODM275WP.js";import{A as Ce,a as _e,e as he,i as fe,m as be,t as ve,u as xe,v as ye}from"./chunk-QITHUHCN.js";import{$a as k,Aa as L,Da as Q,Db as y,Fb as w,Gb as j,Kb as p,Na as b,Oa as se,P as H,Pa as v,Qa as x,T,Ta as N,Ua as U,Va as S,Wa as s,X as $,Xa as r,Y as V,Ya as Z,Z as O,Za as m,_ as ae,_a as _,a as R,ac as D,b as A,ba as re,bb as de,db as P,eb as ce,fa as h,fb as g,gc as ee,ic as pe,nc as ge,qa as le,qb as me,s as ie,sa as l,tb as i,ub as c,vb as E}from"./chunk-WG23DARU.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{b as ue}from"./chunk-LPRBIFLE.js";import{A as Ce,a as _e,e as he,i as fe,m as be,t as ve,u as xe,v as ye}from"./chunk-MO5TPQ6B.js";import{$a as k,Aa as L,Da as Q,Eb as y,Gb as w,Hb as j,Lb as p,Na as b,Oa as se,P as H,Pa as v,Qa as x,T,Ta as N,Ua as U,Va as S,Wa as s,X as $,Xa as r,Y as V,Ya as Z,Z as O,Za as m,_ as ae,_a as _,a as R,b as A,ba as re,bb as de,bc as D,db as P,eb as ce,fa as h,fb as g,hc as ee,jc as pe,oc as ge,qa as le,qb as me,s as ie,sa as l,tb as i,ub as c,vb as E}from"./chunk-VFOKVVIA.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 +1 @@
1
- import{a as A}from"./chunk-6DFCBHHF.js";import{a as h,b as M,c as O}from"./chunk-NFPIT5IF.js";import{a as y,b as P}from"./chunk-E3T5JJR5.js";import"./chunk-QITHUHCN.js";import{a as E}from"./chunk-WEVA7DKF.js";import{a as k}from"./chunk-ZWSN3GAA.js";import{S as _}from"./chunk-Y5DXUE3H.js";import"./chunk-GBTE3TIN.js";import{Aa as p,Pa as g,Qa as b,Va as f,Wa as e,Xa as t,Ya as u,db as a,fa as m,fb as x,sa as l,tb as o,ub as C}from"./chunk-WG23DARU.js";var c=()=>!0;var z=[{path:"",loadComponent:()=>import("./chunk-NYZS626O.js").then(n=>n.AgentosShellComponent),children:[{path:"",loadComponent:()=>import("./chunk-P3BYIXZM.js").then(n=>n.LayoutComponent),children:[{path:"namespaces",canActivate:[c],loadComponent:()=>import("./chunk-AYUFWSWZ.js").then(n=>n.NamespaceListComponent)},{path:":namespaceId/cases",canActivate:[c],loadComponent:()=>import("./chunk-VEM5V6G6.js").then(n=>n.CaseListComponent)},{path:":namespaceId/cases/:caseId",canActivate:[c],loadComponent:()=>import("./chunk-WSC62DRG.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 A}from"./chunk-IRVODR2C.js";import{a as h,b as M,c as O}from"./chunk-AKLS5OBF.js";import{a as y,b as P}from"./chunk-G4ZYZURG.js";import"./chunk-MO5TPQ6B.js";import{a as E}from"./chunk-MGQCDUWE.js";import{a as k}from"./chunk-P46WFO7S.js";import{S as _}from"./chunk-V4EBMF62.js";import"./chunk-HIHURJKC.js";import{Aa as p,Pa as g,Qa as b,Va as f,Wa as e,Xa as t,Ya as u,db as a,fa as m,fb as x,sa as l,tb as o,ub as C}from"./chunk-VFOKVVIA.js";var c=()=>!0;var z=[{path:"",loadComponent:()=>import("./chunk-KSAHHKC2.js").then(n=>n.AgentosShellComponent),children:[{path:"",loadComponent:()=>import("./chunk-GPG3QO6X.js").then(n=>n.LayoutComponent),children:[{path:"namespaces",canActivate:[c],loadComponent:()=>import("./chunk-TWBE3KHJ.js").then(n=>n.NamespaceListComponent)},{path:":namespaceId/cases",canActivate:[c],loadComponent:()=>import("./chunk-FJ2MLXSP.js").then(n=>n.CaseListComponent)},{path:":namespaceId/cases/:caseId",canActivate:[c],loadComponent:()=>import("./chunk-UQ5S322U.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 +1 @@
1
- import{d as v}from"./chunk-GBTE3TIN.js";import{$a as l,Aa as a,Pa as f,Qa as b,T as p,Wa as o,Xa as s,Ya as i,Za as _,_a as C,fa as g,mc as h,sa as u,tb as y}from"./chunk-WG23DARU.js";function O(e,n){e&1&&l(0,"span",1)}function P(e,n){e&1&&l(0,"span",2)}function S(e,n){e&1&&l(0,"span",3)}var r=class e{pluginService=p(v);online=g(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,d){if(t&1&&(_(0,"div",0),f(1,O,1,0,"span",1)(2,P,1,0,"span",2)(3,S,1,0,"span",3),C()),t&2){let m;u(),b((m=d.online())===!0?1:m===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};var c=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-header"]],decls:7,vars:0,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"]],template:function(t,d){t&1&&(o(0,"header",0)(1,"div",1),i(2,"img",2),o(3,"span",3),y(4,"Coday"),s()(),o(5,"nav",4),i(6,"agentos-backend-status"),s()())},dependencies:[r],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})};var M=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,d){t&1&&(o(0,"div",0),i(1,"agentos-header"),o(2,"main",1),i(3,"router-outlet"),s()())},dependencies:[h,c],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{r as a,c as b,M as c};
1
+ import{d as v}from"./chunk-HIHURJKC.js";import{$a as l,Aa as a,Pa as f,Qa as b,T as p,Wa as o,Xa as s,Ya as i,Za as _,_a as C,fa as g,nc as h,sa as u,tb as y}from"./chunk-VFOKVVIA.js";function O(e,n){e&1&&l(0,"span",1)}function P(e,n){e&1&&l(0,"span",2)}function S(e,n){e&1&&l(0,"span",3)}var r=class e{pluginService=p(v);online=g(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,d){if(t&1&&(_(0,"div",0),f(1,O,1,0,"span",1)(2,P,1,0,"span",2)(3,S,1,0,"span",3),C()),t&2){let m;u(),b((m=d.online())===!0?1:m===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};var c=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-header"]],decls:7,vars:0,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"]],template:function(t,d){t&1&&(o(0,"header",0)(1,"div",1),i(2,"img",2),o(3,"span",3),y(4,"Coday"),s()(),o(5,"nav",4),i(6,"agentos-backend-status"),s()())},dependencies:[r],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})};var M=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,d){t&1&&(o(0,"div",0),i(1,"agentos-header"),o(2,"main",1),i(3,"router-outlet"),s()())},dependencies:[h,c],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{r as a,c as b,M as c};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-MGQCDUWE.js";import"./chunk-HIHURJKC.js";import"./chunk-VFOKVVIA.js";export{a as CaseListComponent};
@@ -1 +1 @@
1
- import{B as J,a as S,e as A,g as v,i as j,j as G,l as h,n as U,r as H}from"./chunk-QITHUHCN.js";import{S as E}from"./chunk-Y5DXUE3H.js";import{c as B}from"./chunk-GBTE3TIN.js";import{Aa as y,Db as q,Eb as F,Ha as w,J as k,Oa as I,Pa as u,Qa as C,T as N,Ta as L,Ua as R,Va as f,Wa as o,X as l,Xa as r,Y as m,Ya as V,_b as z,a as D,b as P,ba as T,bb as b,db as d,fa as g,fb as s,h as O,nc as $,sa as c,tb as p,ub as x}from"./chunk-WG23DARU.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{B as J,a as S,e as A,g as v,i as j,j as G,l as h,n as U,r as H}from"./chunk-MO5TPQ6B.js";import{S as E}from"./chunk-V4EBMF62.js";import{c as B}from"./chunk-HIHURJKC.js";import{$b as z,Aa as y,Eb as q,Fb as F,Ha as w,J as k,Oa as I,Pa as u,Qa as C,T as N,Ta as L,Ua as R,Va as f,Wa as o,X as l,Xa as r,Y as m,Ya as V,a as D,b as P,ba as T,bb as b,db as d,fa as g,fb as s,h as O,oc as $,sa as c,tb as p,ub as x}from"./chunk-VFOKVVIA.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};
@@ -0,0 +1 @@
1
+ import{c as a}from"./chunk-AKLS5OBF.js";import"./chunk-HIHURJKC.js";import"./chunk-VFOKVVIA.js";export{a as LayoutComponent};
@@ -1 +1 @@
1
- import{Ia 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,fc as k,hc as h,ic as E}from"./chunk-WG23DARU.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{Ia 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,gc as k,ic as h,jc as E}from"./chunk-VFOKVVIA.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 +1 @@
1
- import{Aa as t,Ya as o,mc as r}from"./chunk-WG23DARU.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{Aa as t,Ya as o,nc as r}from"./chunk-VFOKVVIA.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{a}from"./chunk-IRVODR2C.js";import"./chunk-VFOKVVIA.js";export{a as AgentosShellComponent};
@@ -1 +1 @@
1
- import{G as p,J as j,M as d,P as s,T as c,d as u,h as o,ic as P,k as f,o as a,p as g,z as l}from"./chunk-WG23DARU.js";var n=class r{baseUrl="/api/projects";http=c(P);listProjects(){return this.http.get(this.baseUrl)}getProject(e){return this.http.get(`${this.baseUrl}/${e}`)}getProjectConfig(e){return this.http.get(`${this.baseUrl}/${e}/config`)}updateProjectConfig(e,t){return this.http.put(`${this.baseUrl}/${e}/config`,t)}createProject(e,t){return this.http.post(this.baseUrl,{name:e,path:t})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};var b=class r{selectedProjectIdSubject=new o(null);isLoadingSubject=new o(!1);refreshTriggerSubject=new o(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=c(n);projectListCall=this.refreshTriggerSubject.pipe(j(()=>this.projectApi.listProjects()),p({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(a(e=>e.projects));forcedProject$=this.projectListCall.pipe(a(e=>e.forcedProject));selectedProject$=g([this.selectedProjectIdSubject,this.forcedProject$]).pipe(j(([e,t])=>{let i=t??e;return i?this.projectApi.getProject(i):f(null)}),d(e=>{e&&e.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",e.name),this.selectedProjectIdSubject.next(e.name))}),p({bufferSize:1,refCount:!0}));selectProject(e){console.log("[PROJECT-STATE] Explicit project selection:",e),this.forcedProject$.pipe(l(1)).subscribe(t=>this.selectedProjectIdSubject.next(t??e))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let e=this.selectedProjectIdSubject.value;if(!e)throw new Error("[PROJECT_STATE] No project selected");return e}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return u(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let e=yield this.projectApi.listProjects().pipe(l(1)).toPromise();if(!e){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:t,forcedProject:i}=e;t&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",t),this.selectedProjectIdSubject.next(t)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(e,t){return this.isLoadingSubject.next(!0),this.projectApi.createProject(e,t).pipe(d(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};export{n as a,b};
1
+ import{G as p,J as j,M as d,P as s,T as c,d as u,h as o,jc as P,k as f,o as a,p as g,z as l}from"./chunk-VFOKVVIA.js";var n=class r{baseUrl="/api/projects";http=c(P);listProjects(){return this.http.get(this.baseUrl)}getProject(e){return this.http.get(`${this.baseUrl}/${e}`)}getProjectConfig(e){return this.http.get(`${this.baseUrl}/${e}/config`)}updateProjectConfig(e,t){return this.http.put(`${this.baseUrl}/${e}/config`,t)}createProject(e,t){return this.http.post(this.baseUrl,{name:e,path:t})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};var b=class r{selectedProjectIdSubject=new o(null);isLoadingSubject=new o(!1);refreshTriggerSubject=new o(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=c(n);projectListCall=this.refreshTriggerSubject.pipe(j(()=>this.projectApi.listProjects()),p({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(a(e=>e.projects));forcedProject$=this.projectListCall.pipe(a(e=>e.forcedProject));selectedProject$=g([this.selectedProjectIdSubject,this.forcedProject$]).pipe(j(([e,t])=>{let i=t??e;return i?this.projectApi.getProject(i):f(null)}),d(e=>{e&&e.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",e.name),this.selectedProjectIdSubject.next(e.name))}),p({bufferSize:1,refCount:!0}));selectProject(e){console.log("[PROJECT-STATE] Explicit project selection:",e),this.forcedProject$.pipe(l(1)).subscribe(t=>this.selectedProjectIdSubject.next(t??e))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let e=this.selectedProjectIdSubject.value;if(!e)throw new Error("[PROJECT_STATE] No project selected");return e}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return u(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let e=yield this.projectApi.listProjects().pipe(l(1)).toPromise();if(!e){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:t,forcedProject:i}=e;t&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",t),this.selectedProjectIdSubject.next(t)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(e,t){return this.isLoadingSubject.next(!0),this.projectApi.createProject(e,t).pipe(d(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};export{n as a,b};
@@ -1 +1 @@
1
- import{a as k,b as O}from"./chunk-GBTE3TIN.js";import{Aa as f,Db as x,Eb as E,Oa as C,Pa as p,Qa as m,T as a,Ta as g,Ua as v,Za as i,_a as o,_b as P,cb as b,eb as h,fa as u,fb as y,ic as w,lc as I,nc as M,sa as r,tb as s,ub as _}from"./chunk-WG23DARU.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-HIHURJKC.js";import{$b as P,Aa as f,Eb as x,Fb as E,Oa as C,Pa as p,Qa as m,T as a,Ta as g,Ua as v,Za as i,_a as o,cb as b,eb as h,fa as u,fb as y,jc as w,mc as I,oc as M,sa as r,tb as s,ub as _}from"./chunk-VFOKVVIA.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};