@misha_misha/agentwatch 0.0.3 → 0.0.4

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.
@@ -0,0 +1 @@
1
+ function e(e){return e.slice(11,19)}function t(e){return e.slice(0,19).replace(`T`,` `)}function n(e){return`${e.slice(5,10)} ${e.slice(11,19)}`}function r(e){return e==null?`—`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function i(e){return e==null?`—`:e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}var a={"claude-code":`text-orange-400`,codex:`text-emerald-400`,cursor:`text-fuchsia-400`,gemini:`text-blue-400`,openclaw:`text-cyan-400`,hermes:`text-yellow-400`,aider:`text-pink-400`,cline:`text-lime-400`,windsurf:`text-teal-400`,goose:`text-amber-400`,continue:`text-purple-400`,unknown:`text-gray-400`};function o(e){return a[e]??`text-gray-400`}var s={prompt:`→`,response:`←`,tool_call:`▸`,shell_exec:`$`,file_write:`✎`,file_read:`👁`,file_change:`~`,compaction:`⟳`,session_start:`●`,session_end:`○`};function c(e){return s[e]??`•`}var l={};for(let e=0;e<=10;e++)e>=8?l[e]=`bg-danger/20 text-danger`:e>=5?l[e]=`bg-warn/20 text-warn`:e>=2?l[e]=`bg-accent/10 text-accent`:l[e]=`bg-fg/5 text-fg-dim`;function u(e){return l[Math.max(0,Math.min(10,e))]??``}export{i as a,c,e as i,t as n,r as o,n as r,u as s,o as t};
@@ -0,0 +1,4 @@
1
+ import{F as e,M as t,j as n,t as r}from"./clsx-DsHpp3Uj.js";import{Ft as i,It as a,Jt as o,Kt as s,Mt as c,Nt as l,Ot as u,Pt as d,at as f,dt as p,ft as m,it as h,jt as g,kt as _,lt as v,ot as y}from"./CartesianChart-CZSKepVZ.js";var b=e(n()),x=e(t());function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(null,arguments)}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?C(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=D(e,`string`);return typeof t==`symbol`?t:t+``}function D(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var O=32,k={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function A(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function j(e){var{data:t,iconType:n,inactiveColor:r}=e,i=O/2,o=O/6,s=O/3,c=t.inactive?r:t.color,l=n??t.type;if(l===`none`)return null;if(l===`plainline`)return x.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:c,strokeDasharray:A(t.payload),x1:0,y1:i,x2:O,y2:i,className:`recharts-legend-icon`});if(l===`line`)return x.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:c,d:`M0,${i}h${s}
2
+ A${o},${o},0,1,1,${2*s},${i}
3
+ H${O}M${2*s},${i}
4
+ A${o},${o},0,1,1,${s},${i}`,className:`recharts-legend-icon`});if(l===`rect`)return x.createElement(`path`,{stroke:`none`,fill:c,d:`M0,${O/8}h${O}v${O*3/4}h${-O}z`,className:`recharts-legend-icon`});if(x.isValidElement(t.legendIcon)){var u=w({},t);return delete u.legendIcon,x.cloneElement(t.legendIcon,u)}return x.createElement(a,{fill:c,cx:i,cy:i,size:O,sizeType:`diameter`,type:l})}function M(e){var{payload:t,iconSize:n,layout:a,formatter:s,inactiveColor:c,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:O,height:O},f={display:a===`horizontal`?`inline-block`:`block`,marginRight:10},p={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,a)=>{var m=t.formatter||s,h=r({"recharts-legend-item":!0,[`legend-item-${a}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var g=typeof u==`object`?w({},u):{};g.color=t.inactive?c:g.color||t.color;var _=m?m(t.value,t,a):t.value;return x.createElement(`li`,S({className:h,style:f,key:`legend-item-${a}`},i(e,t,a)),x.createElement(o,{width:n,height:n,viewBox:d,style:p,"aria-label":`${t.value} legend icon`},x.createElement(j,{data:t,iconType:l,inactiveColor:c})),x.createElement(`span`,{className:`recharts-legend-item-text`,style:g},_))})}var N=e=>{var t=d(e,k),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return x.createElement(`ul`,{className:`recharts-default-legend`,style:a},x.createElement(M,S({},t,{payload:n})))};function P(){return c(_)}var F=[`contextPayload`];function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(null,arguments)}function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=V(e,`string`);return typeof t==`symbol`?t:t+``}function V(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function H(e,t){if(e==null)return{};var n,r,i=U(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function U(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function W(e){return e.value}function G(e){var{contextPayload:t}=e,n=H(e,F),r=l(t,e.payloadUniqBy,W),i=R(R({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content==`function`?x.createElement(e.content,i):x.createElement(N,i)}function K(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),R(R({},l),u)}function q(e){var t=g();return(0,x.useEffect)(()=>{t(f(e))},[t,e]),null}function J(e){var t=g();return(0,x.useEffect)(()=>(t(y(e)),()=>{t(y({width:0,height:0}))}),[t,e]),null}function Y(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var X={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function Z(e){var t=d(e,X),n=P(),r=s(),i=m(),{width:a,height:o,wrapperStyle:c,portal:l}=t,[f,h]=u([n]),g=p(),_=v();if(g==null||_==null)return null;var y=g-(i?.left||0)-(i?.right||0),S=Y(t.layout,o,a,y),C=l?c:R(R({position:`absolute`,width:S?.width||a||`auto`,height:S?.height||o||`auto`},K(c,t,i,g,_,f)),c),w=l??r;return w==null||n==null?null:(0,b.createPortal)(x.createElement(`div`,{className:`recharts-legend-wrapper`,style:C,ref:h},x.createElement(q,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!l&&x.createElement(J,{width:f.width,height:f.height}),x.createElement(G,I({},t,S,{margin:i,chartWidth:g,chartHeight:_,contextPayload:n}))),w)}var Q=x.memo(Z,h);Q.displayName=`Legend`;function $(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function ee(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}export{ee as n,Q as r,$ as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionTokens-B6wfOhyn.js","assets/clsx-DsHpp3Uj.js","assets/CartesianChart-CZSKepVZ.js","assets/dist-w_zu0rIf.js","assets/arrow-left-Bg6VjX8-.js","assets/graphicalItemSelectors-Dk1a_HU_.js","assets/format-zw6IoTwZ.js","assets/SessionCompaction-Duzo69wv.js","assets/LineChart-BYjz-1bE.js","assets/SessionGraph-Bb1BdCWf.js","assets/SessionDiffs-LZrXV0AY.js","assets/file-pen-DWwu4Q-r.js","assets/SessionReplay-C3AZoYFc.js","assets/useMutation-BvFLVjYz.js","assets/play-B0mJPrwl.js","assets/Trends-p9DnVxWQ.js","assets/chart-column-Brz7pC96.js","assets/Settings-HKanGbBq.js","assets/triangle-alert-Bx2lGvGN.js"])))=>i.map(i=>d[i]);
2
+ import{A as e,C as t,F as n,M as r,N as i,O as a,S as o,T as s,_ as c,a as l,b as u,c as d,f,g as p,h as m,i as h,j as ee,k as g,l as te,m as ne,n as _,o as re,p as v,r as y,t as b,v as ie,w as x,x as ae,y as S}from"./clsx-DsHpp3Uj.js";import{a as oe,c as se,i as ce,l as C,n as w,o as T,r as le,s as ue,t as de}from"./dist-w_zu0rIf.js";import{n as fe,t as pe}from"./useMutation-BvFLVjYz.js";import{t as E}from"./arrow-left-Bg6VjX8-.js";import{t as me}from"./chart-column-Brz7pC96.js";import{t as he}from"./file-pen-DWwu4Q-r.js";import{t as ge}from"./play-B0mJPrwl.js";import{n as _e,t as ve}from"./triangle-alert-Bx2lGvGN.js";import{a as D,c as O,i as ye,n as k,o as A,r as be,s as j,t as M}from"./format-zw6IoTwZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xe=i((e=>{var t=ee();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));function Se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let n=!1,u=e=>{ne(e,()=>t.signal,()=>n=!0)},d=c(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await d((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})()),{maxPages:o}=t.options,s=i?p:m;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ce:N,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=l===0?o[0]??r.initialPageParam:N(r,s);if(l>0&&e==null)break;s=await f(s,e),l++}while(l<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function N(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var we=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new fe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=P(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=P(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){v.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ae(t,e))}findAll(e={}){return this.getAll().filter(t=>ae(e,t))}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return v.batch(()=>Promise.all(e.map(e=>e.continue().catch(t))))}};function P(e){return e.options.scope?.id}var Te=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??u(r,t),a=this.get(i);return a||(a=new te({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){v.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>o(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>o(e,t)):t}notify(e){v.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){v.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){v.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ee=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Te,this.#t=e.mutationCache||new we,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=g.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=f.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(s(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ie(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return v.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;v.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return v.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,n={}){let r={revert:!0,...n},i=v.batch(()=>this.#e.findAll(e).map(e=>e.cancel(r)));return Promise.all(i).then(t).catch(t)}invalidateQueries(e,t={}){return v.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,n={}){let r={...n,cancelRefetch:n.cancelRefetch??!0},i=v.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let n=e.fetch(void 0,r);return r.throwOnError||(n=n.catch(t)),e.state.fetchStatus===`paused`?Promise.resolve():n}));return Promise.all(i).then(t)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(s(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t).catch(t)}fetchInfiniteQuery(e){return e.behavior=Se(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t).catch(t)}ensureInfiniteQueryData(e){return e.behavior=Se(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(S(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{x(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(S(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{x(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=u(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===a&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},F=_(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),De=_(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Oe=_(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),ke=_(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ae=_(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),je=_(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Me=_(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ne=_(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Pe=_(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Fe=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ie=_(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),I=_(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),L=_(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Le=_(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Re=_(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),R=_(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),z=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),B=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ze=(e=>e?B(e):B),V=n(r(),1),Be=e=>e;function Ve(e,t=Be){let n=V.useSyncExternalStore(e.subscribe,V.useCallback(()=>t(e.getState()),[e,t]),V.useCallback(()=>t(e.getInitialState()),[e,t]));return V.useDebugValue(n),n}var He=e=>{let t=ze(e),n=e=>Ve(t,e);return Object.assign(n,t),n},Ue=(e=>e?He(e):He),We=n(xe(),1),Ge=2e3,H=Ue(e=>({events:[],initialized:!1,setInitial:t=>e({events:t,initialized:!0}),push:t=>e(e=>{if(e.events.find(e=>e.id===t.id))return{};let n=[t,...e.events];return n.length>Ge&&(n.length=Ge),{events:n}})})),U=0,W=null;function Ke(){let{initialized:e,setInitial:t,push:n}=H();(0,V.useEffect)(()=>(e||y.events({limit:1e3}).then(e=>t(e.events)).catch(()=>t([])),U+=1,W||=h(e=>n(e)),()=>{--U,U<=0&&W&&(W(),W=null)}),[])}var G=d(),qe=[{id:`nav:timeline`,title:`Timeline`,to:`/`,group:`nav`},{id:`nav:logs`,title:`Logs (disk-backed history)`,to:`/logs`,group:`nav`},{id:`nav:projects`,title:`Projects`,to:`/projects`,group:`nav`},{id:`nav:search`,title:`Search`,to:`/search`,group:`nav`},{id:`nav:agents`,title:`Agents`,to:`/agents`,group:`nav`},{id:`nav:permissions`,title:`Permissions`,to:`/permissions`,group:`nav`},{id:`nav:cron`,title:`Scheduled`,to:`/cron`,group:`nav`},{id:`nav:trends`,title:`Trends`,to:`/trends`,group:`nav`},{id:`nav:budgets`,title:`Settings · Budgets`,to:`/settings/budgets`,group:`nav`},{id:`nav:anomaly`,title:`Settings · Anomaly`,to:`/settings/anomaly`,group:`nav`},{id:`nav:triggers`,title:`Settings · Triggers`,to:`/settings/triggers`,group:`nav`}];function Je(){let[e,t]=(0,V.useState)(!1),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(0),o=se(),s=l({queryKey:[`projects`],queryFn:y.projects,enabled:e});(0,V.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e),r(``),a(0)),e.key===`Escape`&&t(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let c=(0,V.useMemo)(()=>(s.data?.projects??[]).map(e=>({id:`proj:${e.name}`,title:e.name,hint:`${e.eventCount} events · ${e.sessionIds.length} sessions`,to:`/projects/${encodeURIComponent(e.name)}`,group:`project`})),[s.data]),u=(0,V.useMemo)(()=>[...qe,...c],[c]),d=(0,V.useMemo)(()=>{let e=n.trim().toLowerCase();return e?u.filter(t=>t.title.toLowerCase().includes(e)||(t.hint??``).toLowerCase().includes(e)).slice(0,30):u.slice(0,20)},[u,n]);if((0,V.useEffect)(()=>a(0),[n]),!e)return null;let f=e=>{t(!1),o(e.to)};return(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-start justify-center pt-[10vh] px-4`,onClick:()=>t(!1),children:(0,G.jsxs)(`div`,{className:`w-full max-w-xl bg-bg-surface border border-bg-border rounded-xl shadow-2xl overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-bg-border`,children:[(0,G.jsx)(L,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),a(e=>Math.min(e+1,d.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),a(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=d[i];t&&f(t)}},placeholder:`Jump to view, project, session…`,className:`flex-1 bg-transparent outline-none text-sm`}),(0,G.jsx)(`kbd`,{className:`text-[10px] text-fg-muted mono border border-bg-border rounded px-1`,children:`esc`})]}),(0,G.jsxs)(`div`,{className:`max-h-[60vh] overflow-y-auto py-1`,children:[d.length===0&&(0,G.jsx)(`div`,{className:`p-4 text-fg-muted text-sm text-center`,children:`no results`}),d.map((e,t)=>(0,G.jsxs)(`button`,{onClick:()=>f(e),className:b(`w-full flex items-center justify-between gap-3 px-4 py-2 text-left transition`,t===i?`bg-accent/20 text-accent`:`text-fg hover:bg-bg-elev`),onMouseEnter:()=>a(t),children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm`,children:e.title}),e.hint&&(0,G.jsx)(`div`,{className:`text-[11px] text-fg-muted`,children:e.hint})]}),(0,G.jsx)(`div`,{className:`text-[10px] text-fg-muted uppercase mono`,children:e.group})]},e.id))]}),(0,G.jsxs)(`div`,{className:`px-4 py-2 border-t border-bg-border flex items-center justify-between text-[11px] text-fg-muted`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`↑↓`}),` navigate`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`↵`}),` open`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1 mono`,children:`⌘K`}),` toggle`]})]})]})})}function Ye(){Ke();let e=l({queryKey:[`health`],queryFn:y.health,refetchInterval:1e4});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col bg-bg text-fg`,children:[(0,G.jsxs)(`header`,{className:`flex items-center gap-6 px-5 py-3 border-b border-bg-border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(F,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`div`,{className:`font-bold`,children:`agentwatch`}),(0,G.jsx)(`div`,{className:`text-xs text-fg-dim`,children:e.data?.version?`v${e.data.version}`:``})]}),(0,G.jsxs)(`nav`,{className:`flex items-center gap-1 text-sm`,children:[(0,G.jsx)(K,{to:`/`,label:`Timeline`,icon:(0,G.jsx)(F,{className:`w-4 h-4`}),end:!0}),(0,G.jsx)(K,{to:`/logs`,label:`Logs`,icon:(0,G.jsx)(I,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/projects`,label:`Projects`,icon:(0,G.jsx)(Ne,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/search`,label:`Search`,icon:(0,G.jsx)(L,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/agents`,label:`Agents`,icon:(0,G.jsx)(z,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/permissions`,label:`Permissions`,icon:(0,G.jsx)(R,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/cron`,label:`Scheduled`,icon:(0,G.jsx)(je,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/trends`,label:`Trends`,icon:(0,G.jsx)(me,{className:`w-4 h-4`})}),(0,G.jsx)(K,{to:`/settings`,label:`Settings`,icon:(0,G.jsx)(_e,{className:`w-4 h-4`})})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-xs text-fg-dim`,children:[(0,G.jsx)(`kbd`,{className:`border border-bg-border rounded px-1.5 py-0.5 mono text-[10px]`,children:`⌘K`}),(0,G.jsx)(`span`,{className:b(`w-2 h-2 rounded-full`,e.isSuccess?`bg-ok`:`bg-warn`)}),(0,G.jsx)(`span`,{children:e.isSuccess?`connected`:`connecting…`})]})]}),(0,G.jsx)(`main`,{className:`flex-1 overflow-hidden`,children:(0,G.jsx)(oe,{})}),(0,G.jsx)(Je,{})]})}function K({to:e,label:t,icon:n,end:r,disabled:i}){return i?(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-fg-muted cursor-not-allowed`,title:`coming in the next phase`,children:[n,t]}):(0,G.jsxs)(le,{to:e,end:r,className:({isActive:e})=>b(`flex items-center gap-1.5 px-3 py-1.5 rounded-md transition`,e?`bg-accent/20 text-accent`:`text-fg-dim hover:bg-bg-elev hover:text-fg`),children:[n,t]})}var Xe=[`prompt`,`response`,`tool_call`,`shell_exec`,`file_write`,`file_read`,`file_change`,`session_start`,`session_end`,`compaction`],Ze=[{id:`1h`,label:`1h`,ms:60*6e4},{id:`24h`,label:`24h`,ms:1440*6e4},{id:`7d`,label:`7d`,ms:10080*6e4},{id:`all`,label:`all`,ms:null}];function Qe(){let e=H(e=>e.events),t=H(e=>e.initialized),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(`all`),[o,s]=(0,V.useState)(`all`),[c,u]=(0,V.useState)(`24h`),d=(0,V.useRef)(null),f=l({queryKey:[`agents`],queryFn:y.agents,refetchInterval:1e4});(0,V.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey)return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)||(e.preventDefault(),d.current?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let p=(0,V.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.agent,(t.get(n.agent)??0)+1);return t},[e]),m=(0,V.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.type,(t.get(n.type)??0)+1);return t},[e]),h=(0,V.useMemo)(()=>{let t=[[`all`,e.length]],n=f.data?.agents??[];for(let e of n)!e.present||!e.instrumented||t.push([e.name,p.get(e.name)??0]);for(let[e,n]of p)t.find(t=>t[0]===e)||t.push([e,n]);return t},[f.data,p,e.length]),ee=(0,V.useMemo)(()=>[[`all`,e.length]].concat(Xe.filter(e=>m.has(e)).map(e=>[e,m.get(e)])),[e.length,m]),g=(0,V.useMemo)(()=>{let t=n.trim().toLowerCase(),r=Ze.find(e=>e.id===c)?.ms??null,a=r==null?0:Date.now()-r;return e.filter(e=>i!==`all`&&e.agent!==i||o!==`all`&&e.type!==o||r!=null&&new Date(e.ts).getTime()<a?!1:t?(e.summary??``).toLowerCase().includes(t)||(e.path??``).toLowerCase().includes(t)||(e.cmd??``).toLowerCase().includes(t)||(e.tool??``).toLowerCase().includes(t)||(e.details?.fullText??``).toLowerCase().includes(t):!0)},[e,n,i,o,c]),te=t&&e.length>0&&g.length===0&&i!==`all`;return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 px-5 py-3 border-b border-bg-border bg-bg-surface`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-lg`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:d,value:n,onChange:e=>r(e.target.value),placeholder:`filter the live buffer… (press / to focus)`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-1.5 text-sm outline-none focus:border-accent`})]}),(0,G.jsx)(et,{label:`agent`,value:i,options:h,onChange:e=>a(e)}),(0,G.jsx)(et,{label:`type`,value:o,options:ee,onChange:e=>s(e)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim`,children:`window:`}),Ze.map(e=>(0,G.jsx)(`button`,{onClick:()=>u(e.id),className:b(`px-2 py-1 rounded-md transition mono`,c===e.id?`bg-accent/20 text-accent border border-accent/40`:`border border-bg-border text-fg-dim hover:bg-bg-elev`),children:e.label},e.id))]}),(0,G.jsxs)(`div`,{className:`ml-auto text-xs text-fg-dim`,children:[(0,G.jsx)(Pe,{className:`inline w-3.5 h-3.5 mr-1`}),g.length,` / `,e.length,` events`]})]}),te&&(0,G.jsxs)(`div`,{className:`px-5 py-2 text-xs text-warn bg-warn/10 border-b border-warn/30`,children:[`No `,(0,G.jsx)(`span`,{className:`mono`,children:i}),` events in the live buffer. agentwatch only captures events fired `,(0,G.jsx)(`i`,{children:`after`}),` it started. To see historical `,(0,G.jsx)(`span`,{className:`mono`,children:i}),` activity, open the `,(0,G.jsx)(w,{to:`/logs`,className:`text-accent underline`,children:`Logs`}),` view (reads disk JSONLs).`]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[!t&&(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`}),t&&e.length===0&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:`No events yet.`}),(0,G.jsxs)(`div`,{className:`text-xs`,children:[`Launch a Claude Code / Codex / Cursor / Gemini / Hermes / OpenClaw session and events will stream in real-time.`,` `,(0,G.jsx)(w,{to:`/logs`,className:`text-accent underline`,children:`Or open /logs to search historical JSONLs.`})]})]}),t&&e.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border z-10`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 w-36`,children:`date / time`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-28`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-32`,children:`type`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-10`,children:`risk`}),(0,G.jsx)(`th`,{className:`px-3 py-2`,children:`event`})]})}),(0,G.jsx)(`tbody`,{children:g.slice(0,500).map(e=>(0,G.jsx)($e,{event:e},e.id))})]})]})]})}function $e({event:e}){let t=e.summary??e.cmd??e.path??e.tool??`—`;return(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/40 row-hover`,children:[(0,G.jsx)(`td`,{className:`px-4 py-1.5 text-fg-dim mono text-xs align-top whitespace-nowrap`,children:be(e.ts)}),(0,G.jsx)(`td`,{className:b(`px-2 py-1.5 mono text-xs align-top`,M(e.agent)),children:e.agent}),(0,G.jsxs)(`td`,{className:`px-2 py-1.5 mono text-xs align-top`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mr-1`,children:O(e.type)}),e.type]}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:(0,G.jsx)(`span`,{className:b(`inline-block text-[10px] mono px-1.5 py-0.5 rounded`,j(e.riskScore)),children:e.riskScore})}),(0,G.jsxs)(`td`,{className:`px-3 py-1.5 align-top`,children:[(0,G.jsx)(w,{to:`/events/${encodeURIComponent(e.id)}`,className:`hover:text-accent`,children:(0,G.jsx)(`span`,{className:`mono text-xs truncate inline-block max-w-3xl`,children:t})}),e.sessionId&&(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e.sessionId)}`,className:`ml-3 text-[10px] text-fg-muted hover:text-accent mono`,title:e.sessionId,children:[`session:`,e.sessionId.slice(0,10)]})]})]})}function et({label:e,value:t,options:n,onChange:r}){return(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-fg-dim`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`select`,{value:t,onChange:e=>r(e.target.value),className:`bg-bg-elev border border-bg-border rounded-md px-2 py-1 outline-none focus:border-accent`,children:n.map(([e,t])=>(0,G.jsxs)(`option`,{value:e,children:[e,` (`,t,`)`]},e))})]})}function tt(){let e=l({queryKey:[`projects`],queryFn:y.projects,refetchInterval:5e3});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(e.error)return(0,G.jsxs)(`div`,{className:`p-6 text-danger`,children:[`failed: `,String(e.error)]});let t=e.data?.projects??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`Projects`}),(0,G.jsx)(`span`,{className:`text-sm text-fg-dim`,children:t.length})]}),t.length===0?(0,G.jsx)(`div`,{className:`p-10 text-center text-fg-dim`,children:`No projects detected yet — once an agent writes to a project, it'll appear here.`}):(0,G.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 p-5`,children:t.map(e=>(0,G.jsxs)(w,{to:`/projects/${encodeURIComponent(e.name)}`,className:`block border border-bg-border rounded-lg p-4 bg-bg-surface hover:bg-bg-elev hover:border-accent/40 transition`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,G.jsx)(Ne,{className:`w-4 h-4 text-accent shrink-0`}),(0,G.jsx)(`div`,{className:`font-medium truncate`,children:e.name})]}),(0,G.jsx)(De,{className:`w-4 h-4 text-fg-muted`})]}),(0,G.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-2 text-xs`,children:[(0,G.jsx)(q,{label:`events`,value:String(e.eventCount)}),(0,G.jsx)(q,{label:`sessions`,value:String(e.sessionIds.length)}),(0,G.jsx)(q,{label:`cost`,value:A(e.cost)})]}),e.lastTs&&(0,G.jsxs)(`div`,{className:`mt-2 text-[11px] text-fg-muted mono`,children:[`last: `,k(e.lastTs)]})]},e.name))})]})}function q({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`bg-bg-elev rounded-md px-2 py-1.5`,children:[(0,G.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono`,children:t})]})}function nt(){let{name:e=``}=C(),t=l({queryKey:[`project-sessions`,e],queryFn:()=>y.projectSessions(e),refetchInterval:5e3}).data?.sessions??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:`/projects`,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:decodeURIComponent(e)}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[t.length,` sessions`]})]}),(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-5 py-2 w-32`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2`,children:`session`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-20`,children:`events`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-24`,children:`cost`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`first`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`last`})]})}),(0,G.jsx)(`tbody`,{children:t.map(e=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/40 row-hover`,children:[(0,G.jsx)(`td`,{className:b(`px-5 py-1.5 mono text-xs`,M(e.agent)),children:e.agent}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(e.sessionId)}`,className:`hover:text-accent`,children:e.sessionId})}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:e.eventCount}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs`,children:A(e.cost)}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs text-fg-dim`,children:e.firstTs?k(e.firstTs):`—`}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs text-fg-dim`,children:e.lastTs?k(e.lastTs):`—`})]},e.sessionId))})]})]})}function rt(){let{id:e=``}=C(),t=l({queryKey:[`session`,e],queryFn:()=>y.session(e),refetchInterval:2e3});if(t.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(t.error)return(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(t.error)});let n=t.data?.events??[],r=n;return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:-1,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsxs)(`h1`,{className:`text-lg font-bold mono`,children:[`session:`,e.slice(0,16)]}),(0,G.jsx)(`span`,{className:b(`text-sm`,M(t.data?.agent)),children:t.data?.agent}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[n.length,` events`]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/tokens`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(me,{className:`w-3.5 h-3.5`}),` tokens`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/compaction`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(F,{className:`w-3.5 h-3.5`}),` compaction`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/graph`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Fe,{className:`w-3.5 h-3.5`}),` graph`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/diffs`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(he,{className:`w-3.5 h-3.5`}),` diffs`]}),(0,G.jsxs)(w,{to:`/sessions/${encodeURIComponent(e)}/replay`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(ge,{className:`w-3.5 h-3.5`}),` replay`]}),(0,G.jsxs)(`a`,{href:`/api/sessions/${encodeURIComponent(e)}/export?format=md&inline=1`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Me,{className:`w-3.5 h-3.5`}),` .md`]}),(0,G.jsxs)(`a`,{href:`/api/sessions/${encodeURIComponent(e)}/export?format=json&inline=1`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-dim hover:text-accent flex items-center gap-1`,children:[(0,G.jsx)(Me,{className:`w-3.5 h-3.5`}),` .json`]})]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-auto`,children:r.map(e=>(0,G.jsx)(it,{event:e},e.id))})]})}function it({event:e}){let t=e.details?.fullText??e.details?.toolResult??e.details?.thinking;return(0,G.jsxs)(`div`,{className:`px-5 py-2 border-b border-bg-border/30 hover:bg-bg-surface/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mono`,children:ye(e.ts)}),(0,G.jsx)(`span`,{className:b(`mono`,M(e.agent)),children:e.agent}),(0,G.jsxs)(`span`,{className:`mono text-fg-dim`,children:[O(e.type),` `,e.type]}),(0,G.jsx)(`span`,{className:b(`text-[10px] mono px-1.5 rounded`,j(e.riskScore)),children:e.riskScore}),(0,G.jsx)(w,{to:`/events/${encodeURIComponent(e.id)}`,className:`ml-auto text-fg-muted hover:text-accent text-[11px]`,children:`detail →`})]}),e.summary&&(0,G.jsx)(`div`,{className:`mt-1 text-sm mono whitespace-pre-wrap`,children:e.summary}),t&&(0,G.jsxs)(`pre`,{className:`mt-1 text-xs mono text-fg-dim bg-bg-surface rounded p-2 overflow-x-auto max-h-40 overflow-y-auto whitespace-pre-wrap`,children:[t.slice(0,2e3),t.length>2e3&&`… (${t.length-2e3} more chars)`]})]})}function at(){let{id:e=``}=C(),t=l({queryKey:[`event`,e],queryFn:()=>y.event(e)});if(t.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});if(t.error)return(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(t.error)});let n=t.data?.event;return n?(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(w,{to:-1,className:`text-fg-dim hover:text-accent`,children:(0,G.jsx)(E,{className:`w-4 h-4 inline`})}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`event`}),(0,G.jsx)(`span`,{className:`text-sm text-fg-dim mono`,children:n.id})]}),(0,G.jsxs)(`div`,{className:`p-5 space-y-4 max-w-5xl`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,G.jsx)(J,{label:`time`,value:k(n.ts)}),(0,G.jsx)(J,{label:`agent`,value:(0,G.jsx)(`span`,{className:M(n.agent),children:n.agent})}),(0,G.jsx)(J,{label:`type`,value:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`text-fg-muted`,children:[O(n.type),` `]}),n.type]})}),(0,G.jsx)(J,{label:`risk`,value:(0,G.jsx)(`span`,{className:b(`mono px-1.5 rounded`,j(n.riskScore)),children:n.riskScore})}),n.sessionId&&(0,G.jsx)(J,{label:`session`,value:(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(n.sessionId)}`,className:`hover:text-accent mono text-xs`,children:n.sessionId.slice(0,20)})}),n.tool&&(0,G.jsx)(J,{label:`tool`,value:n.tool}),n.path&&(0,G.jsx)(J,{label:`path`,value:(0,G.jsx)(`span`,{className:`mono text-xs`,children:n.path})})]}),n.summary&&(0,G.jsx)(Y,{label:`summary`,children:(0,G.jsx)(`div`,{className:`whitespace-pre-wrap mono text-sm`,children:n.summary})}),n.cmd&&(0,G.jsx)(Y,{label:`cmd`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.cmd})}),n.details?.fullText&&(0,G.jsx)(Y,{label:`full text`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.details.fullText})}),n.details?.thinking&&(0,G.jsx)(Y,{label:`thinking`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap text-fg-dim`,children:n.details.thinking})}),n.details?.toolInput&&(0,G.jsx)(Y,{label:`tool input`,children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:JSON.stringify(n.details.toolInput,null,2)})}),n.details?.toolResult&&(0,G.jsx)(Y,{label:b(`tool result`,n.details.toolError&&`(error)`),children:(0,G.jsx)(`pre`,{className:`mono text-xs whitespace-pre-wrap`,children:n.details.toolResult})}),n.details?.usage&&(0,G.jsx)(Y,{label:`usage`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 text-sm`,children:[(0,G.jsx)(J,{label:`input`,value:D(n.details.usage.input)}),(0,G.jsx)(J,{label:`output`,value:D(n.details.usage.output)}),(0,G.jsx)(J,{label:`cache read`,value:D(n.details.usage.cacheRead)}),(0,G.jsx)(J,{label:`cache create`,value:D(n.details.usage.cacheCreate)}),n.details.cost!=null&&(0,G.jsx)(J,{label:`cost`,value:A(n.details.cost)}),n.details.model&&(0,G.jsx)(J,{label:`model`,value:(0,G.jsx)(`span`,{className:`mono text-xs`,children:n.details.model})})]})}),n.details?.source&&(0,G.jsxs)(`div`,{className:`text-xs text-fg-muted mono`,children:[`source: `,n.details.source]})]})]}):(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:`event not found`})}function J({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] uppercase text-fg-muted`,children:e}),(0,G.jsx)(`div`,{className:`mt-0.5`,children:t})]})}function Y({label:e,children:t}){return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-xs uppercase text-fg-muted mb-1`,children:e}),(0,G.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-md p-3 overflow-x-auto`,children:t})]})}function ot(){let[e,t]=(0,V.useState)(``),[n,r]=(0,V.useState)(`live`),i=(0,V.useRef)(null);(0,V.useEffect)(()=>{i.current?.focus()},[]);let a=pe({mutationFn:({q:e,m:t})=>y.search(e,t,100)});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let r=e.trim();r&&a.mutate({q:r,m:n})},className:`px-5 py-4 border-b border-bg-border bg-bg-surface flex items-center gap-3`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:i,value:e,onChange:e=>t(e.target.value),placeholder:`search — enter to run`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-2 outline-none focus:border-accent`})]}),(0,G.jsx)(`div`,{className:`flex rounded-md overflow-hidden border border-bg-border`,children:[`live`,`cross`,`semantic`].map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:b(`px-3 py-2 text-xs transition`,n===e?`bg-accent/20 text-accent`:`bg-bg-elev text-fg-dim hover:bg-bg`),children:e},e))}),(0,G.jsx)(`button`,{type:`submit`,disabled:!e.trim()||a.isPending,className:`px-4 py-2 bg-accent/20 text-accent rounded-md text-xs hover:bg-accent/30 disabled:opacity-40`,children:a.isPending?`searching…`:`search`})]}),(0,G.jsx)(st,{mode:n}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[a.data?.status&&(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-warn bg-warn/10 border-b border-warn/30`,children:a.data.status}),a.data?.error&&(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-danger bg-danger/10 border-b border-danger/30`,children:a.data.error}),a.data&&a.data.hits.length===0&&!a.isPending&&(0,G.jsx)(`div`,{className:`p-10 text-center text-fg-dim`,children:`no matches.`}),a.data&&a.data.hits.length>0&&(0,G.jsx)(ct,{hits:a.data.hits,mode:a.data.mode}),!a.data&&!a.isPending&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-1`,children:`Three modes:`}),(0,G.jsxs)(`ul`,{className:`text-xs space-y-1 inline-block text-left`,children:[(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`live`}),` — substring across the current in-memory buffer (fast, recent only)`]}),(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`cross`}),` — ripgrep across every JSONL on disk (slow first time, thorough)`]}),(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`b`,{children:`semantic`}),` — hybrid BM25 + embedding search (fuzzy, needs the index built in the TUI first)`]})]})]})]})]})}function st({mode:e}){return(0,G.jsx)(`div`,{className:`px-5 py-2 text-xs text-fg-muted bg-bg-surface border-b border-bg-border/50`,children:{live:`searching the in-memory ring buffer (500–2000 events).`,cross:`searching every session JSONL on disk.`,semantic:`searching the hybrid BM25 + embedding index.`}[e]})}function ct({hits:e}){return(0,G.jsx)(`div`,{children:e.map((e,t)=>{if(e.kind===`live`){let n=e.event;return(0,G.jsxs)(w,{to:`/events/${encodeURIComponent(n.id)}`,className:`block px-5 py-2 border-b border-bg-border/40 row-hover`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted mono`,children:ye(n.ts)}),(0,G.jsx)(`span`,{className:b(`mono`,M(n.agent)),children:n.agent}),(0,G.jsxs)(`span`,{className:`mono text-fg-dim`,children:[O(n.type),` `,n.type]})]}),(0,G.jsx)(`div`,{className:`mt-0.5 mono text-sm truncate`,children:n.summary??n.cmd??n.path??n.tool??``})]},t)}let n=e.hit;return(0,G.jsxs)(w,{to:n.sessionId?`/sessions/${encodeURIComponent(n.sessionId)}`:`#`,className:`block px-5 py-2 border-b border-bg-border/40 row-hover`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:b(`mono`,M(n.agent??`unknown`)),children:n.agent??`—`}),(0,G.jsx)(`span`,{className:`mono text-fg-dim`,children:n.sessionId?.slice(0,20)}),n.score!=null&&(0,G.jsxs)(`span`,{className:`text-fg-muted mono text-[10px]`,children:[`score `,n.score.toFixed(3)]})]}),(0,G.jsx)(`div`,{className:`mt-0.5 mono text-sm whitespace-pre-wrap line-clamp-3 text-fg-dim`,children:n.snippet??``})]},t)})})}function lt(){let e=l({queryKey:[`agents`],queryFn:y.agents,refetchInterval:1e4}).data?.agents??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(z,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`agents`}),(0,G.jsxs)(`span`,{className:`text-sm text-fg-dim`,children:[e.filter(e=>e.present).length,` installed`]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 p-5`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.present?e.instrumented?(0,G.jsx)(ke,{className:`w-4 h-4 text-ok`}):(0,G.jsx)(ve,{className:`w-4 h-4 text-warn`}):(0,G.jsx)(Ae,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`div`,{className:b(`font-bold`,M(e.name)),children:e.label})]}),(0,G.jsx)(`div`,{className:`mt-2 text-xs text-fg-dim mono`,children:e.present?e.instrumented?`installed · events captured`:`detected · events TBD`:`not detected`}),e.configPath&&(0,G.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-muted mono break-all`,children:e.configPath}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-center gap-4 text-xs`,children:[(0,G.jsxs)(`span`,{className:`text-fg-dim`,children:[`events: `,(0,G.jsx)(`span`,{className:`mono`,children:e.eventCount})]}),e.lastEventAt&&(0,G.jsxs)(`span`,{className:`text-fg-dim`,children:[`last: `,(0,G.jsx)(`span`,{className:`mono`,children:k(e.lastEventAt)})]})]})]},e.name))})]})}function ut(){let e=l({queryKey:[`permissions`],queryFn:y.permissions});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let t=e.data??{};return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(R,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`permissions`})]}),(0,G.jsxs)(`div`,{className:`p-5 space-y-5 max-w-5xl`,children:[(0,G.jsx)(X,{label:`Claude Code`,perms:t.claude}),(0,G.jsx)(X,{label:`Codex`,perms:t.codex}),(0,G.jsx)(X,{label:`Gemini`,perms:t.gemini}),(0,G.jsx)(X,{label:`OpenClaw`,perms:t.openclaw})]})]})}function X({label:e,perms:t}){return t?(0,G.jsxs)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Re,{className:`w-4 h-4 text-ok`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:e})]}),(0,G.jsx)(`pre`,{className:`mono text-xs text-fg-dim overflow-x-auto whitespace-pre-wrap`,children:JSON.stringify(t,null,2)})]}):(0,G.jsx)(`div`,{className:`bg-bg-surface border border-bg-border rounded-lg p-4`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,G.jsx)(Le,{className:`w-4 h-4 text-fg-muted`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:e}),(0,G.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`not installed / no config`})]})})}function dt(){let e=l({queryKey:[`cron`],queryFn:y.cron,refetchInterval:1e4});if(e.isLoading)return(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`});let t=e.data?.jobs??[],n=e.data?.heartbeats??[],r=e.data?.scheduledEvents??[];return(0,G.jsxs)(`div`,{className:`h-full overflow-auto`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 border-b border-bg-border flex items-baseline gap-3`,children:[(0,G.jsx)(je,{className:`w-5 h-5 text-accent`}),(0,G.jsx)(`h1`,{className:`text-lg font-bold`,children:`scheduled`})]}),(0,G.jsxs)(`section`,{className:`p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Oe,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:`cron jobs`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:t.length})]}),t.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No OpenClaw cron jobs installed.`}),t.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`text-left text-xs uppercase text-fg-muted`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`name`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`schedule`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`agent`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`channel`}),(0,G.jsx)(`th`,{className:`py-1`,children:`last run`})]})}),(0,G.jsx)(`tbody`,{children:t.map(e=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 mono text-xs`,children:[(0,G.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.name??e.id}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.cron??e.schedule??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.agentId??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.channel??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 text-fg-dim`,children:e.lastRunAt?k(e.lastRunAt):`never`})]},e.id))})]})]}),(0,G.jsxs)(`section`,{className:`p-5 border-t border-bg-border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,G.jsx)(Ie,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h2`,{className:`font-bold`,children:`heartbeats`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:n.length})]}),n.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No heartbeat tasks detected.`}),n.length>0&&(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`text-left text-xs uppercase text-fg-muted`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`task`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`agent`}),(0,G.jsx)(`th`,{className:`py-1 pr-4`,children:`last`}),(0,G.jsx)(`th`,{className:`py-1`,children:`file`})]})}),(0,G.jsx)(`tbody`,{children:n.map((e,t)=>(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 mono text-xs`,children:[(0,G.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.taskName??e.name??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.agentId??`—`}),(0,G.jsx)(`td`,{className:`py-1.5 pr-4 text-fg-dim`,children:e.lastHeartbeatAt?k(e.lastHeartbeatAt):`—`}),(0,G.jsx)(`td`,{className:`py-1.5 text-fg-dim truncate max-w-md`,children:e.filePath??e.file??``})]},t))})]})]}),(0,G.jsxs)(`section`,{className:`p-5 border-t border-bg-border`,children:[(0,G.jsxs)(`h2`,{className:`font-bold mb-3`,children:[`recent scheduled events `,(0,G.jsx)(`span`,{className:`text-xs font-normal text-fg-dim`,children:r.length})]}),r.length===0&&(0,G.jsx)(`div`,{className:`text-sm text-fg-dim`,children:`No scheduled events in the live buffer.`}),r.slice(0,50).map(e=>(0,G.jsxs)(`div`,{className:`mono text-xs py-1 border-b border-bg-border/20`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim mr-2`,children:k(e.ts)}),(0,G.jsx)(`span`,{className:`text-accent mr-2`,children:e.agent}),(0,G.jsx)(`span`,{className:`mr-2`,children:e.type}),(0,G.jsx)(`span`,{className:`text-fg-dim`,children:e.summary})]},e.id))]})]})}var Z=[{id:`1h`,label:`1h`,hours:1},{id:`24h`,label:`24h`,hours:24},{id:`7d`,label:`7d`,hours:168},{id:`30d`,label:`30d`,hours:720},{id:`all`,label:`all`,hours:null}],ft=[`claude-code`,`codex`,`gemini`];function pt(){let[e,t]=(0,V.useState)(``),[n,r]=(0,V.useState)(`7d`),[i,a]=(0,V.useState)(new Set),[o,s]=(0,V.useState)(100),c=(0,V.useRef)(null);(0,V.useEffect)(()=>{c.current?.focus()},[]);let u=l({queryKey:[`agents`],queryFn:y.agents});(0,V.useMemo)(()=>new Set(ft),[]);let d=pe({mutationFn:({q:e,since:t,agents:n,limit:r})=>y.search(e,`cross`,r,{since:t,agents:n})});return(0,G.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,G.jsxs)(`form`,{onSubmit:t=>{t?.preventDefault();let r=e.trim();if(!r)return;let a=Z.find(e=>e.id===n)?.hours??null,s=a==null?void 0:new Date(Date.now()-a*36e5).toISOString(),c=i.size>0?Array.from(i):void 0;d.mutate({q:r,since:s,agents:c,limit:o})},className:`flex flex-wrap items-center gap-3 px-5 py-3 border-b border-bg-border bg-bg-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(I,{className:`w-4 h-4 text-accent`}),(0,G.jsx)(`h1`,{className:`font-bold`,children:`Logs`}),(0,G.jsx)(`span`,{className:`text-xs text-fg-dim`,children:`disk-backed history search`})]}),(0,G.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-xl`,children:[(0,G.jsx)(L,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted pointer-events-none`}),(0,G.jsx)(`input`,{ref:c,value:e,onChange:e=>t(e.target.value),placeholder:`search every session file on disk — press enter`,className:`w-full bg-bg-elev border border-bg-border rounded-md pl-9 pr-3 py-1.5 text-sm outline-none focus:border-accent`})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-fg-dim`,children:`when:`}),Z.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:b(`px-2 py-1 rounded-md transition mono`,n===e.id?`bg-accent/20 text-accent border border-accent/40`:`border border-bg-border text-fg-dim hover:bg-bg-elev`),children:e.label},e.id))]}),(0,G.jsx)(`button`,{type:`submit`,disabled:!e.trim()||d.isPending,className:`px-4 py-1.5 rounded-md bg-accent/20 text-accent text-xs hover:bg-accent/30 disabled:opacity-40`,children:d.isPending?`searching…`:`search`})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 px-5 py-2 border-b border-bg-border/50 text-xs bg-bg/40`,children:[(0,G.jsx)(`span`,{className:`text-fg-muted`,children:`agents:`}),ft.map(e=>{let t=i.has(e),n=u.data?.agents.find(t=>t.name===e&&t.present);return(0,G.jsx)(`button`,{onClick:()=>{let n=new Set(i);t?n.delete(e):n.add(e),a(n)},className:b(`px-2 py-0.5 rounded-md border transition mono`,t?`border-accent/40 bg-accent/20 ${M(e)}`:`border-bg-border text-fg-dim hover:bg-bg-elev ${n?``:`opacity-50`}`),title:n?`${e} (installed)`:`${e} — not detected on disk`,children:e},e)}),(0,G.jsx)(`span`,{className:`text-fg-muted ml-3`,children:`results cap:`}),(0,G.jsx)(`select`,{value:o,onChange:e=>s(Number(e.target.value)),className:`bg-bg-elev border border-bg-border rounded-md px-2 py-0.5 mono`,children:[50,100,200,500].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),u.data?.agents.some(e=>e.name===`openclaw`&&e.present)&&(0,G.jsx)(`span`,{className:`ml-auto text-warn/80`,children:`OpenClaw + Hermes not scanned yet (SQLite storage — adapter TBD).`})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[d.isPending&&(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`searching disk…`}),d.isError&&(0,G.jsx)(`div`,{className:`p-6 text-danger`,children:String(d.error.message)}),d.data&&d.data.hits.length===0&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsxs)(`div`,{children:[`No matches on disk for “`,e.trim(),`”.`]}),(0,G.jsx)(`div`,{className:`text-xs mt-2`,children:`Try a wider time window, drop agent filters, or switch query to something broader.`})]}),d.data&&d.data.hits.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`px-5 py-2 text-xs text-fg-dim bg-bg-surface border-b border-bg-border`,children:[(0,G.jsx)(Pe,{className:`inline w-3.5 h-3.5 mr-1`}),d.data.hits.length,` hits`,d.data.totalScanned!=null&&d.data.totalScanned!==d.data.hits.length&&(0,G.jsxs)(`span`,{children:[` · `,d.data.totalScanned,` scanned before filters`]}),(0,G.jsxs)(`span`,{children:[` · window: `,Z.find(e=>e.id===n)?.label]}),i.size>0&&(0,G.jsxs)(`span`,{children:[` · agents: `,Array.from(i).join(`, `)]})]}),(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 bg-bg-surface border-b border-bg-border z-10`,children:(0,G.jsxs)(`tr`,{className:`text-left text-xs uppercase text-fg-muted`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 w-36`,children:`date / time`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-28`,children:`agent`}),(0,G.jsx)(`th`,{className:`px-2 py-2 w-44`,children:`session`}),(0,G.jsx)(`th`,{className:`px-3 py-2`,children:`match`})]})}),(0,G.jsx)(`tbody`,{children:d.data.hits.map((e,t)=>{let n=e.hit??e,r=n.ts;return(0,G.jsxs)(`tr`,{className:`border-b border-bg-border/30 row-hover`,children:[(0,G.jsx)(`td`,{className:`px-4 py-1.5 text-fg-dim mono text-xs align-top whitespace-nowrap`,children:r?be(r):`—`}),(0,G.jsx)(`td`,{className:b(`px-2 py-1.5 mono text-xs align-top`,M(n.agent)),children:n.agent}),(0,G.jsx)(`td`,{className:`px-2 py-1.5 mono text-xs align-top`,children:n.sessionId?(0,G.jsx)(w,{to:`/sessions/${encodeURIComponent(n.sessionId)}`,className:`hover:text-accent`,title:n.sessionId,children:n.sessionId.slice(0,16)}):(0,G.jsx)(`span`,{className:`text-fg-muted`,children:`—`})}),(0,G.jsx)(`td`,{className:`px-3 py-1.5 mono text-xs align-top whitespace-pre-wrap truncate max-w-3xl`,children:n.line})]},`${n.path}:${n.lineNumber}:${t}`)})})]})]}),!d.data&&!d.isPending&&(0,G.jsxs)(`div`,{className:`p-10 text-center text-fg-dim`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:`Type a query + enter.`}),(0,G.jsx)(`div`,{className:`text-xs`,children:"This scans the session JSONLs on disk (`~/.claude/projects/`, `~/.codex/sessions/`, `~/.gemini/tmp/`). Unlike the Timeline page, results go all the way back, not just since agentwatch booted."})]})]})]})}var mt=`modulepreload`,ht=function(e){return`/`+e},gt={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ht(t,n),t in gt)return;gt[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:mt,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},_t=(0,V.lazy)(()=>Q(()=>import(`./SessionTokens-B6wfOhyn.js`).then(e=>({default:e.SessionTokensPage})),__vite__mapDeps([0,1,2,3,4,5,6]))),vt=(0,V.lazy)(()=>Q(()=>import(`./SessionCompaction-Duzo69wv.js`).then(e=>({default:e.SessionCompactionPage})),__vite__mapDeps([7,1,2,3,8,4,6]))),yt=(0,V.lazy)(()=>Q(()=>import(`./SessionGraph-Bb1BdCWf.js`).then(e=>({default:e.SessionGraphPage})),__vite__mapDeps([9,1,3,4,6]))),bt=(0,V.lazy)(()=>Q(()=>import(`./SessionDiffs-LZrXV0AY.js`).then(e=>({default:e.SessionDiffsPage})),__vite__mapDeps([10,1,3,4,11,6]))),xt=(0,V.lazy)(()=>Q(()=>import(`./SessionReplay-C3AZoYFc.js`).then(e=>({default:e.SessionReplayPage})),__vite__mapDeps([12,1,3,13,4,14,6]))),St=(0,V.lazy)(()=>Q(()=>import(`./Trends-p9DnVxWQ.js`).then(e=>({default:e.TrendsPage})),__vite__mapDeps([15,1,2,8,16,5,6]))),Ct=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.SettingsShell})),__vite__mapDeps([17,1,3,13,18]))),wt=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.BudgetsSettings})),__vite__mapDeps([17,1,3,13,18]))),Tt=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.AnomalySettings})),__vite__mapDeps([17,1,3,13,18]))),Et=(0,V.lazy)(()=>Q(()=>import(`./Settings-HKanGbBq.js`).then(e=>({default:e.TriggersSettings})),__vite__mapDeps([17,1,3,13,18]))),Dt=new Ee({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:2e3}}});function $(e){return(0,G.jsx)(V.Suspense,{fallback:(0,G.jsx)(`div`,{className:`p-6 text-fg-dim`,children:`loading…`}),children:e})}We.createRoot(document.getElementById(`root`)).render((0,G.jsx)(V.StrictMode,{children:(0,G.jsx)(re,{client:Dt,children:(0,G.jsx)(de,{children:(0,G.jsx)(ue,{children:(0,G.jsxs)(T,{element:(0,G.jsx)(Ye,{}),children:[(0,G.jsx)(T,{index:!0,element:(0,G.jsx)(Qe,{})}),(0,G.jsx)(T,{path:`projects`,element:(0,G.jsx)(tt,{})}),(0,G.jsx)(T,{path:`projects/:name`,element:(0,G.jsx)(nt,{})}),(0,G.jsx)(T,{path:`sessions/:id`,element:(0,G.jsx)(rt,{})}),(0,G.jsx)(T,{path:`sessions/:id/tokens`,element:$((0,G.jsx)(_t,{}))}),(0,G.jsx)(T,{path:`sessions/:id/compaction`,element:$((0,G.jsx)(vt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/graph`,element:$((0,G.jsx)(yt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/diffs`,element:$((0,G.jsx)(bt,{}))}),(0,G.jsx)(T,{path:`sessions/:id/replay`,element:$((0,G.jsx)(xt,{}))}),(0,G.jsx)(T,{path:`events/:id`,element:(0,G.jsx)(at,{})}),(0,G.jsx)(T,{path:`search`,element:(0,G.jsx)(ot,{})}),(0,G.jsx)(T,{path:`logs`,element:(0,G.jsx)(pt,{})}),(0,G.jsx)(T,{path:`agents`,element:(0,G.jsx)(lt,{})}),(0,G.jsx)(T,{path:`permissions`,element:(0,G.jsx)(ut,{})}),(0,G.jsx)(T,{path:`cron`,element:(0,G.jsx)(dt,{})}),(0,G.jsx)(T,{path:`trends`,element:$((0,G.jsx)(St,{}))}),(0,G.jsxs)(T,{path:`settings`,element:$((0,G.jsx)(Ct,{})),children:[(0,G.jsx)(T,{index:!0,element:(0,G.jsx)(ce,{to:`budgets`,replace:!0})}),(0,G.jsx)(T,{path:`budgets`,element:$((0,G.jsx)(wt,{}))}),(0,G.jsx)(T,{path:`anomaly`,element:$((0,G.jsx)(Tt,{}))}),(0,G.jsx)(T,{path:`triggers`,element:$((0,G.jsx)(Et,{}))})]}),(0,G.jsx)(T,{path:`*`,element:(0,G.jsx)(ce,{to:`/`,replace:!0})})]})})})})}));
@@ -0,0 +1 @@
1
+ *,:before,:after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.left-3{left:.75rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-50{z-index:50}.m-5{margin:1.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-40{max-height:10rem}.max-h-96{max-height:24rem}.max-h-\[60vh\]{max-height:60vh}.min-h-\[180px\]{min-height:180px}.min-h-\[300px\]{min-height:300px}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-60{width:15rem}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[240px\]{min-width:240px}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-accent\/40{border-color:#58a6ff66}.border-bg-border{--tw-border-opacity:1;border-color:rgb(43 49 57/var(--tw-border-opacity,1))}.border-bg-border\/20{border-color:#2b313933}.border-bg-border\/30{border-color:#2b31394d}.border-bg-border\/40{border-color:#2b313966}.border-bg-border\/50{border-color:#2b313980}.border-danger\/30{border-color:#f851494d}.border-danger\/40{border-color:#f8514966}.border-warn\/30{border-color:#d299224d}.border-warn\/40{border-color:#d2992266}.bg-accent\/10{background-color:#58a6ff1a}.bg-accent\/20{background-color:#58a6ff33}.bg-bg{--tw-bg-opacity:1;background-color:rgb(11 13 16/var(--tw-bg-opacity,1))}.bg-bg-elev{--tw-bg-opacity:1;background-color:rgb(26 31 38/var(--tw-bg-opacity,1))}.bg-bg-surface{--tw-bg-opacity:1;background-color:rgb(18 21 26/var(--tw-bg-opacity,1))}.bg-bg\/30{background-color:#0b0d104d}.bg-bg\/40{background-color:#0b0d1066}.bg-black\/60{background-color:#0009}.bg-danger\/10{background-color:#f851491a}.bg-danger\/20{background-color:#f8514933}.bg-fg\/5{background-color:#e6edf30d}.bg-ok{--tw-bg-opacity:1;background-color:rgb(63 185 80/var(--tw-bg-opacity,1))}.bg-ok\/10{background-color:#3fb9501a}.bg-transparent{background-color:#0000}.bg-warn{--tw-bg-opacity:1;background-color:rgb(210 153 34/var(--tw-bg-opacity,1))}.bg-warn\/10{background-color:#d299221a}.bg-warn\/20{background-color:#d2992233}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pl-9{padding-left:2.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-\[10vh\]{padding-top:10vh}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.text-accent{--tw-text-opacity:1;color:rgb(88 166 255/var(--tw-text-opacity,1))}.text-amber-400{--tw-text-opacity:1;color:rgb(251 191 36/var(--tw-text-opacity,1))}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.text-cyan-400{--tw-text-opacity:1;color:rgb(34 211 238/var(--tw-text-opacity,1))}.text-danger{--tw-text-opacity:1;color:rgb(248 81 73/var(--tw-text-opacity,1))}.text-emerald-400{--tw-text-opacity:1;color:rgb(52 211 153/var(--tw-text-opacity,1))}.text-fg{--tw-text-opacity:1;color:rgb(230 237 243/var(--tw-text-opacity,1))}.text-fg-dim{--tw-text-opacity:1;color:rgb(125 133 144/var(--tw-text-opacity,1))}.text-fg-muted{--tw-text-opacity:1;color:rgb(72 79 88/var(--tw-text-opacity,1))}.text-fuchsia-400{--tw-text-opacity:1;color:rgb(232 121 249/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-lime-400{--tw-text-opacity:1;color:rgb(163 230 53/var(--tw-text-opacity,1))}.text-ok{--tw-text-opacity:1;color:rgb(63 185 80/var(--tw-text-opacity,1))}.text-orange-400{--tw-text-opacity:1;color:rgb(251 146 60/var(--tw-text-opacity,1))}.text-pink-400{--tw-text-opacity:1;color:rgb(244 114 182/var(--tw-text-opacity,1))}.text-purple-400{--tw-text-opacity:1;color:rgb(192 132 252/var(--tw-text-opacity,1))}.text-teal-400{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity,1))}.text-warn{--tw-text-opacity:1;color:rgb(210 153 34/var(--tw-text-opacity,1))}.text-warn\/80{color:#d29922cc}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html,body,#root{height:100%}body{font-feature-settings:"ss01", "cv11"}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#2b3139;border-radius:5px}::-webkit-scrollbar-thumb:hover{background:#484f58}.mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace}.row-hover:hover{background:#12151a}.hover\:border-accent\/40:hover{border-color:#58a6ff66}.hover\:bg-accent\/30:hover{background-color:#58a6ff4d}.hover\:bg-bg:hover{--tw-bg-opacity:1;background-color:rgb(11 13 16/var(--tw-bg-opacity,1))}.hover\:bg-bg-elev:hover{--tw-bg-opacity:1;background-color:rgb(26 31 38/var(--tw-bg-opacity,1))}.hover\:bg-bg-surface\/40:hover{background-color:#12151a66}.hover\:text-accent:hover{--tw-text-opacity:1;color:rgb(88 166 255/var(--tw-text-opacity,1))}.hover\:text-fg:hover{--tw-text-opacity:1;color:rgb(230 237 243/var(--tw-text-opacity,1))}.focus\:border-accent:focus{--tw-border-opacity:1;border-color:rgb(88 166 255/var(--tw-border-opacity,1))}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ring-accent\/50:focus{--tw-ring-color:#58a6ff80}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -0,0 +1 @@
1
+ import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./clsx-DsHpp3Uj.js";var t=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{A as e,C as t,D as n,E as r,F as i,M as a,d as o,p as s,s as c,u as l,y as u}from"./clsx-DsHpp3Uj.js";var d=class extends l{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||f(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=o({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),s.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var p=class extends e{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u(t.mutationKey)!==u(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??f();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},m=i(a(),1);function h(e,r){let i=c(r),[a]=m.useState(()=>new p(i,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let o=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(s.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=m.useCallback((e,n)=>{a.mutate(e,n).catch(t)},[a]);if(o.error&&n(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}export{d as n,h as t};
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0iIzU4YTZmZiI+PHBhdGggZD0iTTE2IDRMNCAyNGwxMiAwIDEyLTB6Ii8+PC9zdmc+" />
7
+ <title>agentwatch</title>
8
+ <style>
9
+ html, body, #root { height: 100%; margin: 0; }
10
+ body { background: #0b0d10; color: #e6edf3; font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
11
+ </style>
12
+ <script type="module" crossorigin src="/assets/index-Bu9taSiK.js"></script>
13
+ <link rel="modulepreload" crossorigin href="/assets/clsx-DsHpp3Uj.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/dist-w_zu0rIf.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/useMutation-BvFLVjYz.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/arrow-left-Bg6VjX8-.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/chart-column-Brz7pC96.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/file-pen-DWwu4Q-r.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/play-B0mJPrwl.js">
20
+ <link rel="modulepreload" crossorigin href="/assets/triangle-alert-Bx2lGvGN.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/format-zw6IoTwZ.js">
22
+ <link rel="stylesheet" crossorigin href="/assets/index-CJPUO3dh.css">
23
+ </head>
24
+ <body>
25
+ <div id="root"></div>
26
+ </body>
27
+ </html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@misha_misha/agentwatch",
3
- "version": "0.0.3",
4
- "description": "Local-only observability for every AI agent on your machine. Unified timeline across Claude Code, Codex, Gemini CLI, Cursor, OpenClaw — with token attribution, anomaly detection, MCP server mode, OpenTelemetry exporter, and hybrid semantic search. No cloud, no telemetry, no sign-in.",
3
+ "version": "0.0.4",
4
+ "description": "Local-only observability + control plane for every AI coding agent on your machine. TUI live tail + browser dashboard on localhost. Unified timeline across Claude Code, Codex, Gemini CLI, Cursor, Hermes, OpenClaw — token + cost accounting, compaction + anomaly detection, SVG call graphs, diff attribution, agent-aware replay, MCP server mode, OpenTelemetry exporter. No cloud, no telemetry, no sign-in.",
5
5
  "type": "module",
6
6
  "author": "Misha Nefedov",
7
7
  "repository": {
@@ -22,8 +22,11 @@
22
22
  "LICENSE"
23
23
  ],
24
24
  "scripts": {
25
- "build": "tsup",
25
+ "build": "npm run build:server && npm run build:web",
26
+ "build:server": "tsup",
27
+ "build:web": "cd web && vite build",
26
28
  "dev": "tsx src/index.tsx",
29
+ "dev:web": "cd web && vite",
27
30
  "start": "node bin/agentwatch.js",
28
31
  "typecheck": "tsc --noEmit",
29
32
  "test": "vitest run",
@@ -44,6 +47,7 @@
44
47
  ],
45
48
  "license": "MIT",
46
49
  "dependencies": {
50
+ "@fastify/static": "^9.1.1",
47
51
  "@huggingface/transformers": "^4.1.0",
48
52
  "@modelcontextprotocol/sdk": "^1.29.0",
49
53
  "@opentelemetry/api": "^1.9.1",
@@ -54,19 +58,38 @@
54
58
  "better-sqlite3": "^12.9.0",
55
59
  "chokidar": "^4.0.3",
56
60
  "cli-highlight": "^2.1.11",
61
+ "fastify": "^5.8.5",
57
62
  "gpt-tokenizer": "^3.4.0",
58
63
  "ink": "^5.1.0",
59
64
  "react": "^18.3.1",
60
65
  "zod": "^4.3.6"
61
66
  },
62
67
  "devDependencies": {
68
+ "@tanstack/react-query": "^5.99.0",
69
+ "@tanstack/react-router": "^1.168.22",
63
70
  "@types/better-sqlite3": "^7.6.13",
71
+ "@types/d3-hierarchy": "^3.1.7",
64
72
  "@types/node": "^22.10.2",
65
73
  "@types/react": "^18.3.18",
74
+ "@types/react-dom": "^18.3.7",
75
+ "@vitejs/plugin-react": "^6.0.1",
76
+ "autoprefixer": "^10.5.0",
77
+ "clsx": "^2.1.1",
78
+ "d3-hierarchy": "^3.1.2",
79
+ "lucide-react": "^1.8.0",
80
+ "postcss": "^8.5.10",
81
+ "react-diff-viewer-continued": "^4.2.0",
82
+ "react-dom": "^18.3.1",
83
+ "react-is": "^19.2.5",
84
+ "react-router-dom": "^6.30.3",
85
+ "recharts": "^3.8.1",
86
+ "tailwindcss": "^3.4.19",
66
87
  "tsup": "^8.3.5",
67
88
  "tsx": "^4.19.2",
68
89
  "typescript": "^5.7.2",
69
- "vitest": "^2.1.8"
90
+ "vite": "^8.0.8",
91
+ "vitest": "^2.1.8",
92
+ "zustand": "^5.0.12"
70
93
  },
71
94
  "engines": {
72
95
  "node": ">=20"