clawatch 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/backend/dist/index.js +7 -1
  2. package/backend/dist/index.js.map +1 -1
  3. package/backend/dist/routes.d.ts.map +1 -1
  4. package/backend/dist/routes.js +3 -17
  5. package/backend/dist/routes.js.map +1 -1
  6. package/backend/dist/sessions.d.ts +1 -0
  7. package/backend/dist/sessions.d.ts.map +1 -1
  8. package/backend/dist/sessions.js +1 -0
  9. package/backend/dist/sessions.js.map +1 -1
  10. package/backend/dist/sync.d.ts +6 -0
  11. package/backend/dist/sync.d.ts.map +1 -0
  12. package/backend/dist/sync.js +202 -0
  13. package/backend/dist/sync.js.map +1 -0
  14. package/frontend/.next/BUILD_ID +1 -1
  15. package/frontend/.next/build-manifest.json +2 -2
  16. package/frontend/.next/server/app/_global-error.html +2 -2
  17. package/frontend/.next/server/app/_global-error.rsc +1 -1
  18. package/frontend/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  19. package/frontend/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  20. package/frontend/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  21. package/frontend/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  22. package/frontend/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  23. package/frontend/.next/server/app/_not-found.html +1 -1
  24. package/frontend/.next/server/app/_not-found.rsc +1 -1
  25. package/frontend/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  26. package/frontend/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  27. package/frontend/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  28. package/frontend/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  29. package/frontend/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  30. package/frontend/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  31. package/frontend/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  32. package/frontend/.next/server/app/dashboard/projects/[id]/page_client-reference-manifest.js +1 -1
  33. package/frontend/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
  34. package/frontend/.next/server/app/dashboard.html +1 -1
  35. package/frontend/.next/server/app/dashboard.rsc +2 -2
  36. package/frontend/.next/server/app/dashboard.segments/_full.segment.rsc +2 -2
  37. package/frontend/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  38. package/frontend/.next/server/app/dashboard.segments/_index.segment.rsc +1 -1
  39. package/frontend/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  40. package/frontend/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
  41. package/frontend/.next/server/app/dashboard.segments/dashboard.segment.rsc +1 -1
  42. package/frontend/.next/server/app/index.html +1 -1
  43. package/frontend/.next/server/app/index.rsc +1 -1
  44. package/frontend/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  45. package/frontend/.next/server/app/index.segments/_full.segment.rsc +1 -1
  46. package/frontend/.next/server/app/index.segments/_head.segment.rsc +1 -1
  47. package/frontend/.next/server/app/index.segments/_index.segment.rsc +1 -1
  48. package/frontend/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  49. package/frontend/.next/server/chunks/ssr/_b0ae6d33._.js +1 -1
  50. package/frontend/.next/server/pages/404.html +1 -1
  51. package/frontend/.next/server/pages/500.html +2 -2
  52. package/frontend/.next/static/chunks/{24358fa7364884a3.js → 520be2943f8ae266.js} +1 -1
  53. package/frontend/.next/static/chunks/{66068ea9541dcab8.js → 58873fd2347d1c88.js} +1 -1
  54. package/frontend/.next/static/chunks/{5ba7a3bbfd63a2aa.js → a308a3cc32b8bc4a.js} +1 -1
  55. package/package.json +1 -1
  56. /package/frontend/.next/static/{bxWfc5kRwipI2ZEeJ_T4v → P4g0K_y2ksljZD88vEDAA}/_buildManifest.js +0 -0
  57. /package/frontend/.next/static/{bxWfc5kRwipI2ZEeJ_T4v → P4g0K_y2ksljZD88vEDAA}/_clientMiddlewareManifest.json +0 -0
  58. /package/frontend/.next/static/{bxWfc5kRwipI2ZEeJ_T4v → P4g0K_y2ksljZD88vEDAA}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  module.exports=[57997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={UnrecognizedActionError:function(){return f},unstable_isUnrecognizedActionError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});class f extends Error{constructor(...a){super(...a),this.name="UnrecognizedActionError"}}function g(a){return!!(a&&"object"==typeof a&&a instanceof f)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},75718,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReadonlyURLSearchParams",{enumerable:!0,get:function(){return e}});class d extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class e extends URLSearchParams{append(){throw new d}delete(){throw new d}set(){throw new d}sort(){throw new d}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},15128,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"RedirectStatusCode",{enumerable:!0,get:function(){return e}});var d,e=((d={})[d.SeeOther=303]="SeeOther",d[d.TemporaryRedirect=307]="TemporaryRedirect",d[d.PermanentRedirect=308]="PermanentRedirect",d);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},11026,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e={REDIRECT_ERROR_CODE:function(){return h},RedirectType:function(){return i},isRedirectError:function(){return j}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});let g=a.r(15128),h="NEXT_REDIRECT";var i=((d={}).push="push",d.replace="replace",d);function j(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let b=a.digest.split(";"),[c,d]=b,e=b.slice(2,-2).join(";"),f=Number(b.at(-2));return c===h&&("replace"===d||"push"===d)&&"string"==typeof e&&!isNaN(f)&&f in g.RedirectStatusCode}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},22099,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={getRedirectError:function(){return i},getRedirectStatusCodeFromError:function(){return n},getRedirectTypeFromError:function(){return m},getURLFromRedirectError:function(){return l},permanentRedirect:function(){return k},redirect:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(15128),g=a.r(11026),h=a.r(20635).actionAsyncStorage;function i(a,b,c=f.RedirectStatusCode.TemporaryRedirect){let d=Object.defineProperty(Error(g.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return d.digest=`${g.REDIRECT_ERROR_CODE};${b};${a};${c};`,d}function j(a,b){throw i(a,b??=h?.getStore()?.isAction?g.RedirectType.push:g.RedirectType.replace,f.RedirectStatusCode.TemporaryRedirect)}function k(a,b=g.RedirectType.replace){throw i(a,b,f.RedirectStatusCode.PermanentRedirect)}function l(a){return(0,g.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function m(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function n(a){if(!(0,g.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},8535,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HTTPAccessErrorStatus:function(){return f},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return h},getAccessFallbackErrorTypeByStatus:function(){return k},getAccessFallbackHTTPStatus:function(){return j},isHTTPAccessFallbackError:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},g=new Set(Object.values(f)),h="NEXT_HTTP_ERROR_FALLBACK";function i(a){if("object"!=typeof a||null===a||!("digest"in a)||"string"!=typeof a.digest)return!1;let[b,c]=a.digest.split(";");return b===h&&g.has(Number(c))}function j(a){return Number(a.digest.split(";")[1])}function k(a){switch(a){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},28102,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"notFound",{enumerable:!0,get:function(){return f}});let d=a.r(8535),e=`${d.HTTP_ERROR_FALLBACK_ERROR_CODE};404`;function f(){let a=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=e,a}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},64177,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"forbidden",{enumerable:!0,get:function(){return d}}),a.r(8535).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},88213,(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unauthorized",{enumerable:!0,get:function(){return d}}),a.r(8535).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},35710,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isHangingPromiseRejectionError:function(){return f},makeDevtoolsIOAwarePromise:function(){return l},makeHangingPromise:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===g}let g="HANGING_PROMISE_REJECTION";class h extends Error{constructor(a,b){super(`During prerendering, ${b} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${b} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${a}".`),this.route=a,this.expression=b,this.digest=g}}let i=new WeakMap;function j(a,b,c){if(a.aborted)return Promise.reject(new h(b,c));{let d=new Promise((d,e)=>{let f=e.bind(null,new h(b,c)),g=i.get(a);if(g)g.push(f);else{let b=[f];i.set(a,b),a.addEventListener("abort",()=>{for(let a=0;a<b.length;a++)b[a]()},{once:!0})}});return d.catch(k),d}}function k(){}function l(a,b,c){return b.stagedRendering?b.stagedRendering.delayUntilStage(c,void 0,a):new Promise(b=>{setTimeout(()=>{b(a)},0)})}},31101,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isPostpone",{enumerable:!0,get:function(){return e}});let d=Symbol.for("react.postpone");function e(a){return"object"==typeof a&&null!==a&&a.$$typeof===d}},41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},77747,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isNextRouterError",{enumerable:!0,get:function(){return f}});let d=a.r(8535),e=a.r(11026);function f(a){return(0,e.isRedirectError)(a)||(0,d.isHTTPAccessFallbackError)(a)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},3326,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DynamicServerError:function(){return g},isDynamicServerError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="DYNAMIC_SERVER_USAGE";class g extends Error{constructor(a){super(`Dynamic server usage: ${a}`),this.description=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&"string"==typeof a.digest&&a.digest===f}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},99392,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={StaticGenBailoutError:function(){return g},isStaticGenBailoutError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="NEXT_STATIC_GEN_BAILOUT";class g extends Error{constructor(...a){super(...a),this.code=f}}function h(a){return"object"==typeof a&&null!==a&&"code"in a&&a.code===f}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},83590,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={METADATA_BOUNDARY_NAME:function(){return f},OUTLET_BOUNDARY_NAME:function(){return h},ROOT_LAYOUT_BOUNDARY_NAME:function(){return i},VIEWPORT_BOUNDARY_NAME:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="__next_metadata_boundary__",g="__next_viewport_boundary__",h="__next_outlet_boundary__",i="__next_root_layout_boundary__"},76383,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={atLeastOneTask:function(){return h},scheduleImmediate:function(){return g},scheduleOnNextTick:function(){return f},waitAtLeastOneReactRenderTask:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a=>{Promise.resolve().then(()=>{process.nextTick(a)})},g=a=>{setImmediate(a)};function h(){return new Promise(a=>g(a))}function i(){return new Promise(a=>setImmediate(a))}},88644,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},54110,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={Postpone:function(){return B},PreludeState:function(){return $},abortAndThrowOnSynchronousRequestDataAccess:function(){return A},abortOnSynchronousPlatformIOAccess:function(){return z},accessedDynamicData:function(){return J},annotateDynamicAccess:function(){return O},consumeDynamicAccess:function(){return K},createDynamicTrackingState:function(){return s},createDynamicValidationState:function(){return t},createHangingInputAbortSignal:function(){return N},createRenderInBrowserAbortSignal:function(){return M},delayUntilRuntimeStage:function(){return ac},formatDynamicAPIAccesses:function(){return L},getFirstDynamicReason:function(){return u},getStaticShellDisallowedDynamicReasons:function(){return ab},isDynamicPostpone:function(){return E},isPrerenderInterruptedError:function(){return I},logDisallowedDynamicError:function(){return _},markCurrentScopeAsDynamic:function(){return v},postponeWithTracking:function(){return C},throwIfDisallowedDynamic:function(){return aa},throwToInterruptStaticGeneration:function(){return w},trackAllowedDynamicAccess:function(){return W},trackDynamicDataInDynamicRender:function(){return x},trackDynamicHoleInRuntimeShell:function(){return X},trackDynamicHoleInStaticShell:function(){return Y},useDynamicRouteParams:function(){return P},useDynamicSearchParams:function(){return Q}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h=(d=a.r(72131))&&d.__esModule?d:{default:d},i=a.r(3326),j=a.r(99392),k=a.r(32319),l=a.r(56704),m=a.r(35710),n=a.r(83590),o=a.r(76383),p=a.r(41997),q=a.r(88644),r="function"==typeof h.default.unstable_postpone;function s(a){return{isDebugDynamicAccesses:a,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function t(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,dynamicMetadata:null,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function u(a){var b;return null==(b=a.dynamicAccesses[0])?void 0:b.expression}function v(a,b,c){if(b)switch(b.type){case"cache":case"unstable-cache":case"private-cache":return}if(!a.forceDynamic&&!a.forceStatic){if(a.dynamicShouldError)throw Object.defineProperty(new j.StaticGenBailoutError(`Route ${a.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${c}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(b)switch(b.type){case"prerender-ppr":return C(a.route,c,b.dynamicTracking);case"prerender-legacy":b.revalidate=0;let d=Object.defineProperty(new i.DynamicServerError(`Route ${a.route} couldn't be rendered statically because it used ${c}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw a.dynamicUsageDescription=c,a.dynamicUsageStack=d.stack,d}}}function w(a,b,c){let d=Object.defineProperty(new i.DynamicServerError(`Route ${b.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.revalidate=0,b.dynamicUsageDescription=a,b.dynamicUsageStack=d.stack,d}function x(a){switch(a.type){case"cache":case"unstable-cache":case"private-cache":return}}function y(a,b,c){let d=H(`Route ${a} needs to bail out of prerendering at this point because it used ${b}.`);c.controller.abort(d);let e=c.dynamicTracking;e&&e.dynamicAccesses.push({stack:e.isDebugDynamicAccesses?Error().stack:void 0,expression:b})}function z(a,b,c,d){let e=d.dynamicTracking;y(a,b,d),e&&null===e.syncDynamicErrorWithStack&&(e.syncDynamicErrorWithStack=c)}function A(a,b,c,d){if(!1===d.controller.signal.aborted){y(a,b,d);let e=d.dynamicTracking;e&&null===e.syncDynamicErrorWithStack&&(e.syncDynamicErrorWithStack=c)}throw H(`Route ${a} needs to bail out of prerendering at this point because it used ${b}.`)}function B({reason:a,route:b}){let c=k.workUnitAsyncStorage.getStore();C(b,a,c&&"prerender-ppr"===c.type?c.dynamicTracking:null)}function C(a,b,c){(function(){if(!r)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),c&&c.dynamicAccesses.push({stack:c.isDebugDynamicAccesses?Error().stack:void 0,expression:b}),h.default.unstable_postpone(D(a,b))}function D(a,b){return`Route ${a} needs to bail out of prerendering at this point because it used ${b}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function E(a){return"object"==typeof a&&null!==a&&"string"==typeof a.message&&F(a.message)}function F(a){return a.includes("needs to bail out of prerendering at this point because it used")&&a.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===F(D("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let G="NEXT_PRERENDER_INTERRUPTED";function H(a){let b=Object.defineProperty(Error(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return b.digest=G,b}function I(a){return"object"==typeof a&&null!==a&&a.digest===G&&"name"in a&&"message"in a&&a instanceof Error}function J(a){return a.length>0}function K(a,b){return a.dynamicAccesses.push(...b.dynamicAccesses),a.dynamicAccesses}function L(a){return a.filter(a=>"string"==typeof a.stack&&a.stack.length>0).map(({expression:a,stack:b})=>(b=b.split("\n").slice(4).filter(a=>!(a.includes("node_modules/next/")||a.includes(" (<anonymous>)")||a.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${a}:
2
2
  ${b}`))}function M(){let a=new AbortController;return a.abort(Object.defineProperty(new p.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),a.signal}function N(a){switch(a.type){case"prerender":case"prerender-runtime":let b=new AbortController;if(a.cacheSignal)a.cacheSignal.inputReady().then(()=>{b.abort()});else{let c=(0,k.getRuntimeStagePromise)(a);c?c.then(()=>(0,o.scheduleOnNextTick)(()=>b.abort())):(0,o.scheduleOnNextTick)(()=>b.abort())}return b.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function O(a,b){let c=b.dynamicTracking;c&&c.dynamicAccesses.push({stack:c.isDebugDynamicAccesses?Error().stack:void 0,expression:a})}function P(a){let b=l.workAsyncStorage.getStore(),c=k.workUnitAsyncStorage.getStore();if(b&&c)switch(c.type){case"prerender-client":case"prerender":{let d=c.fallbackRouteParams;d&&d.size>0&&h.default.use((0,m.makeHangingPromise)(c.renderSignal,b.route,a));break}case"prerender-ppr":{let d=c.fallbackRouteParams;if(d&&d.size>0)return C(b.route,a,c.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called during a runtime prerender. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called inside a cache scope. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}function Q(a){let b=l.workAsyncStorage.getStore(),c=k.workUnitAsyncStorage.getStore();if(b)switch(!c&&(0,k.throwForMissingRequestStore)(a),c.type){case"prerender-client":h.default.use((0,m.makeHangingPromise)(c.renderSignal,b.route,a));break;case"prerender-legacy":case"prerender-ppr":if(b.forceStatic)return;throw Object.defineProperty(new p.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called from a Server Component. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E795",enumerable:!1,configurable:!0});case"cache":case"unstable-cache":case"private-cache":throw Object.defineProperty(new q.InvariantError(`\`${a}\` was called inside a cache scope. Next.js should be preventing ${a} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0});case"request":return}}let R=/\n\s+at Suspense \(<anonymous>\)/,S=RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${n.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),T=RegExp(`\\n\\s+at ${n.METADATA_BOUNDARY_NAME}[\\n\\s]`),U=RegExp(`\\n\\s+at ${n.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),V=RegExp(`\\n\\s+at ${n.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function W(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.hasDynamicMetadata=!0;return}if(U.test(b)){c.hasDynamicViewport=!0;return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function X(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.dynamicMetadata=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed inside \`generateMetadata\`. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,b);return}if(U.test(b)){let d=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,b);c.dynamicErrors.push(d);return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function Y(a,b,c,d){if(!V.test(b)){if(T.test(b)){c.dynamicMetadata=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`,b);return}if(U.test(b)){let d=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`,b);c.dynamicErrors.push(d);return}if(S.test(b)){c.hasAllowedDynamic=!0,c.hasSuspenseAboveBody=!0;return}else if(R.test(b)){c.hasAllowedDynamic=!0;return}else{if(d.syncDynamicErrorWithStack)return void c.dynamicErrors.push(d.syncDynamicErrorWithStack);let e=Z(`Route "${a.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`,b);return void c.dynamicErrors.push(e)}}}function Z(a,b){let c=Object.defineProperty(Error(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return c.stack=c.name+": "+a+b,c}var $=((e={})[e.Full=0]="Full",e[e.Empty=1]="Empty",e[e.Errored=2]="Errored",e);function _(a,b){console.error(b),a.dev||(a.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${a.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
3
3
  - Start the app in development mode by running \`next dev\`, then open "${a.route}" in your browser to investigate the error.
4
- - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function aa(a,b,c,d){if(d.syncDynamicErrorWithStack)throw _(a,d.syncDynamicErrorWithStack),new j.StaticGenBailoutError;if(0!==b){if(c.hasSuspenseAboveBody)return;let d=c.dynamicErrors;if(d.length>0){for(let b=0;b<d.length;b++)_(a,d[b]);throw new j.StaticGenBailoutError}if(c.hasDynamicViewport)throw console.error(`Route "${a.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new j.StaticGenBailoutError;if(1===b)throw console.error(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new j.StaticGenBailoutError}else if(!1===c.hasAllowedDynamic&&c.hasDynamicMetadata)throw console.error(`Route "${a.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new j.StaticGenBailoutError}function ab(a,b,c){if(c.hasSuspenseAboveBody)return[];if(0!==b){let d=c.dynamicErrors;if(d.length>0)return d;if(1===b)return[Object.defineProperty(new q.InvariantError(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(!1===c.hasAllowedDynamic&&0===c.dynamicErrors.length&&c.dynamicMetadata)return[c.dynamicMetadata];return[]}function ac(a,b){return a.runtimeStagePromise?a.runtimeStagePromise.then(()=>b):b}},44753,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=a.r(35710),e=a.r(31101),f=a.r(41997),g=a.r(77747),h=a.r(54110),i=a.r(3326);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},47083,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=a.r(44753).unstable_rethrow;("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},21066,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return h.RedirectType},forbidden:function(){return j.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return k.unauthorized},unstable_isUnrecognizedActionError:function(){return m},unstable_rethrow:function(){return l.unstable_rethrow}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(75718),g=a.r(22099),h=a.r(11026),i=a.r(28102),j=a.r(64177),k=a.r(88213),l=a.r(47083);function m(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},74137,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return h.ReadonlyURLSearchParams},RedirectType:function(){return l.RedirectType},ServerInsertedHTMLContext:function(){return j.ServerInsertedHTMLContext},forbidden:function(){return l.forbidden},notFound:function(){return l.notFound},permanentRedirect:function(){return l.permanentRedirect},redirect:function(){return l.redirect},unauthorized:function(){return l.unauthorized},unstable_isUnrecognizedActionError:function(){return k.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return l.unstable_rethrow},useParams:function(){return r},usePathname:function(){return p},useRouter:function(){return q},useSearchParams:function(){return o},useSelectedLayoutSegment:function(){return t},useSelectedLayoutSegments:function(){return s},useServerInsertedHTML:function(){return j.useServerInsertedHTML}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(9270),h=a.r(36313),i=a.r(39118),j=a.r(18341),k=a.r(57997),l=a.r(21066),m=a.r(54110).useDynamicRouteParams,n=a.r(54110).useDynamicSearchParams;function o(){n?.("useSearchParams()");let a=(0,f.useContext)(h.SearchParamsContext);return(0,f.useMemo)(()=>a?new h.ReadonlyURLSearchParams(a):null,[a])}function p(){return m?.("usePathname()"),(0,f.useContext)(h.PathnameContext)}function q(){let a=(0,f.useContext)(g.AppRouterContext);if(null===a)throw Object.defineProperty(Error("invariant expected app router to be mounted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return a}function r(){return m?.("useParams()"),(0,f.useContext)(h.PathParamsContext)}function s(a="children"){m?.("useSelectedLayoutSegments()");let b=(0,f.useContext)(g.LayoutRouterContext);return b?(0,i.getSelectedLayoutSegmentPath)(b.parentTree,a):null}function t(a="children"){m?.("useSelectedLayoutSegment()"),(0,f.useContext)(h.NavigationPromisesContext);let b=s(a);return(0,i.computeSelectedLayoutSegment)(b,a)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},50944,(a,b,c)=>{b.exports=a.r(74137)},91119,86304,19032,a=>{"use strict";let b,c,d;var e,f=a.i(87924),g=a.i(68114);function h({className:a,size:b="default",...c}){return(0,f.jsx)("div",{"data-slot":"card","data-size":b,className:(0,g.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...c})}function i({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-header",className:(0,g.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",a),...b})}function j({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-title",className:(0,g.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",a),...b})}function k({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-content",className:(0,g.cn)("px-4 group-data-[size=sm]/card:px-3",a),...b})}a.s(["Card",()=>h,"CardContent",()=>k,"CardHeader",()=>i,"CardTitle",()=>j],91119);var l=a.i(84991),m=a.i(2840);let n=(0,a.i(187).cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function o({className:a,variant:b="default",render:c,...d}){var e;return e={defaultTagName:"span",props:(0,l.mergeProps)({className:(0,g.cn)(n({variant:b}),a)},d),render:c,state:{slot:"badge",variant:b}},(0,m.useRenderElement)(e.defaultTagName??"div",e,e)}a.s(["Badge",()=>o],86304);let p=new Date,q=a=>new Date(p.getTime()-6e4*a).toISOString(),r=a=>new Date(p.getTime()-36e5*a).toISOString(),s=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:q(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:q(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:q(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:q(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:r(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:q(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:r(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:q(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],t=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:q(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:q(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:r(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:q(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:r(3),acknowledged:!0}],u={totalUsd:39.65,byAgent:s.map(a=>({agentId:a.id,name:a.name,costUsd:a.costUsd})),byModel:[{model:"claude-sonnet-4-20250514",costUsd:22.1},{model:"claude-haiku-4-20250506",costUsd:11.35},{model:"gpt-4o",costUsd:6.2}]},v=[{id:"session-1",agentId:"ofek",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:q(45),lastActivityAt:q(1),duration:2640},{id:"session-2",agentId:"anas",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:r(3),lastActivityAt:r(2),duration:3600},{id:"session-3",agentId:"dor",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:q(90),lastActivityAt:q(12),duration:4680},{id:"session-4",agentId:"ofek",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:r(1.5),lastActivityAt:q(.5),duration:5400},{id:"session-5",agentId:"anas",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:r(5),lastActivityAt:r(4),duration:3600},{id:"session-6",agentId:"dor",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:q(30),lastActivityAt:q(8),duration:1320},{id:"session-7",agentId:"ofek",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:r(8),lastActivityAt:r(7),duration:3600},{id:"session-8",agentId:"anas",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:q(15),lastActivityAt:q(2),duration:780},{id:"session-9",agentId:"dor",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:r(12),lastActivityAt:r(10),duration:7200},{id:"session-10",agentId:"ofek",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:q(60),lastActivityAt:q(20),duration:2400}],w=[{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",createdAt:r(48),updatedAt:q(5),sessionCount:3,totalCostUsd:185.98},{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",createdAt:r(24),updatedAt:q(30),sessionCount:2,totalCostUsd:12.5}],x=(b=[],c=0,(d=(a,d,e,f,g,h)=>{c++,b.push({sessionId:a,agentId:d,id:`tl-${c}`,role:e,timestamp:q(f),content:g,...h})})("session-1","ofek","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),d("session-1","ofek","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),d("session-3","dor","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),d("session-1","ofek","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),d("session-3","dor","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),d("session-1","ofek","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),d("session-8","anas","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),d("session-1","ofek","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),d("session-8","anas","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-3","dor","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),d("session-3","dor","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-1","ofek","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),d("session-8","anas","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),d("session-1","ofek","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),d("session-8","anas","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),d("session-1","ofek","system",103,"Context window: 45% utilized (90K/200K tokens)"),d("session-8","anas","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),d("session-1","ofek","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),d("session-3","dor","user",98,"Can you also review the API layer and check for error handling gaps?"),d("session-1","ofek","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),d("session-8","anas","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-3","dor","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),d("session-8","anas","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),d("session-1","ofek","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),d("session-1","ofek","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),d("session-3","dor","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),d("session-1","ofek","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),d("session-1","ofek","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),d("session-1","ofek","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),d("session-8","anas","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-1","ofek","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),d("session-1","ofek","system",68,"Context window: 72% utilized (144K/200K tokens)"),d("session-1","ofek","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),d("session-1","ofek","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),b.sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime())),y={"project-1":{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",stats:{totalCostUsd:185.98,totalTokens:482e4,totalMessages:128,sessionCount:3,dateRange:{from:r(48),to:q(5)}},agentBreakdown:[{agentId:"ofek",costUsd:142.5,tokenCount:32e5,messageCount:78,percentage:76.6},{agentId:"dor",costUsd:28.48,tokenCount:98e4,messageCount:32,percentage:15.3},{agentId:"anas",costUsd:15,tokenCount:64e4,messageCount:18,percentage:8.1}],sessions:[v.find(a=>"session-1"===a.id),v.find(a=>"session-3"===a.id),v.find(a=>"session-8"===a.id)],timeline:x},"project-2":{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",stats:{totalCostUsd:12.5,totalTokens:112e4,totalMessages:60,sessionCount:2,dateRange:{from:r(24),to:q(30)}},agentBreakdown:[{agentId:"anas",costUsd:7.8,tokenCount:68e4,messageCount:38,percentage:62.4},{agentId:"dor",costUsd:4.7,tokenCount:44e4,messageCount:22,percentage:37.6}],sessions:[v.find(a=>"session-2"===a.id),v.find(a=>"session-6"===a.id)],timeline:[{sessionId:"session-2",agentId:"anas",id:"tl-b1",role:"user",timestamp:r(3),content:"Fix the authentication bug in the user login flow. Users are getting 401 errors after token refresh."},{sessionId:"session-2",agentId:"anas",id:"tl-b2",role:"assistant",timestamp:r(2.9),content:"I'll investigate the auth flow. Let me check the token refresh logic.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b3",role:"user",timestamp:r(2.8),content:"Debug the failing CI pipeline. Jest tests are timing out on the session module."},{sessionId:"session-2",agentId:"anas",id:"tl-b4",role:"tool",timestamp:r(2.7),content:"Found: refreshToken() doesn't await the database write before returning new token",toolName:"read"},{sessionId:"session-6",agentId:"dor",id:"tl-b5",role:"assistant",timestamp:r(2.6),content:"Looking at the CI logs. The Jest timeout suggests an unresolved promise in the test setup.",model:"claude-haiku-4-20250506",costUsd:.01},{sessionId:"session-2",agentId:"anas",id:"tl-b6",role:"assistant",timestamp:r(2.5),content:"Found the bug: `refreshToken()` returns before the DB write completes. Adding await fixes the race condition.",model:"claude-sonnet-4-20250514",costUsd:.05},{sessionId:"session-6",agentId:"dor",id:"tl-b7",role:"tool",timestamp:r(2.4),content:"$ jest --verbose\nFAILED: session.test.ts > should persist session data\nTimeout: 5000ms exceeded",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b8",role:"assistant",timestamp:r(2.2),content:"The test is missing `afterAll` cleanup — the database connection stays open. Adding proper teardown.",model:"claude-haiku-4-20250506",costUsd:.02},{sessionId:"session-2",agentId:"anas",id:"tl-b9",role:"tool",timestamp:r(2.1),content:"$ npm test -- auth.test.ts\n\nTests: 8 passed, 8 total",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b10",role:"tool",timestamp:r(2),content:"$ jest session.test.ts --verbose\nPASSED: all 6 tests",toolName:"exec"},{sessionId:"session-2",agentId:"anas",id:"tl-b11",role:"assistant",timestamp:r(1.9),content:"Auth bug fixed and all tests passing. The root cause was a missing await in the token refresh handler.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b12",role:"assistant",timestamp:r(1.8),content:"CI pipeline fixed. Added proper test teardown and increased timeout for integration tests to 10s.",model:"claude-haiku-4-20250506",costUsd:.02}]}},z={};for(let a of v)z[a.id]={...a,costByModel:a.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*a.costUsd,tokenCount:Math.floor(.75*a.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*a.costUsd,tokenCount:Math.floor(.25*a.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*a.costUsd,tokenCount:Math.floor(.6*a.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*a.costUsd,tokenCount:Math.floor(.4*a.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*a.tokenCount),output:Math.floor(.3*a.tokenCount),cacheRead:Math.floor(.25*a.tokenCount),cacheWrite:Math.floor(.1*a.tokenCount)},messages:(e=a.id,[{id:`${e}-msg-1`,role:"user",timestamp:q(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${e}-msg-2`,role:"assistant",timestamp:q(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${e}-msg-3`,role:"tool",timestamp:q(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${e}-msg-4`,role:"assistant",timestamp:q(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${e}-msg-5`,role:"tool",timestamp:q(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${e}-msg-6`,role:"assistant",timestamp:q(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${e}-msg-7`,role:"tool",timestamp:q(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${e}-msg-8`,role:"tool",timestamp:q(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${e}-msg-9`,role:"assistant",timestamp:q(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${e}-msg-10`,role:"tool",timestamp:q(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${e}-msg-11`,role:"user",timestamp:q(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${e}-msg-12`,role:"assistant",timestamp:q(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${e}-msg-13`,role:"tool",timestamp:q(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${e}-msg-14`,role:"system",timestamp:q(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${e}-msg-15`,role:"assistant",timestamp:q(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${e}-msg-16`,role:"tool",timestamp:q(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${e}-msg-17`,role:"assistant",timestamp:q(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${e}-msg-18`,role:"tool",timestamp:q(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${e}-msg-19`,role:"assistant",timestamp:q(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${e}-msg-20`,role:"tool",timestamp:q(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let A=process.env.NEXT_PUBLIC_API_KEY||"";async function B(a,b){let c={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...A?{"X-ClaWatch-Key":A}:{},...b?.headers||{}},d=await fetch(`https://b43f-31-154-66-178.ngrok-free.app${a}`,{...b,headers:c});if(!d.ok)throw Error(`API error: ${d.status}`);return d.json()}async function C(a){try{let b=a?`?status=${a}`:"";return(await B(`/api/agents${b}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),s}}async function D(){try{return(await B("/api/alerts")).alerts}catch{return console.warn("API unreachable, falling back to mock data"),t}}async function E(){try{return await B("/api/costs")}catch{return console.warn("API unreachable, falling back to mock data"),u}}async function F(a){await B(`/api/agents/${a}/pause`,{method:"POST"})}async function G(a){await B(`/api/agents/${a}/resume`,{method:"POST"})}async function H(a){await B(`/api/alerts/${a}/acknowledge`,{method:"POST"})}async function I(a,b,c){try{let d=new URLSearchParams;a&&d.set("agentId",a),b&&d.set("status",b),c&&d.set("sort",c);let e=d.toString();return(await B(`/api/sessions${e?`?${e}`:""}`)).sessions}catch{return console.warn("API unreachable, falling back to mock data"),v}}async function J(a){try{return await B(`/api/sessions/${a}`)}catch{console.warn("API unreachable, falling back to mock data");let b=z[a];if(b)return b;throw Error("Session not found")}}async function K(){try{return(await B("/api/projects")).projects}catch{return console.warn("API unreachable, falling back to mock data"),w}}async function L(a){try{return await B(`/api/projects/${a}`)}catch{console.warn("API unreachable, falling back to mock data");let b=y[a];if(b)return b;throw Error("Project not found")}}async function M(a,b){return await B("/api/projects",{method:"POST",body:JSON.stringify({name:a,description:b})})}a.s(["acknowledgeAlert",()=>H,"createProject",()=>M,"getAgents",()=>C,"getAlerts",()=>D,"getCosts",()=>E,"getProject",()=>L,"getProjects",()=>K,"getSession",()=>J,"getSessions",()=>I,"pauseAgent",()=>F,"resumeAgent",()=>G],19032)}];
4
+ - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function aa(a,b,c,d){if(d.syncDynamicErrorWithStack)throw _(a,d.syncDynamicErrorWithStack),new j.StaticGenBailoutError;if(0!==b){if(c.hasSuspenseAboveBody)return;let d=c.dynamicErrors;if(d.length>0){for(let b=0;b<d.length;b++)_(a,d[b]);throw new j.StaticGenBailoutError}if(c.hasDynamicViewport)throw console.error(`Route "${a.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new j.StaticGenBailoutError;if(1===b)throw console.error(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new j.StaticGenBailoutError}else if(!1===c.hasAllowedDynamic&&c.hasDynamicMetadata)throw console.error(`Route "${a.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new j.StaticGenBailoutError}function ab(a,b,c){if(c.hasSuspenseAboveBody)return[];if(0!==b){let d=c.dynamicErrors;if(d.length>0)return d;if(1===b)return[Object.defineProperty(new q.InvariantError(`Route "${a.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(!1===c.hasAllowedDynamic&&0===c.dynamicErrors.length&&c.dynamicMetadata)return[c.dynamicMetadata];return[]}function ac(a,b){return a.runtimeStagePromise?a.runtimeStagePromise.then(()=>b):b}},44753,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b)||(0,h.isPrerenderInterruptedError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=a.r(35710),e=a.r(31101),f=a.r(41997),g=a.r(77747),h=a.r(54110),i=a.r(3326);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},47083,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=a.r(44753).unstable_rethrow;("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},21066,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return f.ReadonlyURLSearchParams},RedirectType:function(){return h.RedirectType},forbidden:function(){return j.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return g.permanentRedirect},redirect:function(){return g.redirect},unauthorized:function(){return k.unauthorized},unstable_isUnrecognizedActionError:function(){return m},unstable_rethrow:function(){return l.unstable_rethrow}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(75718),g=a.r(22099),h=a.r(11026),i=a.r(28102),j=a.r(64177),k=a.r(88213),l=a.r(47083);function m(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},74137,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ReadonlyURLSearchParams:function(){return h.ReadonlyURLSearchParams},RedirectType:function(){return l.RedirectType},ServerInsertedHTMLContext:function(){return j.ServerInsertedHTMLContext},forbidden:function(){return l.forbidden},notFound:function(){return l.notFound},permanentRedirect:function(){return l.permanentRedirect},redirect:function(){return l.redirect},unauthorized:function(){return l.unauthorized},unstable_isUnrecognizedActionError:function(){return k.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return l.unstable_rethrow},useParams:function(){return r},usePathname:function(){return p},useRouter:function(){return q},useSearchParams:function(){return o},useSelectedLayoutSegment:function(){return t},useSelectedLayoutSegments:function(){return s},useServerInsertedHTML:function(){return j.useServerInsertedHTML}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(9270),h=a.r(36313),i=a.r(39118),j=a.r(18341),k=a.r(57997),l=a.r(21066),m=a.r(54110).useDynamicRouteParams,n=a.r(54110).useDynamicSearchParams;function o(){n?.("useSearchParams()");let a=(0,f.useContext)(h.SearchParamsContext);return(0,f.useMemo)(()=>a?new h.ReadonlyURLSearchParams(a):null,[a])}function p(){return m?.("usePathname()"),(0,f.useContext)(h.PathnameContext)}function q(){let a=(0,f.useContext)(g.AppRouterContext);if(null===a)throw Object.defineProperty(Error("invariant expected app router to be mounted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return a}function r(){return m?.("useParams()"),(0,f.useContext)(h.PathParamsContext)}function s(a="children"){m?.("useSelectedLayoutSegments()");let b=(0,f.useContext)(g.LayoutRouterContext);return b?(0,i.getSelectedLayoutSegmentPath)(b.parentTree,a):null}function t(a="children"){m?.("useSelectedLayoutSegment()"),(0,f.useContext)(h.NavigationPromisesContext);let b=s(a);return(0,i.computeSelectedLayoutSegment)(b,a)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},50944,(a,b,c)=>{b.exports=a.r(74137)},91119,86304,19032,a=>{"use strict";let b,c,d;var e,f=a.i(87924),g=a.i(68114);function h({className:a,size:b="default",...c}){return(0,f.jsx)("div",{"data-slot":"card","data-size":b,className:(0,g.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...c})}function i({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-header",className:(0,g.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",a),...b})}function j({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-title",className:(0,g.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",a),...b})}function k({className:a,...b}){return(0,f.jsx)("div",{"data-slot":"card-content",className:(0,g.cn)("px-4 group-data-[size=sm]/card:px-3",a),...b})}a.s(["Card",()=>h,"CardContent",()=>k,"CardHeader",()=>i,"CardTitle",()=>j],91119);var l=a.i(84991),m=a.i(2840);let n=(0,a.i(187).cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function o({className:a,variant:b="default",render:c,...d}){var e;return e={defaultTagName:"span",props:(0,l.mergeProps)({className:(0,g.cn)(n({variant:b}),a)},d),render:c,state:{slot:"badge",variant:b}},(0,m.useRenderElement)(e.defaultTagName??"div",e,e)}a.s(["Badge",()=>o],86304);let p=new Date,q=a=>new Date(p.getTime()-6e4*a).toISOString(),r=a=>new Date(p.getTime()-36e5*a).toISOString(),s=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:q(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:q(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:q(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:q(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:r(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:q(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:r(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:q(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],t=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:q(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:q(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:r(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:q(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:r(3),acknowledged:!0}],u={totalUsd:39.65,byAgent:s.map(a=>({agentId:a.id,name:a.name,costUsd:a.costUsd})),byModel:[{model:"claude-sonnet-4-20250514",costUsd:22.1},{model:"claude-haiku-4-20250506",costUsd:11.35},{model:"gpt-4o",costUsd:6.2}]},v=[{id:"session-1",agentId:"ofek",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:q(45),lastActivityAt:q(1),duration:2640},{id:"session-2",agentId:"anas",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:r(3),lastActivityAt:r(2),duration:3600},{id:"session-3",agentId:"dor",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:q(90),lastActivityAt:q(12),duration:4680},{id:"session-4",agentId:"ofek",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:r(1.5),lastActivityAt:q(.5),duration:5400},{id:"session-5",agentId:"anas",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:r(5),lastActivityAt:r(4),duration:3600},{id:"session-6",agentId:"dor",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:q(30),lastActivityAt:q(8),duration:1320},{id:"session-7",agentId:"ofek",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:r(8),lastActivityAt:r(7),duration:3600},{id:"session-8",agentId:"anas",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:q(15),lastActivityAt:q(2),duration:780},{id:"session-9",agentId:"dor",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:r(12),lastActivityAt:r(10),duration:7200},{id:"session-10",agentId:"ofek",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:q(60),lastActivityAt:q(20),duration:2400}],w=[{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",createdAt:r(48),updatedAt:q(5),sessionCount:3,totalCostUsd:185.98},{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",createdAt:r(24),updatedAt:q(30),sessionCount:2,totalCostUsd:12.5}],x=(b=[],c=0,(d=(a,d,e,f,g,h)=>{c++,b.push({sessionId:a,agentId:d,id:`tl-${c}`,role:e,timestamp:q(f),content:g,...h})})("session-1","ofek","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),d("session-1","ofek","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),d("session-3","dor","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),d("session-1","ofek","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),d("session-3","dor","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),d("session-1","ofek","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),d("session-8","anas","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),d("session-1","ofek","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),d("session-8","anas","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-3","dor","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),d("session-3","dor","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-1","ofek","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),d("session-8","anas","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),d("session-1","ofek","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),d("session-8","anas","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),d("session-1","ofek","system",103,"Context window: 45% utilized (90K/200K tokens)"),d("session-8","anas","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),d("session-1","ofek","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),d("session-3","dor","user",98,"Can you also review the API layer and check for error handling gaps?"),d("session-1","ofek","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),d("session-8","anas","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-3","dor","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),d("session-8","anas","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),d("session-1","ofek","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),d("session-1","ofek","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),d("session-3","dor","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),d("session-1","ofek","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),d("session-1","ofek","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),d("session-1","ofek","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),d("session-8","anas","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),d("session-1","ofek","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),d("session-1","ofek","system",68,"Context window: 72% utilized (144K/200K tokens)"),d("session-1","ofek","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),d("session-1","ofek","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),b.sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime())),y={"project-1":{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",stats:{totalCostUsd:185.98,totalTokens:482e4,totalMessages:128,sessionCount:3,dateRange:{from:r(48),to:q(5)}},agentBreakdown:[{agentId:"ofek",costUsd:142.5,tokenCount:32e5,messageCount:78,percentage:76.6},{agentId:"dor",costUsd:28.48,tokenCount:98e4,messageCount:32,percentage:15.3},{agentId:"anas",costUsd:15,tokenCount:64e4,messageCount:18,percentage:8.1}],sessions:[v.find(a=>"session-1"===a.id),v.find(a=>"session-3"===a.id),v.find(a=>"session-8"===a.id)],timeline:x},"project-2":{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",stats:{totalCostUsd:12.5,totalTokens:112e4,totalMessages:60,sessionCount:2,dateRange:{from:r(24),to:q(30)}},agentBreakdown:[{agentId:"anas",costUsd:7.8,tokenCount:68e4,messageCount:38,percentage:62.4},{agentId:"dor",costUsd:4.7,tokenCount:44e4,messageCount:22,percentage:37.6}],sessions:[v.find(a=>"session-2"===a.id),v.find(a=>"session-6"===a.id)],timeline:[{sessionId:"session-2",agentId:"anas",id:"tl-b1",role:"user",timestamp:r(3),content:"Fix the authentication bug in the user login flow. Users are getting 401 errors after token refresh."},{sessionId:"session-2",agentId:"anas",id:"tl-b2",role:"assistant",timestamp:r(2.9),content:"I'll investigate the auth flow. Let me check the token refresh logic.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b3",role:"user",timestamp:r(2.8),content:"Debug the failing CI pipeline. Jest tests are timing out on the session module."},{sessionId:"session-2",agentId:"anas",id:"tl-b4",role:"tool",timestamp:r(2.7),content:"Found: refreshToken() doesn't await the database write before returning new token",toolName:"read"},{sessionId:"session-6",agentId:"dor",id:"tl-b5",role:"assistant",timestamp:r(2.6),content:"Looking at the CI logs. The Jest timeout suggests an unresolved promise in the test setup.",model:"claude-haiku-4-20250506",costUsd:.01},{sessionId:"session-2",agentId:"anas",id:"tl-b6",role:"assistant",timestamp:r(2.5),content:"Found the bug: `refreshToken()` returns before the DB write completes. Adding await fixes the race condition.",model:"claude-sonnet-4-20250514",costUsd:.05},{sessionId:"session-6",agentId:"dor",id:"tl-b7",role:"tool",timestamp:r(2.4),content:"$ jest --verbose\nFAILED: session.test.ts > should persist session data\nTimeout: 5000ms exceeded",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b8",role:"assistant",timestamp:r(2.2),content:"The test is missing `afterAll` cleanup — the database connection stays open. Adding proper teardown.",model:"claude-haiku-4-20250506",costUsd:.02},{sessionId:"session-2",agentId:"anas",id:"tl-b9",role:"tool",timestamp:r(2.1),content:"$ npm test -- auth.test.ts\n\nTests: 8 passed, 8 total",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b10",role:"tool",timestamp:r(2),content:"$ jest session.test.ts --verbose\nPASSED: all 6 tests",toolName:"exec"},{sessionId:"session-2",agentId:"anas",id:"tl-b11",role:"assistant",timestamp:r(1.9),content:"Auth bug fixed and all tests passing. The root cause was a missing await in the token refresh handler.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b12",role:"assistant",timestamp:r(1.8),content:"CI pipeline fixed. Added proper test teardown and increased timeout for integration tests to 10s.",model:"claude-haiku-4-20250506",costUsd:.02}]}},z={};for(let a of v)z[a.id]={...a,costByModel:a.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*a.costUsd,tokenCount:Math.floor(.75*a.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*a.costUsd,tokenCount:Math.floor(.25*a.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*a.costUsd,tokenCount:Math.floor(.6*a.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*a.costUsd,tokenCount:Math.floor(.4*a.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*a.tokenCount),output:Math.floor(.3*a.tokenCount),cacheRead:Math.floor(.25*a.tokenCount),cacheWrite:Math.floor(.1*a.tokenCount)},messages:(e=a.id,[{id:`${e}-msg-1`,role:"user",timestamp:q(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${e}-msg-2`,role:"assistant",timestamp:q(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${e}-msg-3`,role:"tool",timestamp:q(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${e}-msg-4`,role:"assistant",timestamp:q(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${e}-msg-5`,role:"tool",timestamp:q(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${e}-msg-6`,role:"assistant",timestamp:q(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${e}-msg-7`,role:"tool",timestamp:q(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${e}-msg-8`,role:"tool",timestamp:q(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${e}-msg-9`,role:"assistant",timestamp:q(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${e}-msg-10`,role:"tool",timestamp:q(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${e}-msg-11`,role:"user",timestamp:q(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${e}-msg-12`,role:"assistant",timestamp:q(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${e}-msg-13`,role:"tool",timestamp:q(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${e}-msg-14`,role:"system",timestamp:q(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${e}-msg-15`,role:"assistant",timestamp:q(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${e}-msg-16`,role:"tool",timestamp:q(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${e}-msg-17`,role:"assistant",timestamp:q(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${e}-msg-18`,role:"tool",timestamp:q(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${e}-msg-19`,role:"assistant",timestamp:q(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${e}-msg-20`,role:"tool",timestamp:q(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let A=process.env.NEXT_PUBLIC_API_KEY||"";async function B(a,b){let c={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...A?{"X-ClaWatch-Key":A}:{},...b?.headers||{}},d=await fetch(`${a}`,{...b,headers:c});if(!d.ok)throw Error(`API error: ${d.status}`);return d.json()}async function C(a){try{let b=a?`?status=${a}`:"";return(await B(`/api/agents${b}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),s}}async function D(){try{return(await B("/api/alerts")).alerts}catch{return console.warn("API unreachable, falling back to mock data"),t}}async function E(){try{return await B("/api/costs")}catch{return console.warn("API unreachable, falling back to mock data"),u}}async function F(a){await B(`/api/agents/${a}/pause`,{method:"POST"})}async function G(a){await B(`/api/agents/${a}/resume`,{method:"POST"})}async function H(a){await B(`/api/alerts/${a}/acknowledge`,{method:"POST"})}async function I(a,b,c){try{let d=new URLSearchParams;a&&d.set("agentId",a),b&&d.set("status",b),c&&d.set("sort",c);let e=d.toString();return(await B(`/api/sessions${e?`?${e}`:""}`)).sessions}catch{return console.warn("API unreachable, falling back to mock data"),v}}async function J(a){try{return await B(`/api/sessions/${a}`)}catch{console.warn("API unreachable, falling back to mock data");let b=z[a];if(b)return b;throw Error("Session not found")}}async function K(){try{return(await B("/api/projects")).projects}catch{return console.warn("API unreachable, falling back to mock data"),w}}async function L(a){try{return await B(`/api/projects/${a}`)}catch{console.warn("API unreachable, falling back to mock data");let b=y[a];if(b)return b;throw Error("Project not found")}}async function M(a,b){return await B("/api/projects",{method:"POST",body:JSON.stringify({name:a,description:b})})}a.s(["acknowledgeAlert",()=>H,"createProject",()=>M,"getAgents",()=>C,"getAlerts",()=>D,"getCosts",()=>E,"getProject",()=>L,"getProjects",()=>K,"getSession",()=>J,"getSessions",()=>I,"pauseAgent",()=>F,"resumeAgent",()=>G],19032)}];
5
5
 
6
6
  //# sourceMappingURL=_b0ae6d33._.js.map
@@ -1 +1 @@
1
- <!DOCTYPE html><!--bxWfc5kRwipI2ZEeJ_T4v--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/2b7d8037bb74445e.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/d702a24e2b6c48fa.js" async=""></script><script src="/_next/static/chunks/turbopack-0df1acbb994b2a74.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>ClaWatch — AI Agent Observability</title><meta name="description" content="Never let your agents run wild. Open-source monitoring and alerting for AI agents."/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased" style="font-family:var(--font-inter), system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2b7d8037bb74445e.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bxWfc5kRwipI2ZEeJ_T4v\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2b7d8037bb74445e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased\",\"style\":{\"fontFamily\":\"var(--font-inter), system-ui, sans-serif\"},\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"title\",\"0\",{\"children\":\"ClaWatch — AI Agent Observability\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Never let your agents run wild. Open-source monitoring and alerting for AI agents.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"3\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--P4g0K_y2ksljZD88vEDAA--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/2b7d8037bb74445e.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/d702a24e2b6c48fa.js" async=""></script><script src="/_next/static/chunks/turbopack-0df1acbb994b2a74.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>ClaWatch — AI Agent Observability</title><meta name="description" content="Never let your agents run wild. Open-source monitoring and alerting for AI agents."/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased" style="font-family:var(--font-inter), system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2b7d8037bb74445e.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"P4g0K_y2ksljZD88vEDAA\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2b7d8037bb74445e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"inter_fe8b9d92-module__LINzvG__variable jetbrains_mono_7d65b77b-module__VxV-Ta__variable antialiased\",\"style\":{\"fontFamily\":\"var(--font-inter), system-ui, sans-serif\"},\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"title\",\"0\",{\"children\":\"ClaWatch — AI Agent Observability\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Never let your agents run wild. Open-source monitoring and alerting for AI agents.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"3\",{}]]\n"])</script></body></html>
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><!--bxWfc5kRwipI2ZEeJ_T4v--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/d702a24e2b6c48fa.js" async=""></script><script src="/_next/static/chunks/turbopack-0df1acbb994b2a74.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
- @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"bxWfc5kRwipI2ZEeJ_T4v\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--P4g0K_y2ksljZD88vEDAA--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/5bcee453cc4bce6d.js"/><script src="/_next/static/chunks/82abf2d65f5428ae.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/d702a24e2b6c48fa.js" async=""></script><script src="/_next/static/chunks/turbopack-0df1acbb994b2a74.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
+ @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/5bcee453cc4bce6d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"P4g0K_y2ksljZD88vEDAA\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},18566,(e,t,s)=>{t.exports=e.r(76562)},15288,87486,9165,e=>{"use strict";let t,s,a;var n,o=e.i(43476),r=e.i(75157);function i({className:e,size:t="default",...s}){return(0,o.jsx)("div",{"data-slot":"card","data-size":t,className:(0,r.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})}function d({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...t})}function l({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function c({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-4 group-data-[size=sm]/card:px-3",e),...t})}e.s(["Card",()=>i,"CardContent",()=>c,"CardHeader",()=>d,"CardTitle",()=>l],15288);var u=e.i(19805),m=e.i(27601);let g=(0,e.i(25913).cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function p({className:e,variant:t="default",render:s,...a}){var n;return n={defaultTagName:"span",props:(0,u.mergeProps)({className:(0,r.cn)(g({variant:t}),e)},a),render:s,state:{slot:"badge",variant:t}},(0,m.useRenderElement)(n.defaultTagName??"div",n,n)}e.s(["Badge",()=>p],87486);var h=e.i(47167);let b=new Date,x=e=>new Date(b.getTime()-6e4*e).toISOString(),f=e=>new Date(b.getTime()-36e5*e).toISOString(),k=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:x(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:x(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:x(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:x(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:f(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:x(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:f(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:x(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],v=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:x(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:x(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:f(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:x(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:f(3),acknowledged:!0}],w={totalUsd:39.65,byAgent:k.map(e=>({agentId:e.id,name:e.name,costUsd:e.costUsd})),byModel:[{model:"claude-sonnet-4-20250514",costUsd:22.1},{model:"claude-haiku-4-20250506",costUsd:11.35},{model:"gpt-4o",costUsd:6.2}]},j=[{id:"session-1",agentId:"ofek",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:x(45),lastActivityAt:x(1),duration:2640},{id:"session-2",agentId:"anas",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:f(3),lastActivityAt:f(2),duration:3600},{id:"session-3",agentId:"dor",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:x(90),lastActivityAt:x(12),duration:4680},{id:"session-4",agentId:"ofek",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:f(1.5),lastActivityAt:x(.5),duration:5400},{id:"session-5",agentId:"anas",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:f(5),lastActivityAt:f(4),duration:3600},{id:"session-6",agentId:"dor",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:x(30),lastActivityAt:x(8),duration:1320},{id:"session-7",agentId:"ofek",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:f(8),lastActivityAt:f(7),duration:3600},{id:"session-8",agentId:"anas",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:x(15),lastActivityAt:x(2),duration:780},{id:"session-9",agentId:"dor",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:f(12),lastActivityAt:f(10),duration:7200},{id:"session-10",agentId:"ofek",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:x(60),lastActivityAt:x(20),duration:2400}],y=[{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",createdAt:f(48),updatedAt:x(5),sessionCount:3,totalCostUsd:185.98},{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",createdAt:f(24),updatedAt:x(30),sessionCount:2,totalCostUsd:12.5}],C=(t=[],s=0,(a=(e,a,n,o,r,i)=>{s++,t.push({sessionId:e,agentId:a,id:`tl-${s}`,role:n,timestamp:x(o),content:r,...i})})("session-1","ofek","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),a("session-1","ofek","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),a("session-3","dor","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),a("session-1","ofek","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),a("session-3","dor","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),a("session-1","ofek","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),a("session-8","anas","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),a("session-1","ofek","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),a("session-8","anas","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-3","dor","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),a("session-3","dor","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-1","ofek","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),a("session-8","anas","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),a("session-1","ofek","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),a("session-8","anas","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),a("session-1","ofek","system",103,"Context window: 45% utilized (90K/200K tokens)"),a("session-8","anas","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),a("session-1","ofek","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),a("session-3","dor","user",98,"Can you also review the API layer and check for error handling gaps?"),a("session-1","ofek","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),a("session-8","anas","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-3","dor","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),a("session-8","anas","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),a("session-1","ofek","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),a("session-1","ofek","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),a("session-3","dor","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),a("session-1","ofek","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),a("session-1","ofek","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),a("session-1","ofek","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),a("session-8","anas","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-1","ofek","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),a("session-1","ofek","system",68,"Context window: 72% utilized (144K/200K tokens)"),a("session-1","ofek","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),a("session-1","ofek","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),t.sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime())),N={"project-1":{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",stats:{totalCostUsd:185.98,totalTokens:482e4,totalMessages:128,sessionCount:3,dateRange:{from:f(48),to:x(5)}},agentBreakdown:[{agentId:"ofek",costUsd:142.5,tokenCount:32e5,messageCount:78,percentage:76.6},{agentId:"dor",costUsd:28.48,tokenCount:98e4,messageCount:32,percentage:15.3},{agentId:"anas",costUsd:15,tokenCount:64e4,messageCount:18,percentage:8.1}],sessions:[j.find(e=>"session-1"===e.id),j.find(e=>"session-3"===e.id),j.find(e=>"session-8"===e.id)],timeline:C},"project-2":{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",stats:{totalCostUsd:12.5,totalTokens:112e4,totalMessages:60,sessionCount:2,dateRange:{from:f(24),to:x(30)}},agentBreakdown:[{agentId:"anas",costUsd:7.8,tokenCount:68e4,messageCount:38,percentage:62.4},{agentId:"dor",costUsd:4.7,tokenCount:44e4,messageCount:22,percentage:37.6}],sessions:[j.find(e=>"session-2"===e.id),j.find(e=>"session-6"===e.id)],timeline:[{sessionId:"session-2",agentId:"anas",id:"tl-b1",role:"user",timestamp:f(3),content:"Fix the authentication bug in the user login flow. Users are getting 401 errors after token refresh."},{sessionId:"session-2",agentId:"anas",id:"tl-b2",role:"assistant",timestamp:f(2.9),content:"I'll investigate the auth flow. Let me check the token refresh logic.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b3",role:"user",timestamp:f(2.8),content:"Debug the failing CI pipeline. Jest tests are timing out on the session module."},{sessionId:"session-2",agentId:"anas",id:"tl-b4",role:"tool",timestamp:f(2.7),content:"Found: refreshToken() doesn't await the database write before returning new token",toolName:"read"},{sessionId:"session-6",agentId:"dor",id:"tl-b5",role:"assistant",timestamp:f(2.6),content:"Looking at the CI logs. The Jest timeout suggests an unresolved promise in the test setup.",model:"claude-haiku-4-20250506",costUsd:.01},{sessionId:"session-2",agentId:"anas",id:"tl-b6",role:"assistant",timestamp:f(2.5),content:"Found the bug: `refreshToken()` returns before the DB write completes. Adding await fixes the race condition.",model:"claude-sonnet-4-20250514",costUsd:.05},{sessionId:"session-6",agentId:"dor",id:"tl-b7",role:"tool",timestamp:f(2.4),content:"$ jest --verbose\nFAILED: session.test.ts > should persist session data\nTimeout: 5000ms exceeded",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b8",role:"assistant",timestamp:f(2.2),content:"The test is missing `afterAll` cleanup — the database connection stays open. Adding proper teardown.",model:"claude-haiku-4-20250506",costUsd:.02},{sessionId:"session-2",agentId:"anas",id:"tl-b9",role:"tool",timestamp:f(2.1),content:"$ npm test -- auth.test.ts\n\nTests: 8 passed, 8 total",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b10",role:"tool",timestamp:f(2),content:"$ jest session.test.ts --verbose\nPASSED: all 6 tests",toolName:"exec"},{sessionId:"session-2",agentId:"anas",id:"tl-b11",role:"assistant",timestamp:f(1.9),content:"Auth bug fixed and all tests passing. The root cause was a missing await in the token refresh handler.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b12",role:"assistant",timestamp:f(1.8),content:"CI pipeline fixed. Added proper test teardown and increased timeout for integration tests to 10s.",model:"claude-haiku-4-20250506",costUsd:.02}]}},I={};for(let e of j)I[e.id]={...e,costByModel:e.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*e.costUsd,tokenCount:Math.floor(.75*e.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*e.costUsd,tokenCount:Math.floor(.25*e.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*e.costUsd,tokenCount:Math.floor(.6*e.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*e.costUsd,tokenCount:Math.floor(.4*e.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*e.tokenCount),output:Math.floor(.3*e.tokenCount),cacheRead:Math.floor(.25*e.tokenCount),cacheWrite:Math.floor(.1*e.tokenCount)},messages:(n=e.id,[{id:`${n}-msg-1`,role:"user",timestamp:x(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${n}-msg-2`,role:"assistant",timestamp:x(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${n}-msg-3`,role:"tool",timestamp:x(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${n}-msg-4`,role:"assistant",timestamp:x(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${n}-msg-5`,role:"tool",timestamp:x(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${n}-msg-6`,role:"assistant",timestamp:x(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${n}-msg-7`,role:"tool",timestamp:x(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${n}-msg-8`,role:"tool",timestamp:x(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${n}-msg-9`,role:"assistant",timestamp:x(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${n}-msg-10`,role:"tool",timestamp:x(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${n}-msg-11`,role:"user",timestamp:x(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${n}-msg-12`,role:"assistant",timestamp:x(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${n}-msg-13`,role:"tool",timestamp:x(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${n}-msg-14`,role:"system",timestamp:x(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${n}-msg-15`,role:"assistant",timestamp:x(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${n}-msg-16`,role:"tool",timestamp:x(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${n}-msg-17`,role:"assistant",timestamp:x(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${n}-msg-18`,role:"tool",timestamp:x(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${n}-msg-19`,role:"assistant",timestamp:x(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${n}-msg-20`,role:"tool",timestamp:x(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let A=h.default.env.NEXT_PUBLIC_API_KEY||"";async function U(e,t){let s={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...A?{"X-ClaWatch-Key":A}:{},...t?.headers||{}},a=await fetch(`https://b43f-31-154-66-178.ngrok-free.app${e}`,{...t,headers:s});if(!a.ok)throw Error(`API error: ${a.status}`);return a.json()}async function $(e){try{let t=e?`?status=${e}`:"";return(await U(`/api/agents${t}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),k}}async function S(){try{return(await U("/api/alerts")).alerts}catch{return console.warn("API unreachable, falling back to mock data"),v}}async function T(){try{return await U("/api/costs")}catch{return console.warn("API unreachable, falling back to mock data"),w}}async function B(e){await U(`/api/agents/${e}/pause`,{method:"POST"})}async function P(e){await U(`/api/agents/${e}/resume`,{method:"POST"})}async function z(e){await U(`/api/alerts/${e}/acknowledge`,{method:"POST"})}async function F(e,t,s){try{let a=new URLSearchParams;e&&a.set("agentId",e),t&&a.set("status",t),s&&a.set("sort",s);let n=a.toString();return(await U(`/api/sessions${n?`?${n}`:""}`)).sessions}catch{return console.warn("API unreachable, falling back to mock data"),j}}async function L(e){try{return await U(`/api/sessions/${e}`)}catch{console.warn("API unreachable, falling back to mock data");let t=I[e];if(t)return t;throw Error("Session not found")}}async function M(){try{return(await U("/api/projects")).projects}catch{return console.warn("API unreachable, falling back to mock data"),y}}async function D(e){try{return await U(`/api/projects/${e}`)}catch{console.warn("API unreachable, falling back to mock data");let t=N[e];if(t)return t;throw Error("Project not found")}}async function _(e,t){return await U("/api/projects",{method:"POST",body:JSON.stringify({name:e,description:t})})}e.s(["acknowledgeAlert",()=>z,"createProject",()=>_,"getAgents",()=>$,"getAlerts",()=>S,"getCosts",()=>T,"getProject",()=>D,"getProjects",()=>M,"getSession",()=>L,"getSessions",()=>F,"pauseAgent",()=>B,"resumeAgent",()=>P],9165)},88899,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(22016),o=e.i(19455),r=e.i(15288),i=e.i(87486),d=e.i(9165),l=e.i(98940);function c(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function u(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function m(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}let g={dor:{border:"border-l-blue-400",bg:"bg-blue-500/10",text:"text-blue-400",badge:"bg-blue-500/10 text-blue-400 border-blue-500/20",dot:"bg-blue-400"},ofek:{border:"border-l-amber-400",bg:"bg-amber-500/10",text:"text-amber-400",badge:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400"},anas:{border:"border-l-emerald-400",bg:"bg-emerald-500/10",text:"text-emerald-400",badge:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400"}},p=["blue-400","emerald-400","amber-400","purple-400","rose-400"];function h(e,t){return g[e]||{border:`border-l-${p[t%5]}`,bg:`bg-${p[t%5]}/10`,text:`text-${p[t%5]}`,badge:`bg-${p[t%5]}/10 text-${p[t%5]} border-${p[t%5]}/20`,dot:`bg-${p[t%5]}`}}let b={active:{color:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400",label:"Active"},idle:{color:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400",label:"Idle"},completed:{color:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",dot:"bg-zinc-400",label:"Completed"}};function x(){let e=(0,a.useParams)(),g=(0,a.useRouter)(),p=e.id,[x,k]=(0,s.useState)(null),[v,w]=(0,s.useState)(!0),[j,y]=(0,s.useState)(null),[C,N]=(0,s.useState)(200),[I,A]=(0,s.useState)(new Set);if((0,s.useEffect)(()=>{!async function(){try{let e=await (0,d.getProject)(p);k(e)}catch{y("Project not found")}finally{w(!1)}}()},[p]),v)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,t.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading project..."]})});if(j||!x)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center space-y-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:j||"Project not found"}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>g.push("/dashboard"),children:"Back to Dashboard"})]})});let U=x.timeline.slice(0,C),$=x.timeline.length>C,S={};return x.agentBreakdown.forEach((e,t)=>{S[e.agentId]=t}),(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsxs)(n.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)(l.ClaWatchIcon,{}),(0,t.jsx)(l.ClaWatchLogo,{size:"md"})]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Project"})]})})}),(0,t.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>g.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,t.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold mb-2",children:x.name}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,t.jsxs)("div",{className:"flex items-center gap-6 flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:["$",x.stats.totalCostUsd.toFixed(2)]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground ml-2",children:"total cost"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.sessionCount," sessions"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.totalMessages," messages"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[u(x.stats.totalTokens)," tokens"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,t.jsxs)("div",{children:[m(x.stats.dateRange.from)," — ",m(x.stats.dateRange.to)]})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Agent Participation"}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.agentBreakdown.map(e=>{var s;let a=h(e.agentId,S[e.agentId]);return(0,t.jsx)(r.Card,{className:`border-l-4 ${a.border}`,children:(0,t.jsxs)(r.CardContent,{className:"pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`border ${a.badge} text-xs`,children:e.agentId}),(0,t.jsxs)("span",{className:"text-lg font-bold",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full ${"dor"===(s=e.agentId)?"bg-blue-400":"ofek"===s?"bg-amber-400":"anas"===s?"bg-emerald-400":"bg-purple-400"} transition-all`,style:{width:`${e.percentage}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.percentage.toFixed(1),"% of total cost"]}),(0,t.jsxs)("span",{children:[u(e.tokenCount)," tokens"]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.messageCount," messages"]})]})]})},e.agentId)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Sessions"}),(0,t.jsx)("div",{className:"grid gap-3",children:x.sessions.map(e=>{let s=b[e.status],a=h(e.agentId,S[e.agentId]??0);return(0,t.jsx)("div",{onClick:()=>g.push(`/dashboard/sessions/${e.id}`),className:"rounded-xl border border-border/50 bg-card p-4 hover:border-border transition-colors cursor-pointer group",children:(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("span",{className:`size-2.5 rounded-full mt-1.5 shrink-0 ${s.dot}`}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,t.jsx)("span",{className:"font-medium truncate max-w-[500px] group-hover:text-emerald-400 transition-colors",children:e.title.length>80?e.title.slice(0,80)+"...":e.title})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${a.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground",children:e.model}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[e.messageCount," msgs"]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.lastActivityAt)})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 shrink-0 text-sm",children:(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("div",{className:"font-bold",children:["$",e.costUsd.toFixed(2)]}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:u(e.tokenCount)})]})})]})},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Unified Timeline"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Messages from all sessions merged chronologically"}),(0,t.jsx)("div",{className:"space-y-2",children:U.map(e=>(0,t.jsx)(f,{message:e,agentIndex:S,collapsed:I.has(e.id),onToggle:()=>{var t;return t=e.id,void A(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}},e.id))}),$&&(0,t.jsx)("div",{className:"text-center mt-4",children:(0,t.jsxs)(o.Button,{variant:"outline",size:"sm",className:"text-xs border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10",onClick:()=>N(e=>e+200),children:["Load more (",x.timeline.length-C," remaining)"]})}),0===x.timeline.length&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground text-sm",children:"No timeline messages yet."})]})]})]})}function f({message:e,agentIndex:s,collapsed:a,onToggle:n}){let o=h(e.agentId,s[e.agentId]??0),r=e.content.toLowerCase().includes("error");return"user"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-blue-500/20 bg-blue-500/10 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"assistant"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-800/50 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),e.model&&(0,t.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:e.model}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),null!=e.costUsd&&(0,t.jsxs)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"tool"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-900 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),e.toolName&&(0,t.jsx)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:e.toolName}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("button",{onClick:n,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:a?"Show":"Hide"})]}),!a&&(0,t.jsx)("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:e.content})]}):(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} px-4 py-2`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.content})]})}e.s(["default",()=>x])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},18566,(e,t,s)=>{t.exports=e.r(76562)},15288,87486,9165,e=>{"use strict";let t,s,a;var n,o=e.i(43476),r=e.i(75157);function i({className:e,size:t="default",...s}){return(0,o.jsx)("div",{"data-slot":"card","data-size":t,className:(0,r.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})}function d({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...t})}function l({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function c({className:e,...t}){return(0,o.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-4 group-data-[size=sm]/card:px-3",e),...t})}e.s(["Card",()=>i,"CardContent",()=>c,"CardHeader",()=>d,"CardTitle",()=>l],15288);var u=e.i(19805),m=e.i(27601);let g=(0,e.i(25913).cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function p({className:e,variant:t="default",render:s,...a}){var n;return n={defaultTagName:"span",props:(0,u.mergeProps)({className:(0,r.cn)(g({variant:t}),e)},a),render:s,state:{slot:"badge",variant:t}},(0,m.useRenderElement)(n.defaultTagName??"div",n,n)}e.s(["Badge",()=>p],87486);var h=e.i(47167);let b=new Date,x=e=>new Date(b.getTime()-6e4*e).toISOString(),f=e=>new Date(b.getTime()-36e5*e).toISOString(),k=[{id:"agent-1",name:"code-reviewer",host:"prod-us-east-1",status:"running",lastHeartbeat:x(.5),costUsd:4.82,tokenCount:124e4,errorCount:0},{id:"agent-2",name:"deploy-bot",host:"prod-us-east-1",status:"running",lastHeartbeat:x(1),costUsd:2.15,tokenCount:52e4,errorCount:1},{id:"agent-3",name:"data-pipeline",host:"prod-eu-west-1",status:"error",lastHeartbeat:x(12),costUsd:8.43,tokenCount:21e5,errorCount:7},{id:"agent-4",name:"customer-support",host:"prod-us-west-2",status:"stuck",lastHeartbeat:x(45),costUsd:12.67,tokenCount:34e5,errorCount:3},{id:"agent-5",name:"test-runner",host:"staging-1",status:"paused",lastHeartbeat:f(2),costUsd:1.03,tokenCount:28e4,errorCount:0},{id:"agent-6",name:"doc-generator",host:"prod-us-east-1",status:"running",lastHeartbeat:x(.2),costUsd:3.21,tokenCount:89e4,errorCount:0},{id:"agent-7",name:"security-scanner",host:"prod-eu-west-1",status:"stopped",lastHeartbeat:f(6),costUsd:.45,tokenCount:12e4,errorCount:0},{id:"agent-8",name:"slack-responder",host:"prod-us-west-2",status:"running",lastHeartbeat:x(.1),costUsd:6.89,tokenCount:178e4,errorCount:2}],v=[{id:"alert-1",agentId:"agent-4",type:"stuck",severity:"critical",message:"customer-support has not sent a heartbeat in 45 minutes",timestamp:x(44),acknowledged:!1},{id:"alert-2",agentId:"agent-3",type:"error",severity:"critical",message:"data-pipeline encountered 7 errors in the last hour",timestamp:x(10),acknowledged:!1},{id:"alert-3",agentId:"agent-4",type:"cost_spike",severity:"warning",message:"customer-support cost increased 340% in the last hour",timestamp:f(1),acknowledged:!1},{id:"alert-4",agentId:"agent-8",type:"loop_detected",severity:"warning",message:"slack-responder may be in a retry loop (similar outputs detected)",timestamp:x(30),acknowledged:!0},{id:"alert-5",agentId:"agent-2",type:"error",severity:"info",message:"deploy-bot encountered a transient API error (auto-recovered)",timestamp:f(3),acknowledged:!0}],w={totalUsd:39.65,byAgent:k.map(e=>({agentId:e.id,name:e.name,costUsd:e.costUsd})),byModel:[{model:"claude-sonnet-4-20250514",costUsd:22.1},{model:"claude-haiku-4-20250506",costUsd:11.35},{model:"gpt-4o",costUsd:6.2}]},j=[{id:"session-1",agentId:"ofek",title:"Build ClaWatch dashboard with real-time alerts",status:"active",costUsd:3.47,tokenCount:892e3,messageCount:47,model:"claude-sonnet-4-20250514",startedAt:x(45),lastActivityAt:x(1),duration:2640},{id:"session-2",agentId:"anas",title:"Fix authentication bug in user login flow",status:"completed",costUsd:1.23,tokenCount:34e4,messageCount:22,model:"claude-sonnet-4-20250514",startedAt:f(3),lastActivityAt:f(2),duration:3600},{id:"session-3",agentId:"dor",title:"Review PR #47 — add retry logic to API calls",status:"idle",costUsd:.87,tokenCount:215e3,messageCount:14,model:"claude-haiku-4-20250506",startedAt:x(90),lastActivityAt:x(12),duration:4680},{id:"session-4",agentId:"ofek",title:"Implement WebSocket event streaming for agent heartbeats",status:"active",costUsd:5.12,tokenCount:134e4,messageCount:63,model:"claude-sonnet-4-20250514",startedAt:f(1.5),lastActivityAt:x(.5),duration:5400},{id:"session-5",agentId:"anas",title:"Refactor database schema for multi-tenant support",status:"completed",costUsd:2.89,tokenCount:78e4,messageCount:38,model:"claude-sonnet-4-20250514",startedAt:f(5),lastActivityAt:f(4),duration:3600},{id:"session-6",agentId:"dor",title:"Debug failing CI pipeline — Jest timeout errors",status:"idle",costUsd:.54,tokenCount:145e3,messageCount:11,model:"claude-haiku-4-20250506",startedAt:x(30),lastActivityAt:x(8),duration:1320},{id:"session-7",agentId:"ofek",title:"Add Telegram bot notification integration",status:"completed",costUsd:1.76,tokenCount:46e4,messageCount:29,model:"claude-sonnet-4-20250514",startedAt:f(8),lastActivityAt:f(7),duration:3600},{id:"session-8",agentId:"anas",title:"Write unit tests for cost calculation module",status:"active",costUsd:.92,tokenCount:248e3,messageCount:18,model:"claude-haiku-4-20250506",startedAt:x(15),lastActivityAt:x(2),duration:780},{id:"session-9",agentId:"dor",title:"Optimize SQL queries — reduce p95 latency from 800ms to 200ms",status:"completed",costUsd:4.31,tokenCount:112e4,messageCount:52,model:"claude-sonnet-4-20250514",startedAt:f(12),lastActivityAt:f(10),duration:7200},{id:"session-10",agentId:"ofek",title:"Set up Docker Compose for local development environment",status:"idle",costUsd:.63,tokenCount:172e3,messageCount:9,model:"claude-haiku-4-20250506",startedAt:x(60),lastActivityAt:x(20),duration:2400}],y=[{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",createdAt:f(48),updatedAt:x(5),sessionCount:3,totalCostUsd:185.98},{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",createdAt:f(24),updatedAt:x(30),sessionCount:2,totalCostUsd:12.5}],C=(t=[],s=0,(a=(e,a,n,o,r,i)=>{s++,t.push({sessionId:e,agentId:a,id:`tl-${s}`,role:n,timestamp:x(o),content:r,...i})})("session-1","ofek","user",120,"Build the ClaWatch dashboard with real-time alerts and agent monitoring. Use Next.js 15 + shadcn/ui."),a("session-1","ofek","assistant",119,"I'll build the ClaWatch dashboard. Let me start by setting up the project structure and examining existing code.",{model:"claude-sonnet-4-20250514",costUsd:.04}),a("session-3","dor","user",118,"Review the initial project setup and suggest architectural improvements for the monitoring system."),a("session-1","ofek","tool",117,"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts",{toolName:"read"}),a("session-3","dor","assistant",116,"Looking at the project structure. I'll review the architecture and suggest improvements for scalability.",{model:"claude-haiku-4-20250506",costUsd:.01}),a("session-1","ofek","assistant",115,"Project structure looks good. I'll create the type definitions for agents, sessions, alerts, and cost data.",{model:"claude-sonnet-4-20250514",costUsd:.06}),a("session-8","anas","user",114,"Write comprehensive unit tests for the cost calculation module including edge cases."),a("session-1","ofek","tool",113,"File written: src/lib/types.ts (78 lines)",{toolName:"write"}),a("session-8","anas","assistant",112,"I'll write thorough unit tests for cost calculations. Let me first examine the module.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-3","dor","tool",111,"export interface Agent {\n id: string;\n name: string;\n status: AgentStatus;\n ...",{toolName:"read"}),a("session-3","dor","assistant",110,"The type definitions look solid. I'd suggest adding a `duration` field to Session for better analytics. Also, the cost tracking should support per-model breakdown.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-1","ofek","assistant",108,"Good point from the review. I'll add duration tracking and per-model cost breakdown. Now creating the mock data layer.",{model:"claude-sonnet-4-20250514",costUsd:.05}),a("session-8","anas","tool",107,"export function calculateCost(tokens: number, model: string): number { ... }",{toolName:"read"}),a("session-1","ofek","tool",105,"File written: src/lib/mock-data.ts (280 lines)",{toolName:"write"}),a("session-8","anas","assistant",104,"Found the cost module. I'll test standard pricing, cache discount calculations, multi-model sessions, and zero-token edge cases.",{model:"claude-haiku-4-20250506",costUsd:.03}),a("session-1","ofek","system",103,"Context window: 45% utilized (90K/200K tokens)"),a("session-8","anas","tool",102,"File written: src/__tests__/cost-calculation.test.ts (156 lines)",{toolName:"write"}),a("session-1","ofek","assistant",100,"Mock data created. Now building the dashboard page with agent cards, alert banners, and cost overview.",{model:"claude-sonnet-4-20250514",costUsd:.12}),a("session-3","dor","user",98,"Can you also review the API layer and check for error handling gaps?"),a("session-1","ofek","tool",95,"File written: src/app/dashboard/page.tsx (320 lines)",{toolName:"write"}),a("session-8","anas","assistant",94,"All 12 test cases pass. Found one edge case where negative token counts could cause issues — adding a guard.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-3","dor","assistant",92,"Reviewing API layer. The fetchJson wrapper needs better error handling — currently swallows network errors. I'll suggest adding retry logic and timeout handling.",{model:"claude-haiku-4-20250506",costUsd:.03}),a("session-8","anas","tool",90,"$ npm test -- --watchAll=false\n\nTest Suites: 1 passed, 1 total\nTests: 14 passed, 14 total\nTime: 2.834s",{toolName:"exec"}),a("session-1","ofek","assistant",88,"Dashboard page done. Adding real-time polling with 5-second intervals and the tabbed interface for Agents/Sessions views.",{model:"claude-sonnet-4-20250514",costUsd:.08}),a("session-1","ofek","tool",85,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",{toolName:"exec"}),a("session-3","dor","assistant",83,"Here's my review summary:\n1. Add retry logic to fetchJson (3 retries with exponential backoff)\n2. Add request timeout (30s default)\n3. The mock fallback pattern is good but should log errors to a monitoring service\n4. Consider adding request deduplication for concurrent calls",{model:"claude-haiku-4-20250506",costUsd:.04}),a("session-1","ofek","user",80,"Add session detail view with message timeline, cost breakdown by model, and token analysis."),a("session-1","ofek","assistant",78,"I'll build the session detail page with a full message timeline. Each message type will have distinct visual treatment.",{model:"claude-sonnet-4-20250514",costUsd:.09}),a("session-1","ofek","tool",75,"File written: src/app/dashboard/sessions/[id]/page.tsx (340 lines)",{toolName:"write"}),a("session-8","anas","assistant",72,"All tests passing. Adding integration tests for the API mock fallback pattern now.",{model:"claude-haiku-4-20250506",costUsd:.02}),a("session-1","ofek","assistant",70,"Session detail page complete with:\n- Message timeline with user/assistant/tool/system styling\n- Cost breakdown by model with progress bars\n- Token breakdown (input/output/cache read/cache write)\n- Collapsible tool outputs",{model:"claude-sonnet-4-20250514",costUsd:.06}),a("session-1","ofek","system",68,"Context window: 72% utilized (144K/200K tokens)"),a("session-1","ofek","tool",65,"$ npm run build\n\n ✓ Compiled successfully\n ✓ Generating static pages (7/7)\n\nBuild completed in 9.1s",{toolName:"exec"}),a("session-1","ofek","assistant",60,"Build passes. The ClaWatch dashboard is fully functional with real-time monitoring, session tracking, and cost analytics.",{model:"claude-sonnet-4-20250514",costUsd:.04}),t.sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime())),N={"project-1":{id:"project-1",name:"Building ClaWatch",description:"Full-stack AI observability platform with real-time monitoring, session tracking, and cost analytics",stats:{totalCostUsd:185.98,totalTokens:482e4,totalMessages:128,sessionCount:3,dateRange:{from:f(48),to:x(5)}},agentBreakdown:[{agentId:"ofek",costUsd:142.5,tokenCount:32e5,messageCount:78,percentage:76.6},{agentId:"dor",costUsd:28.48,tokenCount:98e4,messageCount:32,percentage:15.3},{agentId:"anas",costUsd:15,tokenCount:64e4,messageCount:18,percentage:8.1}],sessions:[j.find(e=>"session-1"===e.id),j.find(e=>"session-3"===e.id),j.find(e=>"session-8"===e.id)],timeline:C},"project-2":{id:"project-2",name:"Bug Fixes Sprint",description:"Critical bug fixes for authentication, database schema, and CI pipeline issues",stats:{totalCostUsd:12.5,totalTokens:112e4,totalMessages:60,sessionCount:2,dateRange:{from:f(24),to:x(30)}},agentBreakdown:[{agentId:"anas",costUsd:7.8,tokenCount:68e4,messageCount:38,percentage:62.4},{agentId:"dor",costUsd:4.7,tokenCount:44e4,messageCount:22,percentage:37.6}],sessions:[j.find(e=>"session-2"===e.id),j.find(e=>"session-6"===e.id)],timeline:[{sessionId:"session-2",agentId:"anas",id:"tl-b1",role:"user",timestamp:f(3),content:"Fix the authentication bug in the user login flow. Users are getting 401 errors after token refresh."},{sessionId:"session-2",agentId:"anas",id:"tl-b2",role:"assistant",timestamp:f(2.9),content:"I'll investigate the auth flow. Let me check the token refresh logic.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b3",role:"user",timestamp:f(2.8),content:"Debug the failing CI pipeline. Jest tests are timing out on the session module."},{sessionId:"session-2",agentId:"anas",id:"tl-b4",role:"tool",timestamp:f(2.7),content:"Found: refreshToken() doesn't await the database write before returning new token",toolName:"read"},{sessionId:"session-6",agentId:"dor",id:"tl-b5",role:"assistant",timestamp:f(2.6),content:"Looking at the CI logs. The Jest timeout suggests an unresolved promise in the test setup.",model:"claude-haiku-4-20250506",costUsd:.01},{sessionId:"session-2",agentId:"anas",id:"tl-b6",role:"assistant",timestamp:f(2.5),content:"Found the bug: `refreshToken()` returns before the DB write completes. Adding await fixes the race condition.",model:"claude-sonnet-4-20250514",costUsd:.05},{sessionId:"session-6",agentId:"dor",id:"tl-b7",role:"tool",timestamp:f(2.4),content:"$ jest --verbose\nFAILED: session.test.ts > should persist session data\nTimeout: 5000ms exceeded",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b8",role:"assistant",timestamp:f(2.2),content:"The test is missing `afterAll` cleanup — the database connection stays open. Adding proper teardown.",model:"claude-haiku-4-20250506",costUsd:.02},{sessionId:"session-2",agentId:"anas",id:"tl-b9",role:"tool",timestamp:f(2.1),content:"$ npm test -- auth.test.ts\n\nTests: 8 passed, 8 total",toolName:"exec"},{sessionId:"session-6",agentId:"dor",id:"tl-b10",role:"tool",timestamp:f(2),content:"$ jest session.test.ts --verbose\nPASSED: all 6 tests",toolName:"exec"},{sessionId:"session-2",agentId:"anas",id:"tl-b11",role:"assistant",timestamp:f(1.9),content:"Auth bug fixed and all tests passing. The root cause was a missing await in the token refresh handler.",model:"claude-sonnet-4-20250514",costUsd:.03},{sessionId:"session-6",agentId:"dor",id:"tl-b12",role:"assistant",timestamp:f(1.8),content:"CI pipeline fixed. Added proper test teardown and increased timeout for integration tests to 10s.",model:"claude-haiku-4-20250506",costUsd:.02}]}},I={};for(let e of j)I[e.id]={...e,costByModel:e.model.includes("sonnet")?[{model:"claude-sonnet-4-20250514",costUsd:.82*e.costUsd,tokenCount:Math.floor(.75*e.tokenCount)},{model:"claude-haiku-4-20250506",costUsd:.18*e.costUsd,tokenCount:Math.floor(.25*e.tokenCount)}]:[{model:"claude-haiku-4-20250506",costUsd:.65*e.costUsd,tokenCount:Math.floor(.6*e.tokenCount)},{model:"claude-sonnet-4-20250514",costUsd:.35*e.costUsd,tokenCount:Math.floor(.4*e.tokenCount)}],tokenBreakdown:{input:Math.floor(.35*e.tokenCount),output:Math.floor(.3*e.tokenCount),cacheRead:Math.floor(.25*e.tokenCount),cacheWrite:Math.floor(.1*e.tokenCount)},messages:(n=e.id,[{id:`${n}-msg-1`,role:"user",timestamp:x(44),content:"Build the ClaWatch dashboard with real-time alert monitoring. Use Next.js 15 with shadcn/ui components."},{id:`${n}-msg-2`,role:"assistant",timestamp:x(43),content:"I'll build the ClaWatch dashboard. Let me start by examining the project structure and existing code.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:12400},{id:`${n}-msg-3`,role:"tool",timestamp:x(43),content:"src/\n app/\n dashboard/\n page.tsx\n layout.tsx\n page.tsx\n components/\n ui/\n lib/\n types.ts\n api.ts\n mock-data.ts",toolName:"read",toolInput:'{"path": "src/"}'},{id:`${n}-msg-4`,role:"assistant",timestamp:x(42),content:"I can see the project structure. Let me read the existing types and API files to understand the data model.",model:"claude-sonnet-4-20250514",costUsd:.02,tokenCount:8200},{id:`${n}-msg-5`,role:"tool",timestamp:x(42),content:'export type AgentStatus = "running" | "paused" | "stopped" | "error" | "stuck";\n\nexport interface Agent {\n id: string;\n name: string;\n ...',toolName:"read",toolInput:'{"path": "src/lib/types.ts"}'},{id:`${n}-msg-6`,role:"assistant",timestamp:x(40),content:"Now I'll create the dashboard page with agent cards, alert banners, and cost overview panels. I'll use the existing shadcn/ui components.",model:"claude-sonnet-4-20250514",costUsd:.08,tokenCount:34600},{id:`${n}-msg-7`,role:"tool",timestamp:x(39),content:"File written: src/app/dashboard/page.tsx (358 lines)",toolName:"write",toolInput:'{"path": "src/app/dashboard/page.tsx", "content": "..."}'},{id:`${n}-msg-8`,role:"tool",timestamp:x(38),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Collecting page data\n ✓ Generating static pages (5/5)\n ✓ Collecting build traces\n\nRoute (app) Size First Load JS\n├ ○ / 5.2 kB 92.1 kB\n└ ○ /dashboard 12.4 kB 99.3 kB",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${n}-msg-9`,role:"assistant",timestamp:x(37),content:"The build succeeded. Let me now add the real-time polling mechanism and alert notification sounds.",model:"claude-sonnet-4-20250514",costUsd:.04,tokenCount:15800},{id:`${n}-msg-10`,role:"tool",timestamp:x(36),content:"Lines 49-64 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${n}-msg-11`,role:"user",timestamp:x(35),content:"Can you also add a cost breakdown by model? Show it as horizontal progress bars."},{id:`${n}-msg-12`,role:"assistant",timestamp:x(34),content:"Sure! I'll add a cost breakdown section with progress bars for each model. Let me update the dashboard.",model:"claude-sonnet-4-20250514",costUsd:.06,tokenCount:24200},{id:`${n}-msg-13`,role:"tool",timestamp:x(33),content:"Lines 254-305 edited in src/app/dashboard/page.tsx",toolName:"edit",toolInput:'{"path": "src/app/dashboard/page.tsx", "old_string": "...", "new_string": "..."}'},{id:`${n}-msg-14`,role:"system",timestamp:x(32),content:"Context window: 78% utilized (156K/200K tokens)"},{id:`${n}-msg-15`,role:"assistant",timestamp:x(31),content:"I've added the cost breakdown panels. The dashboard now shows:\n\n1. **Agent cards** with status, cost, tokens, errors, and heartbeat\n2. **Alert banner** for critical/warning alerts\n3. **Cost by Agent** — horizontal progress bars\n4. **Cost by Model** — horizontal progress bars\n\nThe data refreshes every 5 seconds via polling.",model:"claude-sonnet-4-20250514",costUsd:.05,tokenCount:18900},{id:`${n}-msg-16`,role:"tool",timestamp:x(30),content:'{"results": [{"title": "shadcn/ui Tabs Component", "url": "https://ui.shadcn.com/docs/components/tabs"}]}',toolName:"web_search",toolInput:'{"query": "shadcn ui tabs component usage"}'},{id:`${n}-msg-17`,role:"assistant",timestamp:x(28),content:"Let me add a tabbed interface for Agents and Sessions views. I'll implement the tabs using a simple state-based approach.",model:"claude-sonnet-4-20250514",costUsd:.11,tokenCount:45200},{id:`${n}-msg-18`,role:"tool",timestamp:x(27),content:"$ npm run build\n\n ✓ Compiled successfully\n ✓ Linting and checking validity of types\n ✓ Generating static pages (5/5)\n\nBuild completed in 8.2s",toolName:"exec",toolInput:'{"command": "npm run build"}'},{id:`${n}-msg-19`,role:"assistant",timestamp:x(25),content:"Build passes. The dashboard now has Agents and Sessions tabs with full filtering and sorting. All existing functionality is preserved.",model:"claude-sonnet-4-20250514",costUsd:.03,tokenCount:11600},{id:`${n}-msg-20`,role:"tool",timestamp:x(24),content:"$ npm test -- --watchAll=false\n\nTest Suites: 3 passed, 3 total\nTests: 12 passed, 12 total\nTime: 4.231s",toolName:"exec",toolInput:'{"command": "npm test -- --watchAll=false"}'}])};let A=h.default.env.NEXT_PUBLIC_API_KEY||"";async function U(e,t){let s={"Content-Type":"application/json","ngrok-skip-browser-warning":"true",...A?{"X-ClaWatch-Key":A}:{},...t?.headers||{}},a=await fetch(`${e}`,{...t,headers:s});if(!a.ok)throw Error(`API error: ${a.status}`);return a.json()}async function $(e){try{let t=e?`?status=${e}`:"";return(await U(`/api/agents${t}`)).agents}catch{return console.warn("API unreachable, falling back to mock data"),k}}async function S(){try{return(await U("/api/alerts")).alerts}catch{return console.warn("API unreachable, falling back to mock data"),v}}async function T(){try{return await U("/api/costs")}catch{return console.warn("API unreachable, falling back to mock data"),w}}async function B(e){await U(`/api/agents/${e}/pause`,{method:"POST"})}async function P(e){await U(`/api/agents/${e}/resume`,{method:"POST"})}async function z(e){await U(`/api/alerts/${e}/acknowledge`,{method:"POST"})}async function F(e,t,s){try{let a=new URLSearchParams;e&&a.set("agentId",e),t&&a.set("status",t),s&&a.set("sort",s);let n=a.toString();return(await U(`/api/sessions${n?`?${n}`:""}`)).sessions}catch{return console.warn("API unreachable, falling back to mock data"),j}}async function L(e){try{return await U(`/api/sessions/${e}`)}catch{console.warn("API unreachable, falling back to mock data");let t=I[e];if(t)return t;throw Error("Session not found")}}async function M(){try{return(await U("/api/projects")).projects}catch{return console.warn("API unreachable, falling back to mock data"),y}}async function D(e){try{return await U(`/api/projects/${e}`)}catch{console.warn("API unreachable, falling back to mock data");let t=N[e];if(t)return t;throw Error("Project not found")}}async function _(e,t){return await U("/api/projects",{method:"POST",body:JSON.stringify({name:e,description:t})})}e.s(["acknowledgeAlert",()=>z,"createProject",()=>_,"getAgents",()=>$,"getAlerts",()=>S,"getCosts",()=>T,"getProject",()=>D,"getProjects",()=>M,"getSession",()=>L,"getSessions",()=>F,"pauseAgent",()=>B,"resumeAgent",()=>P],9165)},88899,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(22016),o=e.i(19455),r=e.i(15288),i=e.i(87486),d=e.i(9165),l=e.i(98940);function c(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function u(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function m(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}let g={dor:{border:"border-l-blue-400",bg:"bg-blue-500/10",text:"text-blue-400",badge:"bg-blue-500/10 text-blue-400 border-blue-500/20",dot:"bg-blue-400"},ofek:{border:"border-l-amber-400",bg:"bg-amber-500/10",text:"text-amber-400",badge:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400"},anas:{border:"border-l-emerald-400",bg:"bg-emerald-500/10",text:"text-emerald-400",badge:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400"}},p=["blue-400","emerald-400","amber-400","purple-400","rose-400"];function h(e,t){return g[e]||{border:`border-l-${p[t%5]}`,bg:`bg-${p[t%5]}/10`,text:`text-${p[t%5]}`,badge:`bg-${p[t%5]}/10 text-${p[t%5]} border-${p[t%5]}/20`,dot:`bg-${p[t%5]}`}}let b={active:{color:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",dot:"bg-emerald-400",label:"Active"},idle:{color:"bg-amber-500/10 text-amber-400 border-amber-500/20",dot:"bg-amber-400",label:"Idle"},completed:{color:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",dot:"bg-zinc-400",label:"Completed"}};function x(){let e=(0,a.useParams)(),g=(0,a.useRouter)(),p=e.id,[x,k]=(0,s.useState)(null),[v,w]=(0,s.useState)(!0),[j,y]=(0,s.useState)(null),[C,N]=(0,s.useState)(200),[I,A]=(0,s.useState)(new Set);if((0,s.useEffect)(()=>{!async function(){try{let e=await (0,d.getProject)(p);k(e)}catch{y("Project not found")}finally{w(!1)}}()},[p]),v)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-muted-foreground",children:[(0,t.jsx)("div",{className:"size-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"}),"Loading project..."]})});if(j||!x)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center space-y-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:j||"Project not found"}),(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>g.push("/dashboard"),children:"Back to Dashboard"})]})});let U=x.timeline.slice(0,C),$=x.timeline.length>C,S={};return x.agentBreakdown.forEach((e,t)=>{S[e.agentId]=t}),(0,t.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,t.jsx)("nav",{className:"border-b border-border/50 bg-background/80 backdrop-blur-sm sticky top-0 z-50",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsxs)(n.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)(l.ClaWatchIcon,{}),(0,t.jsx)(l.ClaWatchLogo,{size:"md"})]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Project"})]})})}),(0,t.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-6 space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>g.push("/dashboard"),className:"text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 inline-flex items-center gap-1",children:[(0,t.jsx)("span",{children:"←"})," Back to Dashboard"]}),(0,t.jsx)("h1",{className:"text-2xl font-bold mb-2",children:x.name}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:x.description}),(0,t.jsxs)("div",{className:"flex items-center gap-6 flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:["$",x.stats.totalCostUsd.toFixed(2)]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground ml-2",children:"total cost"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.sessionCount," sessions"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[x.stats.totalMessages," messages"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:(0,t.jsxs)("div",{className:"font-medium text-foreground",children:[u(x.stats.totalTokens)," tokens"]})}),(0,t.jsx)("div",{className:"h-8 w-px bg-border/50"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,t.jsxs)("div",{children:[m(x.stats.dateRange.from)," — ",m(x.stats.dateRange.to)]})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Agent Participation"}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.agentBreakdown.map(e=>{var s;let a=h(e.agentId,S[e.agentId]);return(0,t.jsx)(r.Card,{className:`border-l-4 ${a.border}`,children:(0,t.jsxs)(r.CardContent,{className:"pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`border ${a.badge} text-xs`,children:e.agentId}),(0,t.jsxs)("span",{className:"text-lg font-bold",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"w-full h-2 rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full ${"dor"===(s=e.agentId)?"bg-blue-400":"ofek"===s?"bg-amber-400":"anas"===s?"bg-emerald-400":"bg-purple-400"} transition-all`,style:{width:`${e.percentage}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.percentage.toFixed(1),"% of total cost"]}),(0,t.jsxs)("span",{children:[u(e.tokenCount)," tokens"]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.messageCount," messages"]})]})]})},e.agentId)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Sessions"}),(0,t.jsx)("div",{className:"grid gap-3",children:x.sessions.map(e=>{let s=b[e.status],a=h(e.agentId,S[e.agentId]??0);return(0,t.jsx)("div",{onClick:()=>g.push(`/dashboard/sessions/${e.id}`),className:"rounded-xl border border-border/50 bg-card p-4 hover:border-border transition-colors cursor-pointer group",children:(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("span",{className:`size-2.5 rounded-full mt-1.5 shrink-0 ${s.dot}`}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,t.jsx)("span",{className:"font-medium truncate max-w-[500px] group-hover:text-emerald-400 transition-colors",children:e.title.length>80?e.title.slice(0,80)+"...":e.title})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${a.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground",children:e.model}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[e.messageCount," msgs"]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.lastActivityAt)})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-4 shrink-0 text-sm",children:(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("div",{className:"font-bold",children:["$",e.costUsd.toFixed(2)]}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:u(e.tokenCount)})]})})]})},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Unified Timeline"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Messages from all sessions merged chronologically"}),(0,t.jsx)("div",{className:"space-y-2",children:U.map(e=>(0,t.jsx)(f,{message:e,agentIndex:S,collapsed:I.has(e.id),onToggle:()=>{var t;return t=e.id,void A(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}},e.id))}),$&&(0,t.jsx)("div",{className:"text-center mt-4",children:(0,t.jsxs)(o.Button,{variant:"outline",size:"sm",className:"text-xs border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10",onClick:()=>N(e=>e+200),children:["Load more (",x.timeline.length-C," remaining)"]})}),0===x.timeline.length&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground text-sm",children:"No timeline messages yet."})]})]})]})}function f({message:e,agentIndex:s,collapsed:a,onToggle:n}){let o=h(e.agentId,s[e.agentId]??0),r=e.content.toLowerCase().includes("error");return"user"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-blue-500/20 bg-blue-500/10 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-blue-400",children:"User"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"assistant"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-800/50 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs font-medium text-zinc-400",children:"Assistant"}),e.model&&(0,t.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground",children:e.model}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),null!=e.costUsd&&(0,t.jsxs)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border-emerald-500/20",children:["$",e.costUsd.toFixed(2)]})]}),(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e.content})]}):"tool"===e.role?(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} border border-border/50 bg-zinc-900 p-4 ${r?"border-red-500/30 bg-red-500/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-xs text-amber-400",children:"Tool"}),e.toolName&&(0,t.jsx)(i.Badge,{variant:"outline",className:"text-[10px] font-mono bg-amber-500/10 text-amber-400 border-amber-500/20",children:e.toolName}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("button",{onClick:n,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:a?"Show":"Hide"})]}),!a&&(0,t.jsx)("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:e.content})]}):(0,t.jsxs)("div",{className:`rounded-lg border-l-4 ${o.border} px-4 py-2`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Badge,{variant:"outline",className:`text-[10px] border ${o.badge}`,children:e.agentId}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"System"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:c(e.timestamp)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.content})]})}e.s(["default",()=>x])}]);