fleetlens 0.16.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/app/apps/web/.next/BUILD_ID +1 -1
- package/app/apps/web/.next/build-manifest.json +3 -3
- package/app/apps/web/.next/prerender-manifest.json +3 -3
- package/app/apps/web/.next/server/app/_global-error.html +1 -1
- package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/agent/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/onboarding/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0sr4wr_.js +1 -1
- package/app/apps/web/.next/server/chunks/packages_entries_dist_0-0s5ui._.js +1 -1
- package/app/apps/web/.next/server/chunks/packages_entries_dist_0~0d7ku._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/_0k8yioi._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_0~aj0~u._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0x014hn._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_components_agent-chat_tsx_0xbtx2n._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
- package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/app/apps/web/.next/server/middleware-manifest.json +5 -5
- package/app/apps/web/.next/server/pages/500.html +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next/static/chunks/03vmnii5njgx2.js +14 -0
- package/app/apps/web/.next/static/chunks/{0e0bk6.-dirdy.js → 06ypi6hp.gb8s.js} +1 -1
- package/app/apps/web/.next/static/chunks/{04feoajklmrl3.js → 0oz~x2s3c1zp_.js} +2 -2
- package/app/apps/web/components/agent-chat.tsx +1 -1
- package/app/apps/web/components/usage-sidebar.tsx +1 -1
- package/app/apps/web/components/zai-credentials-form.tsx +2 -2
- package/app/apps/web/lib/agent/extract.test.ts +1 -1
- package/app/apps/web/lib/changelog-data.generated.ts +1 -1
- package/app/apps/web/lib/format.test.ts +8 -8
- package/app/apps/web/lib/format.ts +1 -1
- package/app/apps/web/package.json +1 -1
- package/app/apps/web/tsconfig.tsbuildinfo +1 -1
- package/dist/daemon-worker.js +12 -5
- package/dist/index.js +25 -16
- package/menubar/Fleetlens.app/Contents/Info.plist +2 -2
- package/menubar/Fleetlens.app/Contents/MacOS/FleetlensMenubar +0 -0
- package/package.json +18 -2
- package/app/apps/web/.next/static/chunks/0i0ydeh8ks76..js +0 -14
- /package/app/apps/web/.next/static/{pyul3PDbGo5QnjdZr6ZIg → 3_tJh8qOJtVg59IUgLbCS}/_buildManifest.js +0 -0
- /package/app/apps/web/.next/static/{pyul3PDbGo5QnjdZr6ZIg → 3_tJh8qOJtVg59IUgLbCS}/_clientMiddlewareManifest.js +0 -0
- /package/app/apps/web/.next/static/{pyul3PDbGo5QnjdZr6ZIg → 3_tJh8qOJtVg59IUgLbCS}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[63681,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={RequestCookies:function(){return f.RequestCookies},ResponseCookies:function(){return f.ResponseCookies},stringifyCookie:function(){return f.stringifyCookie}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(36226)},51409,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReflectAdapter",{enumerable:!0,get:function(){return d}});class d{static get(a,b,c){let d=Reflect.get(a,b,c);return"function"==typeof d?d.bind(a):d}static set(a,b,c,d){return Reflect.set(a,b,c,d)}static has(a,b){return Reflect.has(a,b)}static deleteProperty(a,b){return Reflect.deleteProperty(a,b)}}},4712,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ActionDidNotRevalidate:function(){return f},ActionDidRevalidateDynamicOnly:function(){return h},ActionDidRevalidateStaticAndDynamic:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=0,g=1,h=2},14896,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={MutableRequestCookiesAdapter:function(){return o},ReadonlyRequestCookiesError:function(){return j},RequestCookiesAdapter:function(){return k},appendMutableCookies:function(){return n},areCookiesMutableInCurrentPhase:function(){return q},createCookiesWithMutableAccessCheck:function(){return p},getModifiedCookieValues:function(){return m},responseCookiesToRequestCookies:function(){return s}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(63681),g=a.r(51409),h=a.r(56704),i=a.r(4712);class j extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new j}}class k{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return j.callable;default:return g.ReflectAdapter.get(a,b,c)}}})}}let l=Symbol.for("next.mutated.cookies");function m(a){let b=a[l];return b&&Array.isArray(b)&&0!==b.length?b:[]}function n(a,b){let c=m(b);if(0===c.length)return!1;let d=new f.ResponseCookies(a),e=d.getAll();for(let a of c)d.set(a);for(let a of e)d.set(a);return!0}class o{static wrap(a,b){let c=new f.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let d=[],e=new Set,j=()=>{let a=h.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=i.ActionDidRevalidateStaticAndDynamic),d=c.getAll().filter(a=>e.has(a.name)),b){let a=[];for(let b of d){let c=new f.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case l:return d;case"delete":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return g.ReflectAdapter.get(a,b,c)}}});return k}}function p(a){let b=new Proxy(a.mutableCookies,{get(c,d,e){switch(d){case"delete":return function(...d){return r(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return r(a,"cookies().set"),c.set(...d),b};default:return g.ReflectAdapter.get(c,d,e)}}});return b}function q(a){return"action"===a.phase}function r(a,b){if(!q(a))throw new j}function s(a){let b=new f.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let r=o.get(q);if(r)return r;let s=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw Object.defineProperty(new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,j.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return p(u);{let a=(0,g.isInEarlyRenderStage)(c);if(u===c.mutableCookies)return a?c.asyncApiPromises.earlyMutableCookies:c.asyncApiPromises.mutableCookies;return a?c.asyncApiPromises.earlyCookies:c.asyncApiPromises.cookies}}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let q=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,q),q;case"prerender-client":case"validation-client":let r="`headers`";throw Object.defineProperty(new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,i.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return(0,f.isInEarlyRenderStage)(c)?c.asyncApiPromises.earlyHeaders:c.asyncApiPromises.headers;return o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return l}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(13091);function l(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":return(0,k.delayUntilRuntimeStage)(c,m(c.draftMode,b));case"request":return m(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return m(f,b);case"prerender":case"prerender-ppr":case"prerender-legacy":return m(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`${a}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return c}}function m(a,b){let c=o.get(a??n);return c||Promise.resolve(new p(a))}a.r(51409);let n={},o=new WeakMap;class p{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){q("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){q("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function q(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. 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(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.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.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${c.route} used \`${a}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},45017,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx <module evaluation>","Sidebar")},10398,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx","Sidebar")},23604,a=>{"use strict";a.i(45017);var b=a.i(10398);a.n(b)},59969,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx <module evaluation>","LiveRefresher")},11272,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx","LiveRefresher")},30642,a=>{"use strict";a.i(59969);var b=a.i(11272);a.n(b)},99153,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx <module evaluation>","LiveSessionsWidget")},62615,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx","LiveSessionsWidget")},9647,a=>{"use strict";a.i(99153);var b=a.i(62615);a.n(b)},14022,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx <module evaluation>","JobQueueWidget")},5900,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx","JobQueueWidget")},84829,a=>{"use strict";a.i(14022);var b=a.i(5900);a.n(b)},73842,a=>{"use strict";a.s(["MenubarInstallBanner",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call MenubarInstallBanner() from the server but MenubarInstallBanner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/menubar-install-banner.tsx <module evaluation>","MenubarInstallBanner")},46147,a=>{"use strict";a.s(["MenubarInstallBanner",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call MenubarInstallBanner() from the server but MenubarInstallBanner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/menubar-install-banner.tsx","MenubarInstallBanner")},73994,a=>{"use strict";a.i(73842);var b=a.i(46147);a.n(b)},28992,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(23604),e=a.i(30642),f=a.i(9647),g=a.i(84829),h=a.i(73994);a.i(9117);var i=a.i(48024),j=a.i(67116),k=a.i(70709),l=a.i(60511),m=a.i(76597),n=a.i(40095);async function o({children:a}){let p=await (0,c.headers)();if((p.get("x-fleetlens-pathname")??"").startsWith("/print/")){let d=p.get("x-fleetlens-theme"),e=await (0,c.cookies)(),f=e.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===d||"dark"===d?d:"light"===f||"dark"===f?f:"dark",suppressHydrationWarning:!0,children:(0,b.jsx)("body",{children:a})})}let[q,r]=await Promise.all([(0,j.listSessions)(),(0,m.buildEntriesIndex)()]),s=q.slice(0,20),t=q.length,u=(0,i.groupByProject)(q).map(a=>({projectDir:a.projectDir,projectName:a.projectName,sessionCount:a.sessions.length,lastActiveMs:a.lastActiveMs,worktreeCount:a.worktreeCount})),v=(0,k.latestUsageSnapshot)(),w=(0,l.readTeamConnection)(),x=s.map(a=>({id:a.id,projectName:a.projectName,firstUserPreview:a.firstUserPreview,lastUserPreview:a.lastUserPreview,lastAgentPreview:a.lastAgentPreview,firstTimestamp:a.firstTimestamp,lastTimestamp:a.lastTimestamp,lastActivityMs:a.lastActivityMs,teamName:a.teamName,agentName:a.agentName,agent:a.agent})),y={};for(let a of s){let b=r.bySession.get(a.id)??[];if(0===b.length)continue;let c=b[b.length-1];y[a.id]={outcome:c.enrichment.outcome??null,enrichmentStatus:c.enrichment.status,localDay:c.local_day}}let z=await (0,c.cookies)(),A=z.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===A||"dark"===A?A:"dark",suppressHydrationWarning:!0,children:(0,b.jsxs)("body",{children:[(0,b.jsx)(e.LiveRefresher,{}),(0,b.jsxs)("div",{style:{display:"flex",height:"100vh"},children:[(0,b.jsx)(d.Sidebar,{projects:u,totalSessions:t,currentUsage:v,version:"0.16.9",latestChangelogVersion:n.LATEST_VERSION,teamConnection:w}),(0,b.jsxs)("main",{style:{flex:1,minWidth:0,minHeight:0,padding:0,overflow:"auto"},children:[(0,b.jsx)(h.MenubarInstallBanner,{}),a]})]}),(0,b.jsx)(f.LiveSessionsWidget,{sessions:x,entrySummaries:y}),(0,b.jsx)(g.JobQueueWidget,{})]})})}a.s(["default",0,o,"dynamic",0,"force-dynamic","metadata",0,{title:"Fleetlens",description:"Multi-agent fleet analytics — local-only dashboard for Claude Code, Codex, and other coding-agent sessions."}],28992)},44665,a=>{a.n(a.i(28992))}];
|
|
1
|
+
module.exports=[63681,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={RequestCookies:function(){return f.RequestCookies},ResponseCookies:function(){return f.ResponseCookies},stringifyCookie:function(){return f.stringifyCookie}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(36226)},51409,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReflectAdapter",{enumerable:!0,get:function(){return d}});class d{static get(a,b,c){let d=Reflect.get(a,b,c);return"function"==typeof d?d.bind(a):d}static set(a,b,c,d){return Reflect.set(a,b,c,d)}static has(a,b){return Reflect.has(a,b)}static deleteProperty(a,b){return Reflect.deleteProperty(a,b)}}},4712,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ActionDidNotRevalidate:function(){return f},ActionDidRevalidateDynamicOnly:function(){return h},ActionDidRevalidateStaticAndDynamic:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=0,g=1,h=2},14896,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={MutableRequestCookiesAdapter:function(){return o},ReadonlyRequestCookiesError:function(){return j},RequestCookiesAdapter:function(){return k},appendMutableCookies:function(){return n},areCookiesMutableInCurrentPhase:function(){return q},createCookiesWithMutableAccessCheck:function(){return p},getModifiedCookieValues:function(){return m},responseCookiesToRequestCookies:function(){return s}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(63681),g=a.r(51409),h=a.r(56704),i=a.r(4712);class j extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new j}}class k{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return j.callable;default:return g.ReflectAdapter.get(a,b,c)}}})}}let l=Symbol.for("next.mutated.cookies");function m(a){let b=a[l];return b&&Array.isArray(b)&&0!==b.length?b:[]}function n(a,b){let c=m(b);if(0===c.length)return!1;let d=new f.ResponseCookies(a),e=d.getAll();for(let a of c)d.set(a);for(let a of e)d.set(a);return!0}class o{static wrap(a,b){let c=new f.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let d=[],e=new Set,j=()=>{let a=h.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=i.ActionDidRevalidateStaticAndDynamic),d=c.getAll().filter(a=>e.has(a.name)),b){let a=[];for(let b of d){let c=new f.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case l:return d;case"delete":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return g.ReflectAdapter.get(a,b,c)}}});return k}}function p(a){let b=new Proxy(a.mutableCookies,{get(c,d,e){switch(d){case"delete":return function(...d){return r(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return r(a,"cookies().set"),c.set(...d),b};default:return g.ReflectAdapter.get(c,d,e)}}});return b}function q(a){return"action"===a.phase}function r(a,b){if(!q(a))throw new j}function s(a){let b=new f.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let r=o.get(q);if(r)return r;let s=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw Object.defineProperty(new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,j.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return p(u);{let a=(0,g.isInEarlyRenderStage)(c);if(u===c.mutableCookies)return a?c.asyncApiPromises.earlyMutableCookies:c.asyncApiPromises.mutableCookies;return a?c.asyncApiPromises.earlyCookies:c.asyncApiPromises.cookies}}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let q=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,q),q;case"prerender-client":case"validation-client":let r="`headers`";throw Object.defineProperty(new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,i.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return(0,f.isInEarlyRenderStage)(c)?c.asyncApiPromises.earlyHeaders:c.asyncApiPromises.headers;return o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return l}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(13091);function l(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":return(0,k.delayUntilRuntimeStage)(c,m(c.draftMode,b));case"request":return m(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return m(f,b);case"prerender":case"prerender-ppr":case"prerender-legacy":return m(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`${a}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return c}}function m(a,b){let c=o.get(a??n);return c||Promise.resolve(new p(a))}a.r(51409);let n={},o=new WeakMap;class p{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){q("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){q("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function q(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. 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(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.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.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${c.route} used \`${a}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},45017,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx <module evaluation>","Sidebar")},10398,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx","Sidebar")},23604,a=>{"use strict";a.i(45017);var b=a.i(10398);a.n(b)},59969,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx <module evaluation>","LiveRefresher")},11272,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx","LiveRefresher")},30642,a=>{"use strict";a.i(59969);var b=a.i(11272);a.n(b)},99153,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx <module evaluation>","LiveSessionsWidget")},62615,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx","LiveSessionsWidget")},9647,a=>{"use strict";a.i(99153);var b=a.i(62615);a.n(b)},14022,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx <module evaluation>","JobQueueWidget")},5900,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx","JobQueueWidget")},84829,a=>{"use strict";a.i(14022);var b=a.i(5900);a.n(b)},73842,a=>{"use strict";a.s(["MenubarInstallBanner",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call MenubarInstallBanner() from the server but MenubarInstallBanner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/menubar-install-banner.tsx <module evaluation>","MenubarInstallBanner")},46147,a=>{"use strict";a.s(["MenubarInstallBanner",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call MenubarInstallBanner() from the server but MenubarInstallBanner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/menubar-install-banner.tsx","MenubarInstallBanner")},73994,a=>{"use strict";a.i(73842);var b=a.i(46147);a.n(b)},28992,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(23604),e=a.i(30642),f=a.i(9647),g=a.i(84829),h=a.i(73994);a.i(9117);var i=a.i(48024),j=a.i(67116),k=a.i(70709),l=a.i(60511),m=a.i(76597),n=a.i(40095);async function o({children:a}){let p=await (0,c.headers)();if((p.get("x-fleetlens-pathname")??"").startsWith("/print/")){let d=p.get("x-fleetlens-theme"),e=await (0,c.cookies)(),f=e.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===d||"dark"===d?d:"light"===f||"dark"===f?f:"dark",suppressHydrationWarning:!0,children:(0,b.jsx)("body",{children:a})})}let[q,r]=await Promise.all([(0,j.listSessions)(),(0,m.buildEntriesIndex)()]),s=q.slice(0,20),t=q.length,u=(0,i.groupByProject)(q).map(a=>({projectDir:a.projectDir,projectName:a.projectName,sessionCount:a.sessions.length,lastActiveMs:a.lastActiveMs,worktreeCount:a.worktreeCount})),v=(0,k.latestUsageSnapshot)(),w=(0,l.readTeamConnection)(),x=s.map(a=>({id:a.id,projectName:a.projectName,firstUserPreview:a.firstUserPreview,lastUserPreview:a.lastUserPreview,lastAgentPreview:a.lastAgentPreview,firstTimestamp:a.firstTimestamp,lastTimestamp:a.lastTimestamp,lastActivityMs:a.lastActivityMs,teamName:a.teamName,agentName:a.agentName,agent:a.agent})),y={};for(let a of s){let b=r.bySession.get(a.id)??[];if(0===b.length)continue;let c=b[b.length-1];y[a.id]={outcome:c.enrichment.outcome??null,enrichmentStatus:c.enrichment.status,localDay:c.local_day}}let z=await (0,c.cookies)(),A=z.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===A||"dark"===A?A:"dark",suppressHydrationWarning:!0,children:(0,b.jsxs)("body",{children:[(0,b.jsx)(e.LiveRefresher,{}),(0,b.jsxs)("div",{style:{display:"flex",height:"100vh"},children:[(0,b.jsx)(d.Sidebar,{projects:u,totalSessions:t,currentUsage:v,version:"1.0.1",latestChangelogVersion:n.LATEST_VERSION,teamConnection:w}),(0,b.jsxs)("main",{style:{flex:1,minWidth:0,minHeight:0,padding:0,overflow:"auto"},children:[(0,b.jsx)(h.MenubarInstallBanner,{}),a]})]}),(0,b.jsx)(f.LiveSessionsWidget,{sessions:x,entrySummaries:y}),(0,b.jsx)(g.JobQueueWidget,{})]})})}a.s(["default",0,o,"dynamic",0,"force-dynamic","metadata",0,{title:"Fleetlens",description:"Multi-agent fleet analytics — local-only dashboard for Claude Code, Codex, and other coding-agent sessions."}],28992)},44665,a=>{a.n(a.i(28992))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0k8yioi._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[46522,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["AiFeaturesForm",0,function({initial:a}){let[d,e]=(0,c.useState)(a.enabled),[f,g]=(0,c.useState)(a.autoBackfillLastWeek),[h,i]=(0,c.useState)(a.autoBackfillYesterday),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null);async function n(a){a.preventDefault(),k(!0),m(null);let b=await fetch("/api/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({ai_features:{enabled:d,autoBackfillLastWeek:f,autoBackfillYesterday:h}})});k(!1),m(b.ok?"Saved.":`Error: ${b.status}`)}return(0,b.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",checked:d,onChange:a=>e(a.target.checked)}),(0,b.jsx)("span",{children:"Enable AI digests and enrichment"})]}),(0,b.jsxs)("label",{className:`flex items-start gap-2 ${d?"":"opacity-50"}`,children:[(0,b.jsx)("input",{type:"checkbox",checked:h,disabled:!d,onChange:a=>i(a.target.checked)}),(0,b.jsxs)("span",{children:["Auto-backfill yesterday's digest on daemon start",(0,b.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:"Generates yesterday's enriched entries and day digest. Runs once per daemon boot. Without this, yesterday's digest only appears after you load the homepage."})]})]}),(0,b.jsxs)("label",{className:`flex items-start gap-2 ${d?"":"opacity-50"}`,children:[(0,b.jsx)("input",{type:"checkbox",checked:f,disabled:!d,onChange:a=>g(a.target.checked)}),(0,b.jsxs)("span",{children:["Auto-backfill last week's narrative on daemon start",(0,b.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:"Generates enriched entries, day digests, and the weekly digest for the most recently completed ISO week. Runs once per ISO week."})]})]}),(0,b.jsx)("button",{type:"submit",disabled:j,className:"af-btn-primary",children:j?"Saving…":"Save"}),l&&(0,b.jsx)("p",{className:"text-sm",children:l})]})}])},36195,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["AutostartToggle",0,function({initial:a}){let[d,e]=(0,c.useState)(a),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null);if(!d.supported)return(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["Auto-start uses a macOS LaunchAgent and is macOS-only for now. Add"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens daemon start"})," to your login items manually."]});async function j(a){g(!0),i(null);let b=await fetch("/api/team/autostart",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:a})}),c=await b.json().catch(()=>null);(g(!1),b.ok)?e(c):i(c?.error??`Error ${b.status}`)}return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 text-sm",children:[(0,b.jsx)("input",{type:"checkbox",checked:d.installed,disabled:f,onChange:a=>void j(a.target.checked)}),(0,b.jsxs)("span",{children:["Start Fleetlens at login (dashboard + usage daemon)",(0,b.jsx)("span",{className:"mt-0.5 block text-xs text-gray-500",children:d.installed?"Enabled — the dashboard and reporting come back after a reboot.":d.optedOut?"Disabled — you opted out; joining a team won't re-enable it.":"Disabled — pairing with a team enables this automatically."})]})]}),h&&(0,b.jsx)("p",{className:"text-sm text-red-600",children:h})]})}])},43965,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["MenubarInstall",0,function({initial:a}){let[d,e]=(0,c.useState)(a),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null);if(!d.supported)return(0,b.jsx)("p",{className:"text-sm text-gray-500",children:"The menu bar widget is a native macOS app and isn't available on this platform."});async function l(a,b){g(!0),i(null),k(null);let c=await fetch("/api/menubar",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:a})}),d=await c.json().catch(()=>null);(g(!1),c.ok)?(e({supported:d.supported,installed:d.installed,running:d.running,bundled:d.bundled}),k(b)):i(d?.error??`Error ${c.status}`)}return(0,b.jsxs)("div",{className:"space-y-3",children:[!d.bundled&&(0,b.jsxs)("p",{className:"text-sm text-amber-600",children:["This build doesn't include the widget bundle. Run"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens menubar status"})," for details."]}),(0,b.jsx)("p",{className:"text-sm text-gray-500",children:d.installed?d.running?"Installed and running — check your menu bar.":"Installed but not running.":"Adds live Claude Code, Codex, Copilot, Z.ai, and Grok quota gauges to your menu bar and revives the usage daemon when snapshots are over five minutes old."}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[!d.installed&&(0,b.jsx)("button",{type:"button",className:"af-btn af-btn-primary",disabled:f||!d.bundled,onClick:()=>void l("install","Installed — check your menu bar."),children:f?"Installing…":"Install widget"}),d.installed&&!d.running&&(0,b.jsx)("button",{type:"button",className:"af-btn af-btn-primary",disabled:f,onClick:()=>void l("open","Opened — check your menu bar."),children:f?"Opening…":"Open widget"}),d.installed&&(0,b.jsx)("button",{type:"button",className:"af-btn",disabled:f,onClick:()=>void l("uninstall","Widget removed."),children:f?"Removing…":"Uninstall"})]}),d.installed&&(0,b.jsxs)("p",{className:"text-xs text-gray-500",children:["To also launch it at login, run"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens menubar install"})," in your terminal."]}),j&&(0,b.jsx)("p",{className:"text-sm text-green-600",children:j}),h&&(0,b.jsx)("p",{className:"text-sm text-red-600",children:h})]})}])},70438,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["ZaiCredentialsForm",0,function({initial:a}){let[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(a.zai?.configured??!1),[n,o]=(0,c.useState)(a.zai?.hint??null),[p,q]=(0,c.useState)(!1);async function r(a){a.preventDefault(),g(!0),i(null),k(!1);let b=await fetch("/api/settings/credentials",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:d})}),c=await b.json().catch(()=>null);if(g(!1),!b.ok){k(!0),i(c?.error??`Error ${b.status}`);return}m(c.zai?.configured??!1),o(c.zai?.hint??null),e(""),q(!1),i(c.zai?.configured?"Z.ai API key saved.":"Z.ai API key removed.")}async function s(){e(""),i(null),k(!1);let a=await fetch("/api/settings/credentials",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:""})}),b=await a.json().catch(()=>null);a.ok?(m(!1),o(null),i("Z.ai API key removed.")):(k(!0),i(b?.error??"Error removing key."))}return!p&&l?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["Z.ai API key configured (",n,"). Used by the daemon to poll your GLM Coding Plan usage —
|
|
1
|
+
module.exports=[46522,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["AiFeaturesForm",0,function({initial:a}){let[d,e]=(0,c.useState)(a.enabled),[f,g]=(0,c.useState)(a.autoBackfillLastWeek),[h,i]=(0,c.useState)(a.autoBackfillYesterday),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null);async function n(a){a.preventDefault(),k(!0),m(null);let b=await fetch("/api/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({ai_features:{enabled:d,autoBackfillLastWeek:f,autoBackfillYesterday:h}})});k(!1),m(b.ok?"Saved.":`Error: ${b.status}`)}return(0,b.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",checked:d,onChange:a=>e(a.target.checked)}),(0,b.jsx)("span",{children:"Enable AI digests and enrichment"})]}),(0,b.jsxs)("label",{className:`flex items-start gap-2 ${d?"":"opacity-50"}`,children:[(0,b.jsx)("input",{type:"checkbox",checked:h,disabled:!d,onChange:a=>i(a.target.checked)}),(0,b.jsxs)("span",{children:["Auto-backfill yesterday's digest on daemon start",(0,b.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:"Generates yesterday's enriched entries and day digest. Runs once per daemon boot. Without this, yesterday's digest only appears after you load the homepage."})]})]}),(0,b.jsxs)("label",{className:`flex items-start gap-2 ${d?"":"opacity-50"}`,children:[(0,b.jsx)("input",{type:"checkbox",checked:f,disabled:!d,onChange:a=>g(a.target.checked)}),(0,b.jsxs)("span",{children:["Auto-backfill last week's narrative on daemon start",(0,b.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:"Generates enriched entries, day digests, and the weekly digest for the most recently completed ISO week. Runs once per ISO week."})]})]}),(0,b.jsx)("button",{type:"submit",disabled:j,className:"af-btn-primary",children:j?"Saving…":"Save"}),l&&(0,b.jsx)("p",{className:"text-sm",children:l})]})}])},36195,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["AutostartToggle",0,function({initial:a}){let[d,e]=(0,c.useState)(a),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null);if(!d.supported)return(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["Auto-start uses a macOS LaunchAgent and is macOS-only for now. Add"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens daemon start"})," to your login items manually."]});async function j(a){g(!0),i(null);let b=await fetch("/api/team/autostart",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:a})}),c=await b.json().catch(()=>null);(g(!1),b.ok)?e(c):i(c?.error??`Error ${b.status}`)}return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 text-sm",children:[(0,b.jsx)("input",{type:"checkbox",checked:d.installed,disabled:f,onChange:a=>void j(a.target.checked)}),(0,b.jsxs)("span",{children:["Start Fleetlens at login (dashboard + usage daemon)",(0,b.jsx)("span",{className:"mt-0.5 block text-xs text-gray-500",children:d.installed?"Enabled — the dashboard and reporting come back after a reboot.":d.optedOut?"Disabled — you opted out; joining a team won't re-enable it.":"Disabled — pairing with a team enables this automatically."})]})]}),h&&(0,b.jsx)("p",{className:"text-sm text-red-600",children:h})]})}])},43965,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["MenubarInstall",0,function({initial:a}){let[d,e]=(0,c.useState)(a),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null);if(!d.supported)return(0,b.jsx)("p",{className:"text-sm text-gray-500",children:"The menu bar widget is a native macOS app and isn't available on this platform."});async function l(a,b){g(!0),i(null),k(null);let c=await fetch("/api/menubar",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:a})}),d=await c.json().catch(()=>null);(g(!1),c.ok)?(e({supported:d.supported,installed:d.installed,running:d.running,bundled:d.bundled}),k(b)):i(d?.error??`Error ${c.status}`)}return(0,b.jsxs)("div",{className:"space-y-3",children:[!d.bundled&&(0,b.jsxs)("p",{className:"text-sm text-amber-600",children:["This build doesn't include the widget bundle. Run"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens menubar status"})," for details."]}),(0,b.jsx)("p",{className:"text-sm text-gray-500",children:d.installed?d.running?"Installed and running — check your menu bar.":"Installed but not running.":"Adds live Claude Code, Codex, Copilot, Z.ai, and Grok quota gauges to your menu bar and revives the usage daemon when snapshots are over five minutes old."}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[!d.installed&&(0,b.jsx)("button",{type:"button",className:"af-btn af-btn-primary",disabled:f||!d.bundled,onClick:()=>void l("install","Installed — check your menu bar."),children:f?"Installing…":"Install widget"}),d.installed&&!d.running&&(0,b.jsx)("button",{type:"button",className:"af-btn af-btn-primary",disabled:f,onClick:()=>void l("open","Opened — check your menu bar."),children:f?"Opening…":"Open widget"}),d.installed&&(0,b.jsx)("button",{type:"button",className:"af-btn",disabled:f,onClick:()=>void l("uninstall","Widget removed."),children:f?"Removing…":"Uninstall"})]}),d.installed&&(0,b.jsxs)("p",{className:"text-xs text-gray-500",children:["To also launch it at login, run"," ",(0,b.jsx)("code",{className:"font-mono text-xs",children:"fleetlens menubar install"})," in your terminal."]}),j&&(0,b.jsx)("p",{className:"text-sm text-green-600",children:j}),h&&(0,b.jsx)("p",{className:"text-sm text-red-600",children:h})]})}])},70438,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["ZaiCredentialsForm",0,function({initial:a}){let[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(a.zai?.configured??!1),[n,o]=(0,c.useState)(a.zai?.hint??null),[p,q]=(0,c.useState)(!1);async function r(a){a.preventDefault(),g(!0),i(null),k(!1);let b=await fetch("/api/settings/credentials",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:d})}),c=await b.json().catch(()=>null);if(g(!1),!b.ok){k(!0),i(c?.error??`Error ${b.status}`);return}m(c.zai?.configured??!1),o(c.zai?.hint??null),e(""),q(!1),i(c.zai?.configured?"Z.ai API key saved.":"Z.ai API key removed.")}async function s(){e(""),i(null),k(!1);let a=await fetch("/api/settings/credentials",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:""})}),b=await a.json().catch(()=>null);a.ok?(m(!1),o(null),i("Z.ai API key removed.")):(k(!0),i(b?.error??"Error removing key."))}return!p&&l?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["Z.ai API key configured (",n,"). Used by the daemon to poll your GLM Coding Plan usage — the key is sent only with those calls to Z.ai's own usage API and is stored locally at ~/.cclens/credentials.json (owner-read/write only)."]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:"af-btn",onClick:()=>q(!0),children:"Change key"}),(0,b.jsx)("button",{type:"button",className:"af-btn",onClick:s,children:"Remove key"})]}),h&&(0,b.jsx)("p",{className:"text-sm text-green-600",children:h})]}):(0,b.jsxs)("form",{onSubmit:r,className:"space-y-3",children:[(0,b.jsxs)("p",{className:"text-sm text-gray-500",children:["Enter your Z.ai API key to enable plan-usage tracking for the GLM Coding Plan. Get one from the"," ",(0,b.jsx)("a",{href:"https://z.ai/manage-apikey/apikey-list",target:"_blank",rel:"noreferrer",className:"underline",children:"Z.ai console"})," ","→ API Keys."]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"password",className:"af-input flex-1",placeholder:"Paste your API key",value:d,onChange:a=>e(a.target.value),autoFocus:!l}),(0,b.jsx)("button",{type:"submit",disabled:f,className:"af-btn af-btn-primary",children:f?"Saving…":"Save"}),l&&(0,b.jsx)("button",{type:"button",className:"af-btn",onClick:()=>{q(!1),e("")},children:"Cancel"})]}),h&&(0,b.jsx)("p",{className:`text-sm ${j?"text-red-600":"text-green-600"}`,children:h})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_web_0~aj0~u._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[44422,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(50944),e=a.i(72131),f=a.i(70106);let g=(0,f.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),h=(0,f.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);var i=a.i(96101);let j=(0,f.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),k=(0,f.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var l=a.i(87532),m=a.i(69439);let n=(0,f.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var o=a.i(60702),p=a.i(8406),q=a.i(3444);let r=(0,f.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),s=(0,f.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function t(a){if("u">typeof document){document.documentElement.setAttribute("data-theme",a);try{document.cookie=`claude-lens-theme=${a};path=/;max-age=31536000;samesite=lax`}catch{}}}function u(){let[a,c]=(0,e.useState)("dark"),[d,f]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let a=document.documentElement.getAttribute("data-theme");if("light"===a||"dark"===a)c(a);else{let a="dark";c(a),t(a)}f(!0)},[]),(0,b.jsx)("button",{type:"button",onClick:()=>{let b="dark"===a?"light":"dark";c(b),t(b);try{window.localStorage.setItem("claude-lens:theme",b)}catch{}},"aria-label":"dark"===a?"Switch to light mode":"Switch to dark mode",title:"dark"===a?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--af-surface-hover)",a.currentTarget.style.color="var(--af-text)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--af-text-secondary)"},children:d?"dark"===a?(0,b.jsx)(s,{size:14}):(0,b.jsx)(r,{size:14}):null})}var v=a.i(2591),w=a.i(55555);function x({snapshot:a}){let d,e,[f,,g]=(0,v.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!a)return(0,b.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,b.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,b.jsxs)("div",{children:["Run ",(0,b.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let h=[{label:"5h",window:a.five_hour,windowMs:18e6},{label:"7d",window:a.seven_day,windowMs:6048e5}];return g&&f&&h.push({label:"Sonnet 7d",window:a.seven_day_sonnet,windowMs:6048e5}),(0,b.jsxs)(c.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,b.jsx)("span",{children:"Current usage"}),(0,b.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(d=new Date(a.captured_at).getTime(),(e=Math.round((Date.now()-d)/1e3))<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`)})]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:h.map(a=>(0,b.jsx)(y,{...a},a.label))})]})}function y({label:a,window:c,windowMs:d}){let e=c?.utilization??null,f=null!==e,g=f?Math.max(0,Math.min(100,e)):0,h=c?.resets_at?new Date(c.resets_at).getTime():null,i=f&&h?(0,w.toneVar)((0,w.paceToneForCycle)(g,h,d)):"var(--af-border-subtle)";return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,b.jsx)("span",{children:a}),c?.resets_at&&(0,b.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(a){let b,c=Math.round((new Date(a).getTime()-Date.now())/1e3),d=Math.abs(c);if(d<60)b=`${d}s`;else if(d<3600)b=`${Math.floor(d/60)}m`;else if(d<86400){let a=Math.floor(d/3600),c=Math.floor(d%3600/60);b=c>0?`${a}h${c}m`:`${a}h`}else{let a=Math.floor(d/86400),c=Math.floor(d%86400/3600);b=c>0?`${a}d${c}h`:`${a}d`}return c<0?`${b} ago`:`in ${b}`}(c.resets_at)]}),(0,b.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:f?`${g.toFixed(0)}%`:"—"})]}),(0,b.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,b.jsx)("div",{style:{height:"100%",width:f?`${g}%`:"0%",background:i,borderRadius:999,transition:"width 0.24s ease"}})})]})}let z=(0,f.default)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);var A=a.i(2913);function B({latestVersion:a,active:d}){let[f,g]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{if(!a)return void g(!1);try{let b=window.localStorage.getItem(A.STORAGE_KEY);g(b!==a)}catch{g(!1)}},[a]),(0,b.jsxs)(c.default,{href:"/changelog","aria-label":f?"Changelog (new entries)":"Changelog",title:f?`What's new in v${a}`:"Changelog",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:d?"var(--af-text)":"var(--af-text-tertiary)",background:d?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,b.jsx)(z,{size:14}),f&&(0,b.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:3,right:3,width:7,height:7,borderRadius:"50%",background:"#ef4444",border:"1.5px solid var(--af-surface)"}})]})}let C={green:"var(--af-success, #10b981)",amber:"var(--af-warning, #f59e0b)",red:"var(--af-error, #ef4444)"};function D({connection:a}){let d,f,[g,h]=(0,e.useState)(()=>Date.now());if((0,e.useEffect)(()=>{if(!a.paired)return;let b=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(b)},[a.paired]),!a.paired)return null;let{team:i,lastPush:j}=a,k=C[function(a,b=Date.now()){if("none"===a.kind)return"amber";if("error"===a.kind)return"red";let c=b-Date.parse(a.at);return Number.isNaN(c)||c>36e5?"red":c>9e5?"amber":"green"}(j,g)];"none"===j.kind?(d="waiting…",f="Daemon pushes every 5 minutes"):(d="error"===j.kind?`failed ${(0,q.formatRelative)(j.at)}`:`synced ${(0,q.formatRelative)(j.at)}`,f=new Date(j.at).toLocaleString());let l=[`Team: ${i.name}`,f,"error"===j.kind?`Error: ${j.error}`:"Click to inspect what's synced."];return(0,b.jsxs)(c.default,{href:"/team",title:l.join("\n"),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px 8px 20px",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",textDecoration:"none",minWidth:0},children:[(0,b.jsx)("span",{"aria-hidden":!0,suppressHydrationWarning:!0,style:{width:7,height:7,borderRadius:"50%",background:k,flexShrink:0,boxShadow:`0 0 0 2px color-mix(in srgb, ${k} 25%, transparent)`}}),(0,b.jsx)("span",{style:{flexShrink:0,fontWeight:500},children:"Team:"}),(0,b.jsx)("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.name}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0},suppressHydrationWarning:!0,children:d})]})}function E({href:a,active:d,icon:e,trailing:f,children:g}){return(0,b.jsxs)(c.default,{href:a,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:d?"var(--af-accent)":"var(--af-text-secondary)",background:d?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[e,(0,b.jsx)("span",{style:{flex:1},children:g}),f&&(0,b.jsx)("span",{style:{fontSize:10,color:d?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:f})]})}function F({label:a,items:d,pathname:e,isPinned:f,onTogglePin:g}){return 0===d.length?null:(0,b.jsxs)("div",{style:{marginTop:10},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:a}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:d.map(a=>{let d=`/projects/${encodeURIComponent(a.projectDir)}`,h=e===d,i=(0,q.prettyProjectName)(a.projectName);return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:h?"var(--af-accent-subtle)":"transparent",color:h?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,b.jsxs)(c.default,{href:d,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(a.worktreeCount??0)>0?`${a.projectName} — ${a.worktreeCount} worktree${1===a.worktreeCount?"":"s"}`:a.projectName,children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:i}),(a.worktreeCount??0)>0&&(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",a.worktreeCount," wt"]})]}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:a.sessionCount}),(0,b.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.projectDir)},"aria-label":f(a.projectDir)?"Unpin project":"Pin project",title:f(a.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:f(a.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:f(a.projectDir)?(0,b.jsx)(k,{size:12}):(0,b.jsx)(j,{size:12})}),a.lastActiveMs&&(0,b.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(a.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,q.formatRelative)(new Date(a.lastActiveMs).toISOString())})]},a.projectDir)})})]})}a.s(["Sidebar",0,function({projects:a,totalSessions:f,currentUsage:j,version:k,latestChangelogVersion:q,teamConnection:r}){let s=(0,d.usePathname)(),[t,v]=(0,e.useState)(new Set),[w,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)("");(0,e.useEffect)(()=>{v(new Set),y(!0)},[]);let C=a=>{v(b=>{let c=new Set(b);c.has(a)?c.delete(a):c.add(a);try{window.localStorage.setItem("claude-lens:pinned-projects:v1",JSON.stringify(Array.from(c)))}catch{}return c})},G=(0,e.useMemo)(()=>{if(!z.trim())return a;let b=z.toLowerCase();return a.filter(a=>a.projectName.toLowerCase().includes(b))},[a,z]),H=G.filter(a=>t.has(a.projectDir)),I=G.filter(a=>!t.has(a.projectDir));return(0,b.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,b.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,b.jsx)("span",{"aria-hidden":"true",style:{width:28,height:28,flex:"0 0 auto",background:'url("/icon.svg") center / contain no-repeat'}}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,b.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${k}`,children:["v",k]})]}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,b.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,b.jsx)(E,{href:"/",active:"/"===s,icon:(0,b.jsx)(g,{size:15}),children:"Overview"}),(0,b.jsx)(E,{href:"/sessions",active:"/sessions"===s||s.startsWith("/sessions/"),icon:(0,b.jsx)(h,{size:15}),trailing:f>0?String(f):void 0,children:"All sessions"}),(0,b.jsx)(E,{href:"/projects",active:"/projects"===s,icon:(0,b.jsx)(i.FolderOpen,{size:15}),trailing:a.length>0?String(a.length):void 0,children:"Projects"}),(0,b.jsx)(E,{href:"/day",active:"/day"===s||s.startsWith("/day/")||"/digest"===s||s.startsWith("/digest/")||"/parallelism"===s,icon:(0,b.jsx)(o.CalendarDays,{size:15}),children:"Day"}),(0,b.jsx)(E,{href:"/insights",active:"/insights"===s,icon:(0,b.jsx)(m.Lightbulb,{size:15}),children:"Insights"}),(0,b.jsx)(E,{href:"/agent",active:"/agent"===s||"/runs"===s||s.startsWith("/runs/"),icon:(0,b.jsx)(p.Sparkles,{size:15}),children:"Agent"})]}),(0,b.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,b.jsx)(l.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,b.jsx)("input",{type:"text",placeholder:"Search projects",value:z,onChange:a=>A(a.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,b.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[w&&H.length>0&&(0,b.jsx)(F,{label:"Pinned",items:H,pathname:s,isPinned:a=>t.has(a),onTogglePin:C}),(0,b.jsx)(F,{label:"Projects",items:I,pathname:s,isPinned:a=>t.has(a),onTogglePin:C})]}),(0,b.jsx)(x,{snapshot:j}),(0,b.jsx)(D,{connection:r}),(0,b.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,b.jsxs)("span",{style:{flex:1,minWidth:0},children:[f," sessions · ",a.length," projects"]}),(0,b.jsx)(B,{latestVersion:q,active:"/changelog"===s}),(0,b.jsx)(c.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===s?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===s?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,b.jsx)(n,{size:14})}),(0,b.jsx)(u,{})]})]})}],44422)},46069,a=>{"use strict";var b=a.i(50944),c=a.i(72131);a.s(["LiveRefresher",0,function(){let a,d=(0,b.useRouter)(),e=(a=(0,b.usePathname)(),a?.includes("/insights/print/")??!1),f=(0,c.useRef)(null),g=(0,c.useRef)({session:0,usage:0,team:0});return!function(a,b={}){let{enabled:d=!0}=b,e=(0,c.useRef)(a);(0,c.useEffect)(()=>{e.current=a},[a]),(0,c.useEffect)(()=>{if(!d)return;let a=new EventSource("/api/events");return a.onmessage=a=>{try{let b=JSON.parse(a.data);("session-updated"===b.type||"usage-updated"===b.type||"team-push"===b.type)&&e.current(b)}catch{}},a.onerror=()=>{},()=>{a.close()}},[d])}((0,c.useCallback)(a=>{let b="usage-updated"===a.type?"usage":"team-push"===a.type?"team":"session";a.mtimeMs<=(g.current[b]??0)||(g.current[b]=a.mtimeMs,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d.refresh()},400))},[d]),{enabled:!e}),(0,c.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]),null}],46069)},1568,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(3444),g=a.i(76285),h=a.i(99309),i=a.i(44220);let j="cclens-live-widget-expanded";a.s(["LiveSessionsWidget",0,function({sessions:a,entrySummaries:k={}}){let l=(0,d.usePathname)(),[m,n]=(0,c.useState)(()=>Date.now()),[o,p]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{try{let a=localStorage.getItem(j);null!==a&&p("true"===a)}catch{}},[]),(0,c.useEffect)(()=>{let a=setInterval(()=>n(Date.now()),1e4);return()=>clearInterval(a)},[]),l&&/^\/sessions\/[^/]+$/.test(l))return null;let q=a.filter(a=>{let b=a.lastTimestamp?Date.parse(a.lastTimestamp):NaN,c=Math.max(Number.isNaN(b)?0:b,a.lastActivityMs&&Number.isFinite(a.lastActivityMs)?a.lastActivityMs:0);return!(c<=0)&&m-c<=45e3}).slice().sort((a,b)=>{let c=a.firstTimestamp?Date.parse(a.firstTimestamp):0;return(b.firstTimestamp?Date.parse(b.firstTimestamp):0)-c});if(0===q.length)return null;let r=o?q.slice(0,5):[],s=o?q.length-r.length:0;return(0,b.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{var a;return a=a=>!a,void p(b=>{let c=a(b);try{localStorage.setItem(j,String(c))}catch{}return c})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:o?"Collapse":`Show ${q.length} live session${1===q.length?"":"s"}`,children:[(0,b.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",(0,b.jsx)("span",{suppressHydrationWarning:!0,children:q.length})]}),o&&s>0&&(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",s," more live"]}),r.map(a=>{let c=k[a.id];return(0,b.jsxs)(e.default,{href:`/sessions/${a.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(a.lastUserPreview||a.firstUserPreview||a.lastAgentPreview)??(0,f.prettyProjectName)(a.projectName),children:[c&&(0,b.jsx)("div",{onClick:a=>a.stopPropagation(),style:{marginBottom:4},children:c.outcome?(0,b.jsx)(i.OutcomePill,{outcome:c.outcome,size:"sm",label:"text",agent:a.agent}):"skipped_trivial"!==c.enrichmentStatus?(0,b.jsx)(i.OutcomePill,{outcome:null,pending:!0,sessionId:a.id,localDay:c.localDay,size:"sm",agent:a.agent}):null}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:a.lastUserPreview||a.firstUserPreview||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,b.jsx)(g.TeamBadge,{session:a,linkable:!1}),(0,b.jsx)(h.AgentBadge,{agent:a.agent})]}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:a.lastAgentPreview?(0,b.jsxs)(b.Fragment,{children:["↳ ",a.lastAgentPreview]}):(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,b.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,f.prettyProjectName)(a.projectName)})]},a.id)}),(0,b.jsx)("style",{children:`
|
|
1
|
+
module.exports=[44422,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(50944),e=a.i(72131),f=a.i(70106);let g=(0,f.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),h=(0,f.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);var i=a.i(96101);let j=(0,f.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),k=(0,f.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var l=a.i(87532),m=a.i(69439);let n=(0,f.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var o=a.i(60702),p=a.i(8406),q=a.i(3444);let r=(0,f.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),s=(0,f.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function t(a){if("u">typeof document){document.documentElement.setAttribute("data-theme",a);try{document.cookie=`claude-lens-theme=${a};path=/;max-age=31536000;samesite=lax`}catch{}}}function u(){let[a,c]=(0,e.useState)("dark"),[d,f]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let a=document.documentElement.getAttribute("data-theme");if("light"===a||"dark"===a)c(a);else{let a="dark";c(a),t(a)}f(!0)},[]),(0,b.jsx)("button",{type:"button",onClick:()=>{let b="dark"===a?"light":"dark";c(b),t(b);try{window.localStorage.setItem("claude-lens:theme",b)}catch{}},"aria-label":"dark"===a?"Switch to light mode":"Switch to dark mode",title:"dark"===a?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--af-surface-hover)",a.currentTarget.style.color="var(--af-text)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--af-text-secondary)"},children:d?"dark"===a?(0,b.jsx)(s,{size:14}):(0,b.jsx)(r,{size:14}):null})}var v=a.i(2591),w=a.i(55555);function x({snapshot:a}){let d,e,[f,,g]=(0,v.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!a)return(0,b.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,b.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,b.jsxs)("div",{children:["Run ",(0,b.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"fleetlens daemon start"})," to collect metrics."]})]});let h=[{label:"5h",window:a.five_hour,windowMs:18e6},{label:"7d",window:a.seven_day,windowMs:6048e5}];return g&&f&&h.push({label:"Sonnet 7d",window:a.seven_day_sonnet,windowMs:6048e5}),(0,b.jsxs)(c.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,b.jsx)("span",{children:"Current usage"}),(0,b.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(d=new Date(a.captured_at).getTime(),(e=Math.round((Date.now()-d)/1e3))<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`)})]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:h.map(a=>(0,b.jsx)(y,{...a},a.label))})]})}function y({label:a,window:c,windowMs:d}){let e=c?.utilization??null,f=null!==e,g=f?Math.max(0,Math.min(100,e)):0,h=c?.resets_at?new Date(c.resets_at).getTime():null,i=f&&h?(0,w.toneVar)((0,w.paceToneForCycle)(g,h,d)):"var(--af-border-subtle)";return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,b.jsx)("span",{children:a}),c?.resets_at&&(0,b.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(a){let b,c=Math.round((new Date(a).getTime()-Date.now())/1e3),d=Math.abs(c);if(d<60)b=`${d}s`;else if(d<3600)b=`${Math.floor(d/60)}m`;else if(d<86400){let a=Math.floor(d/3600),c=Math.floor(d%3600/60);b=c>0?`${a}h${c}m`:`${a}h`}else{let a=Math.floor(d/86400),c=Math.floor(d%86400/3600);b=c>0?`${a}d${c}h`:`${a}d`}return c<0?`${b} ago`:`in ${b}`}(c.resets_at)]}),(0,b.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:f?`${g.toFixed(0)}%`:"—"})]}),(0,b.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,b.jsx)("div",{style:{height:"100%",width:f?`${g}%`:"0%",background:i,borderRadius:999,transition:"width 0.24s ease"}})})]})}let z=(0,f.default)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);var A=a.i(2913);function B({latestVersion:a,active:d}){let[f,g]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{if(!a)return void g(!1);try{let b=window.localStorage.getItem(A.STORAGE_KEY);g(b!==a)}catch{g(!1)}},[a]),(0,b.jsxs)(c.default,{href:"/changelog","aria-label":f?"Changelog (new entries)":"Changelog",title:f?`What's new in v${a}`:"Changelog",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:d?"var(--af-text)":"var(--af-text-tertiary)",background:d?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,b.jsx)(z,{size:14}),f&&(0,b.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:3,right:3,width:7,height:7,borderRadius:"50%",background:"#ef4444",border:"1.5px solid var(--af-surface)"}})]})}let C={green:"var(--af-success, #10b981)",amber:"var(--af-warning, #f59e0b)",red:"var(--af-error, #ef4444)"};function D({connection:a}){let d,f,[g,h]=(0,e.useState)(()=>Date.now());if((0,e.useEffect)(()=>{if(!a.paired)return;let b=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(b)},[a.paired]),!a.paired)return null;let{team:i,lastPush:j}=a,k=C[function(a,b=Date.now()){if("none"===a.kind)return"amber";if("error"===a.kind)return"red";let c=b-Date.parse(a.at);return Number.isNaN(c)||c>36e5?"red":c>9e5?"amber":"green"}(j,g)];"none"===j.kind?(d="waiting…",f="Daemon pushes every 5 minutes"):(d="error"===j.kind?`failed ${(0,q.formatRelative)(j.at)}`:`synced ${(0,q.formatRelative)(j.at)}`,f=new Date(j.at).toLocaleString());let l=[`Team: ${i.name}`,f,"error"===j.kind?`Error: ${j.error}`:"Click to inspect what's synced."];return(0,b.jsxs)(c.default,{href:"/team",title:l.join("\n"),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px 8px 20px",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",textDecoration:"none",minWidth:0},children:[(0,b.jsx)("span",{"aria-hidden":!0,suppressHydrationWarning:!0,style:{width:7,height:7,borderRadius:"50%",background:k,flexShrink:0,boxShadow:`0 0 0 2px color-mix(in srgb, ${k} 25%, transparent)`}}),(0,b.jsx)("span",{style:{flexShrink:0,fontWeight:500},children:"Team:"}),(0,b.jsx)("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.name}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0},suppressHydrationWarning:!0,children:d})]})}function E({href:a,active:d,icon:e,trailing:f,children:g}){return(0,b.jsxs)(c.default,{href:a,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:d?"var(--af-accent)":"var(--af-text-secondary)",background:d?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[e,(0,b.jsx)("span",{style:{flex:1},children:g}),f&&(0,b.jsx)("span",{style:{fontSize:10,color:d?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:f})]})}function F({label:a,items:d,pathname:e,isPinned:f,onTogglePin:g}){return 0===d.length?null:(0,b.jsxs)("div",{style:{marginTop:10},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:a}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:d.map(a=>{let d=`/projects/${encodeURIComponent(a.projectDir)}`,h=e===d,i=(0,q.prettyProjectName)(a.projectName);return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:h?"var(--af-accent-subtle)":"transparent",color:h?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,b.jsxs)(c.default,{href:d,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(a.worktreeCount??0)>0?`${a.projectName} — ${a.worktreeCount} worktree${1===a.worktreeCount?"":"s"}`:a.projectName,children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:i}),(a.worktreeCount??0)>0&&(0,b.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",a.worktreeCount," wt"]})]}),(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:a.sessionCount}),(0,b.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.projectDir)},"aria-label":f(a.projectDir)?"Unpin project":"Pin project",title:f(a.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:f(a.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:f(a.projectDir)?(0,b.jsx)(k,{size:12}):(0,b.jsx)(j,{size:12})}),a.lastActiveMs&&(0,b.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(a.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,q.formatRelative)(new Date(a.lastActiveMs).toISOString())})]},a.projectDir)})})]})}a.s(["Sidebar",0,function({projects:a,totalSessions:f,currentUsage:j,version:k,latestChangelogVersion:q,teamConnection:r}){let s=(0,d.usePathname)(),[t,v]=(0,e.useState)(new Set),[w,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)("");(0,e.useEffect)(()=>{v(new Set),y(!0)},[]);let C=a=>{v(b=>{let c=new Set(b);c.has(a)?c.delete(a):c.add(a);try{window.localStorage.setItem("claude-lens:pinned-projects:v1",JSON.stringify(Array.from(c)))}catch{}return c})},G=(0,e.useMemo)(()=>{if(!z.trim())return a;let b=z.toLowerCase();return a.filter(a=>a.projectName.toLowerCase().includes(b))},[a,z]),H=G.filter(a=>t.has(a.projectDir)),I=G.filter(a=>!t.has(a.projectDir));return(0,b.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,b.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,b.jsx)("span",{"aria-hidden":"true",style:{width:28,height:28,flex:"0 0 auto",background:'url("/icon.svg") center / contain no-repeat'}}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,b.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${k}`,children:["v",k]})]}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,b.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,b.jsx)(E,{href:"/",active:"/"===s,icon:(0,b.jsx)(g,{size:15}),children:"Overview"}),(0,b.jsx)(E,{href:"/sessions",active:"/sessions"===s||s.startsWith("/sessions/"),icon:(0,b.jsx)(h,{size:15}),trailing:f>0?String(f):void 0,children:"All sessions"}),(0,b.jsx)(E,{href:"/projects",active:"/projects"===s,icon:(0,b.jsx)(i.FolderOpen,{size:15}),trailing:a.length>0?String(a.length):void 0,children:"Projects"}),(0,b.jsx)(E,{href:"/day",active:"/day"===s||s.startsWith("/day/")||"/digest"===s||s.startsWith("/digest/")||"/parallelism"===s,icon:(0,b.jsx)(o.CalendarDays,{size:15}),children:"Day"}),(0,b.jsx)(E,{href:"/insights",active:"/insights"===s,icon:(0,b.jsx)(m.Lightbulb,{size:15}),children:"Insights"}),(0,b.jsx)(E,{href:"/agent",active:"/agent"===s||"/runs"===s||s.startsWith("/runs/"),icon:(0,b.jsx)(p.Sparkles,{size:15}),children:"Agent"})]}),(0,b.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,b.jsx)(l.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,b.jsx)("input",{type:"text",placeholder:"Search projects",value:z,onChange:a=>A(a.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,b.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[w&&H.length>0&&(0,b.jsx)(F,{label:"Pinned",items:H,pathname:s,isPinned:a=>t.has(a),onTogglePin:C}),(0,b.jsx)(F,{label:"Projects",items:I,pathname:s,isPinned:a=>t.has(a),onTogglePin:C})]}),(0,b.jsx)(x,{snapshot:j}),(0,b.jsx)(D,{connection:r}),(0,b.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,b.jsxs)("span",{style:{flex:1,minWidth:0},children:[f," sessions · ",a.length," projects"]}),(0,b.jsx)(B,{latestVersion:q,active:"/changelog"===s}),(0,b.jsx)(c.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===s?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===s?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,b.jsx)(n,{size:14})}),(0,b.jsx)(u,{})]})]})}],44422)},46069,a=>{"use strict";var b=a.i(50944),c=a.i(72131);a.s(["LiveRefresher",0,function(){let a,d=(0,b.useRouter)(),e=(a=(0,b.usePathname)(),a?.includes("/insights/print/")??!1),f=(0,c.useRef)(null),g=(0,c.useRef)({session:0,usage:0,team:0});return!function(a,b={}){let{enabled:d=!0}=b,e=(0,c.useRef)(a);(0,c.useEffect)(()=>{e.current=a},[a]),(0,c.useEffect)(()=>{if(!d)return;let a=new EventSource("/api/events");return a.onmessage=a=>{try{let b=JSON.parse(a.data);("session-updated"===b.type||"usage-updated"===b.type||"team-push"===b.type)&&e.current(b)}catch{}},a.onerror=()=>{},()=>{a.close()}},[d])}((0,c.useCallback)(a=>{let b="usage-updated"===a.type?"usage":"team-push"===a.type?"team":"session";a.mtimeMs<=(g.current[b]??0)||(g.current[b]=a.mtimeMs,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d.refresh()},400))},[d]),{enabled:!e}),(0,c.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]),null}],46069)},1568,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(3444),g=a.i(76285),h=a.i(99309),i=a.i(44220);let j="cclens-live-widget-expanded";a.s(["LiveSessionsWidget",0,function({sessions:a,entrySummaries:k={}}){let l=(0,d.usePathname)(),[m,n]=(0,c.useState)(()=>Date.now()),[o,p]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{try{let a=localStorage.getItem(j);null!==a&&p("true"===a)}catch{}},[]),(0,c.useEffect)(()=>{let a=setInterval(()=>n(Date.now()),1e4);return()=>clearInterval(a)},[]),l&&/^\/sessions\/[^/]+$/.test(l))return null;let q=a.filter(a=>{let b=a.lastTimestamp?Date.parse(a.lastTimestamp):NaN,c=Math.max(Number.isNaN(b)?0:b,a.lastActivityMs&&Number.isFinite(a.lastActivityMs)?a.lastActivityMs:0);return!(c<=0)&&m-c<=45e3}).slice().sort((a,b)=>{let c=a.firstTimestamp?Date.parse(a.firstTimestamp):0;return(b.firstTimestamp?Date.parse(b.firstTimestamp):0)-c});if(0===q.length)return null;let r=o?q.slice(0,5):[],s=o?q.length-r.length:0;return(0,b.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{var a;return a=a=>!a,void p(b=>{let c=a(b);try{localStorage.setItem(j,String(c))}catch{}return c})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:o?"Collapse":`Show ${q.length} live session${1===q.length?"":"s"}`,children:[(0,b.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",(0,b.jsx)("span",{suppressHydrationWarning:!0,children:q.length})]}),o&&s>0&&(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",s," more live"]}),r.map(a=>{let c=k[a.id];return(0,b.jsxs)(e.default,{href:`/sessions/${a.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(a.lastUserPreview||a.firstUserPreview||a.lastAgentPreview)??(0,f.prettyProjectName)(a.projectName),children:[c&&(0,b.jsx)("div",{onClick:a=>a.stopPropagation(),style:{marginBottom:4},children:c.outcome?(0,b.jsx)(i.OutcomePill,{outcome:c.outcome,size:"sm",label:"text",agent:a.agent}):"skipped_trivial"!==c.enrichmentStatus?(0,b.jsx)(i.OutcomePill,{outcome:null,pending:!0,sessionId:a.id,localDay:c.localDay,size:"sm",agent:a.agent}):null}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:a.lastUserPreview||a.firstUserPreview||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,b.jsx)(g.TeamBadge,{session:a,linkable:!1}),(0,b.jsx)(h.AgentBadge,{agent:a.agent})]}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:a.lastAgentPreview?(0,b.jsxs)(b.Fragment,{children:["↳ ",a.lastAgentPreview]}):(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,b.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,f.prettyProjectName)(a.projectName)})]},a.id)}),(0,b.jsx)("style",{children:`
|
|
2
2
|
@keyframes cs-live-pulse {
|
|
3
3
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|
4
4
|
50% { opacity: 0.4; transform: scale(0.85); }
|
package/app/apps/web/.next/server/chunks/ssr/apps_web_components_agent-chat_tsx_0xbtx2n._.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports=[71012,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(62180),e=a.i(58348),f=a.i(3444),g=a.i(60702),h=a.i(33441),i=a.i(70106);let j=(0,i.default)("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),k=(0,i.default)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),l=(0,i.default)("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var m=a.i(17545);let n=(0,i.default)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var o=a.i(96221);let p=(0,i.default)("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);var q=a.i(71727);let r=(0,i.default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var s=a.i(87532),t=a.i(92759);let u=(0,i.default)("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);var v=a.i(8406);let w=(0,i.default)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var x=a.i(33508);let y=[{label:"What did I work on yesterday?",category:"recap"},{label:"Find the sessions behind my most recent fix",category:"find"},{label:"Which projects did I touch this week, and what happened in each?",category:"synthesize"},{label:"Draft a prompt to continue my most recent feature work, with full context",category:"handoff"}],z={recap:(0,b.jsx)(g.CalendarDays,{size:13}),find:(0,b.jsx)(s.Search,{size:13}),synthesize:(0,b.jsx)(m.Layers,{size:13}),handoff:(0,b.jsx)(u,{size:13})},A={search_sessions:(0,b.jsx)(s.Search,{size:12}),get_session:(0,b.jsx)(k,{size:12}),list_sessions:(0,b.jsx)(n,{size:12}),list_projects:(0,b.jsx)(l,{size:12})};function B({text:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{style:{border:"1px solid var(--af-accent)",borderRadius:10,margin:"10px 0",overflow:"hidden",background:"var(--af-accent-subtle)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)(v.Sparkles,{size:13,color:"var(--af-accent)"}),(0,b.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--af-accent)",flex:1},children:"Handoff prompt — paste into your next agent session"}),(0,b.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(a).then(()=>{e(!0),setTimeout(()=>e(!1),2e3)}).catch(()=>{})},style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:6,border:"1px solid var(--af-accent)",background:d?"var(--af-accent)":"transparent",color:d?"#fff":"var(--af-accent)",fontSize:11.5,fontWeight:600,cursor:"pointer",transition:"all 0.12s"},children:[d?(0,b.jsx)(h.Check,{size:12}):(0,b.jsx)(j,{size:12}),d?"Copied":"Copy"]})]}),(0,b.jsx)("pre",{style:{margin:0,padding:"12px 14px",fontSize:12,lineHeight:1.55,fontFamily:"var(--font-mono)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:380,overflowY:"auto",color:"var(--af-text)",background:"var(--af-surface)"},children:a})]})}function C({text:a}){return(0,b.jsx)(d.default,{remarkPlugins:[e.default],components:{a:a=>{var c;return"text"==((c=a.href)?c.startsWith("/sessions/")?"session":/^https?:\/\//.test(c)?"external":"text":"text")?(0,b.jsx)(b.Fragment,{children:a.children}):(0,b.jsx)("a",{...a,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--af-accent)",textDecoration:"underline"}})},pre:a=>{let c=a.children;return(c?.props?.className??"").includes("language-prompt")?(0,b.jsx)(B,{text:String(c?.props?.children??"").replace(/\n$/,"")}):(0,b.jsx)("pre",{...a})}},children:a})}function D({seg:a}){let c;return(0,b.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:7,padding:"5px 10px",margin:"6px 0",borderRadius:7,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface-hover)",fontSize:11.5,fontFamily:"var(--font-mono)",color:a.isError?"var(--af-danger)":"var(--af-text-secondary)",maxWidth:"100%"},children:[(0,b.jsx)("span",{style:{color:"var(--af-accent)",flexShrink:0,display:"inline-flex"},children:A[a.name]??(0,b.jsx)(s.Search,{size:12})}),(0,b.jsx)("span",{style:{fontWeight:600,flexShrink:0},children:a.name}),(0,b.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:"string"==typeof(c=a.input??{}).query?`“${c.query}”`:"string"==typeof c.session_id?String(c.session_id).slice(0,18):Object.entries(c).filter(([,a])=>"string"==typeof a||"number"==typeof a).map(([a,b])=>`${a}=${b}`).join(" ").slice(0,60)}),a.done?(0,b.jsxs)("span",{style:{flexShrink:0,color:a.isError?"var(--af-danger)":"var(--af-text-tertiary)"},children:["→ ",a.isError?"error":a.brief??"done"]}):(0,b.jsx)(o.Loader2,{size:11,style:{flexShrink:0,animation:"spin 1s linear infinite"}})]})}function E(a){return a?`/agent?chat=${a}`:"/agent"}a.s(["AgentChat",0,function(){let[a,d]=(0,c.useState)([]),[e,g]=(0,c.useState)(null),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),[n,s]=(0,c.useState)(y),u=(0,c.useRef)(null),A=(0,c.useRef)(null),B=(0,c.useRef)(null),F=(0,c.useRef)(!0),G=e?.status==="running",H=(0,c.useCallback)(async()=>{try{let a=await fetch("/api/agent/chats"),b=await a.json();d(b.chats)}catch{}},[]),I=(0,c.useCallback)(()=>{F.current&&requestAnimationFrame(()=>{B.current?.scrollTo({top:B.current.scrollHeight})})},[]),J=(0,c.useCallback)(a=>{if(u.current?.abort(),"running"!==a.status)return;let b=new AbortController;u.current=b;let c=()=>b.signal.aborted||A.current!==a.id;(async()=>{let d=!1;try{let e=await fetch(`/api/agent/chats/${a.id}/events?after=${a.lastSeq}`,{signal:b.signal});if(!e.body)return;let f=e.body.getReader(),h=new TextDecoder,i="";for(;;){let{done:b,value:e}=await f.read();if(b)break;let j=(i+=h.decode(e,{stream:!0})).split("\n");for(let b of(i=j.pop()??"",j)){let e;if(b.startsWith("data: ")){try{e=JSON.parse(b.slice(6))}catch{continue}if("sync"===e.type){let b=await fetch(`/api/agent/chats/${a.id}`);b.ok&&!c()&&g(await b.json()),d=!0;continue}g(b=>b&&b.id===a.id?function(a,b){if(b.seq<=a.lastSeq)return a;let c=[...a.messages],d=c[c.length-1];d&&"assistant"===d.role||(d={role:"assistant",segments:[]},c.push(d));let e={...d,segments:[...d.segments]};c[c.length-1]=e;let f=a.status;switch(b.type){case"delta":{let a=e.segments[e.segments.length-1];a?.kind==="text"?e.segments[e.segments.length-1]={kind:"text",text:a.text+b.text}:e.segments.push({kind:"text",text:b.text});break}case"tool":e.segments.push({kind:"tool",id:b.id,name:b.name,input:b.input,done:!1});break;case"tool_result":e.segments=e.segments.map(a=>"tool"===a.kind&&a.id===b.id?{...a,brief:b.brief,isError:b.isError,done:!0}:a);break;case"done":f="idle",e.segments=e.segments.map(a=>"tool"!==a.kind||a.done?a:{...a,done:!0});break;case"error":f="error",e.segments=e.segments.map(a=>"tool"!==a.kind||a.done?a:{...a,done:!0}),e.segments.push({kind:"text",text:`
|
|
2
2
|
|
|
3
|
-
**Error:** ${b.message}`})}return{...a,messages:c,status:f,lastSeq:b.seq,updated_at:new Date().toISOString()}}(b,e):b),"delta"===e.type&&I(),("done"===e.type||"error"===e.type)&&(d=!0)}}}d&&H()}catch{}d||c()||setTimeout(()=>{c()||L.current(a.id,!1)},2e3)})()},[I,H]),K=(0,c.useCallback)(async(a,b=!0)=>{if(u.current?.abort(),A.current=a,b&&window.history.replaceState(null,"",E(a)),!a)return void g(null);try{let b=await fetch(`/api/agent/chats/${a}`);if(A.current!==a)return;if(!b.ok)return void g(null);let c=await b.json();if(A.current!==a)return;g(c),F.current=!0,I(),J(c)}catch{A.current===a&&g(null)}},[I,J]),L=(0,c.useRef)(K);L.current=K,(0,c.useEffect)(()=>{H();let a=new URLSearchParams(window.location.search).get("chat");return a&&K(a,!1),()=>u.current?.abort()},[]),(0,c.useEffect)(()=>{if(!a.some(a=>"running"===a.status))return;let b=setInterval(()=>void H(),5e3);return()=>clearInterval(b)},[a,H]),(0,c.useEffect)(()=>{if(!e||"running"!==e.status)return;let b=a.find(a=>a.id===e.id);b&&"running"!==b.status&&K(e.id,!1)},[a,e,K]);let M=(0,c.useCallback)(async()=>{m(a=>({sessions:a?.sessions??0,building:!0}));try{let a=await fetch("/api/agent/index",{method:"POST"});if(!a.body)return;let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n");for(let a of(d=f.pop()??"",f))if(a.startsWith("data: "))try{let b=JSON.parse(a.slice(6));"progress"===b.type?m({sessions:b.total??0,building:!0,progress:{built:b.built??0,total:b.total??0}}):"done"===b.type&&m({sessions:b.sessions??0,building:!1})}catch{}}}catch{m(a=>a?{...a,building:!1}:null)}},[]);(0,c.useEffect)(()=>{let a=!1;return fetch("/api/agent/index").then(a=>a.json()).then(b=>{!a&&(m({sessions:b.sessions,building:b.building}),0!==b.sessions||b.building||M())}).catch(()=>{}),()=>{a=!0}},[M]),(0,c.useEffect)(()=>{let a,b=!1,c=d=>{fetch("/api/agent/suggestions").then(a=>a.json()).then(e=>{!b&&(Array.isArray(e.suggestions)&&e.suggestions.length>0&&s(e.suggestions),e.refreshing&&d<2&&(a=setTimeout(()=>c(d+1),25e3)))}).catch(()=>{})};return c(0),()=>{b=!0,a&&clearTimeout(a)}},[]);let N=(0,c.useCallback)(async a=>{let b=a.trim();if(b&&!j&&!G){k(!0),i(""),F.current=!0;try{let a=e?.id;if(!a){let b=await fetch("/api/agent/chats",{method:"POST"});A.current=a=(await b.json()).id,window.history.replaceState(null,"",E(a))}let c=await fetch(`/api/agent/chats/${a}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b})});if(A.current!==a)return;if(!c.ok){let d=(await c.json().catch(()=>({}))).error??`HTTP ${c.status}`,f=e??await fetch(`/api/agent/chats/${a}`).then(a=>a.ok?a.json():null).catch(()=>null)??{version:1,id:a,title:b.replace(/\s+/g," ").trim().slice(0,80),created_at:new Date().toISOString(),updated_at:new Date().toISOString(),status:"idle",lastSeq:0,messages:[]};g({...f,messages:[...f.messages,{role:"user",text:b},{role:"assistant",segments:[{kind:"text",text:`**Error:** ${d}`}]}]}),H();return}let d=await c.json();g(d),I(),J(d),H()}finally{k(!1)}}},[e,j,G,I,J,H]),O=(0,c.useCallback)(()=>{e&&fetch(`/api/agent/chats/${e.id}/stop`,{method:"POST"})},[e]),P=(0,c.useCallback)(async a=>{await fetch(`/api/agent/chats/${a}`,{method:"DELETE"}),e?.id===a&&K(null),H()},[e?.id,K,H]),Q=l&&(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:100,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",whiteSpace:"nowrap"},children:l.building?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.Loader2,{size:11,style:{animation:"spin 1s linear infinite"}}),l.progress?`indexing ${l.progress.built}/${l.progress.total}`:"indexing…"]}):(0,b.jsxs)(b.Fragment,{children:[l.sessions.toLocaleString()," sessions indexed"]})}),R=!e||0===e.messages.length;return(0,b.jsxs)("div",{style:{height:"100%",display:"flex",minHeight:0},children:[(0,b.jsx)("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"}),(0,b.jsxs)("div",{style:{width:230,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",minHeight:0,background:"var(--af-surface)"},children:[(0,b.jsx)("div",{style:{padding:"12px 12px 8px"},children:(0,b.jsxs)("button",{type:"button",onClick:()=>void K(null),style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,padding:"8px 12px",borderRadius:8,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface-hover)",color:"var(--af-text)",fontSize:12.5,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:[(0,b.jsx)(p,{size:14}),"New chat"]})}),(0,b.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"0 8px 12px"},children:[0===a.length&&(0,b.jsx)("div",{style:{padding:"14px 8px",fontSize:11.5,color:"var(--af-text-tertiary)",lineHeight:1.5},children:"No conversations yet. Runs keep going even if you leave the page."}),a.map(a=>{let c=a.id===e?.id;return(0,b.jsxs)("div",{onClick:()=>void K(a.id),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",marginBottom:2,borderRadius:8,cursor:"pointer",background:c?"var(--af-accent-subtle)":"transparent",border:`1px solid ${c?"var(--af-accent)":"transparent"}`},children:[(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsx)("div",{style:{fontSize:12,fontWeight:c?600:500,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.title}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:2},children:["running"===a.status&&(0,b.jsx)(o.Loader2,{size:10,color:"var(--af-accent)",style:{animation:"spin 1s linear infinite"}}),"error"===a.status&&(0,b.jsx)("span",{style:{width:6,height:6,borderRadius:3,background:"var(--af-danger)"}}),(0,b.jsx)("span",{style:{fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:"running"===a.status?"running":(0,f.formatRelative)(a.updated_at)})]})]}),(0,b.jsx)("button",{type:"button",title:"Delete conversation",onClick:b=>{b.stopPropagation(),P(a.id)},style:{border:"none",background:"transparent",color:"var(--af-text-tertiary)",cursor:"pointer",padding:2,borderRadius:4,flexShrink:0},children:(0,b.jsx)(x.X,{size:12})})]},a.id)})]})]}),(0,b.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0,minWidth:0},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 28px",borderBottom:"1px solid var(--af-border-subtle)",background:"color-mix(in srgb, var(--background) 82%, transparent)",backdropFilter:"blur(10px)",flexShrink:0},children:[(0,b.jsx)(v.Sparkles,{size:16,color:"var(--af-accent)"}),(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)"},children:"Agent"}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Search, synthesize, and hand off your local session history"})]}),Q,(0,b.jsxs)("a",{href:"/runs",title:"LLM runs — inspect every local model call",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"6px 10px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"transparent",color:"var(--af-text-tertiary)",fontSize:11.5,textDecoration:"none"},children:[(0,b.jsx)(q.Radio,{size:13}),"Runs"]}),(0,b.jsx)("button",{type:"button",title:"Refresh search index",onClick:()=>void M(),disabled:l?.building??!1,style:{display:"inline-flex",alignItems:"center",padding:6,borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"transparent",color:"var(--af-text-tertiary)",cursor:l?.building?"wait":"pointer"},children:(0,b.jsx)(r,{size:13})})]}),(0,b.jsx)("div",{ref:B,onScroll:()=>{let a=B.current;a&&(F.current=a.scrollHeight-a.scrollTop-a.clientHeight<80)},style:{flex:1,minHeight:0,overflowY:"auto",padding:"22px 28px"},children:(0,b.jsxs)("div",{style:{maxWidth:780,margin:"0 auto",display:"flex",flexDirection:"column",gap:18},children:[R&&(0,b.jsxs)("div",{style:{paddingTop:48,textAlign:"center"},children:[(0,b.jsx)(v.Sparkles,{size:26,color:"var(--af-accent)",style:{marginBottom:12}}),(0,b.jsx)("div",{style:{fontSize:15,fontWeight:600,color:"var(--af-text)",marginBottom:6},children:"Ask anything about your past sessions"}),(0,b.jsxs)("div",{style:{fontSize:12.5,color:"var(--af-text-secondary)",marginBottom:26,lineHeight:1.5},children:["Every conversation is searched locally — nothing leaves this machine.",(0,b.jsx)("br",{}),"Find past work, get it synthesized, or turn it into a prompt for your next agent run."]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:520,margin:"0 auto"},children:n.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>void N(a.label),disabled:j,style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)",color:"var(--af-text)",fontSize:12.5,cursor:j?"wait":"pointer",textAlign:"left",transition:"all 0.12s",fontFamily:"inherit"},onMouseEnter:a=>{a.currentTarget.style.borderColor="var(--af-accent)",a.currentTarget.style.background="var(--af-accent-subtle)"},onMouseLeave:a=>{a.currentTarget.style.borderColor="var(--af-border-subtle)",a.currentTarget.style.background="var(--af-surface)"},children:[(0,b.jsx)("span",{style:{color:"var(--af-accent)",flexShrink:0,display:"inline-flex"},children:z[a.category]}),a.label]},a.category))})]}),e?.messages.map((a,c)=>"user"===a.role?(0,b.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,b.jsx)("div",{style:{maxWidth:"82%",padding:"9px 14px",borderRadius:12,background:"var(--af-surface-hover)",border:"1px solid var(--af-border-subtle)",fontSize:13,lineHeight:1.5,color:"var(--af-text)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a.text})},c):(0,b.jsxs)("div",{style:{minWidth:0},children:[0===a.segments.length&&G&&c===e.messages.length-1&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--af-text-tertiary)",fontSize:12},children:[(0,b.jsx)(o.Loader2,{size:13,style:{animation:"spin 1s linear infinite"}}),"Thinking…"]}),a.segments.map((a,c)=>"tool"===a.kind?(0,b.jsx)("div",{children:(0,b.jsx)(D,{seg:a})},c):(0,b.jsx)("div",{className:"sl-prose",style:{fontSize:13.5,lineHeight:1.6},children:(0,b.jsx)(C,{text:a.text})},c))]},c))]})}),(0,b.jsx)("div",{style:{borderTop:"1px solid var(--af-border-subtle)",padding:"14px 28px 18px",background:"var(--background)",flexShrink:0},children:(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),N(h)},style:{maxWidth:780,margin:"0 auto",display:"flex",gap:8,alignItems:"flex-end"},children:[(0,b.jsx)("textarea",{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||(a.preventDefault(),N(h))},placeholder:G?"The agent is working — you can leave this page and come back…":"Search your session history, ask for a synthesis, or request a handoff prompt…",rows:Math.min(4,Math.max(1,h.split("\n").length)),style:{flex:1,resize:"none",padding:"10px 14px",borderRadius:10,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text)",fontSize:13,lineHeight:1.5,fontFamily:"inherit",outline:"none"}}),G?(0,b.jsx)("button",{type:"button",onClick:O,title:"Stop this run",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:10,border:"1px solid var(--af-danger)",background:"transparent",color:"var(--af-danger)",cursor:"pointer",flexShrink:0},children:(0,b.jsx)(w,{size:14})}):(0,b.jsx)("button",{type:"submit",disabled:!h.trim()||j,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:10,border:"none",background:h.trim()&&!j?"var(--af-accent)":"var(--af-border-subtle)",color:h.trim()&&!j?"#fff":"var(--af-text-tertiary)",cursor:h.trim()&&!j?"pointer":"not-allowed",flexShrink:0},children:(0,b.jsx)(t.Send,{size:15})})]})})]})]})}],71012)}];
|
|
3
|
+
**Error:** ${b.message}`})}return{...a,messages:c,status:f,lastSeq:b.seq,updated_at:new Date().toISOString()}}(b,e):b),"delta"===e.type&&I(),("done"===e.type||"error"===e.type)&&(d=!0)}}}d&&H()}catch{}d||c()||setTimeout(()=>{c()||L.current(a.id,!1)},2e3)})()},[I,H]),K=(0,c.useCallback)(async(a,b=!0)=>{if(u.current?.abort(),A.current=a,b&&window.history.replaceState(null,"",E(a)),!a)return void g(null);try{let b=await fetch(`/api/agent/chats/${a}`);if(A.current!==a)return;if(!b.ok)return void g(null);let c=await b.json();if(A.current!==a)return;g(c),F.current=!0,I(),J(c)}catch{A.current===a&&g(null)}},[I,J]),L=(0,c.useRef)(K);L.current=K,(0,c.useEffect)(()=>{H();let a=new URLSearchParams(window.location.search).get("chat");return a&&K(a,!1),()=>u.current?.abort()},[]),(0,c.useEffect)(()=>{if(!a.some(a=>"running"===a.status))return;let b=setInterval(()=>void H(),5e3);return()=>clearInterval(b)},[a,H]),(0,c.useEffect)(()=>{if(!e||"running"!==e.status)return;let b=a.find(a=>a.id===e.id);b&&"running"!==b.status&&K(e.id,!1)},[a,e,K]);let M=(0,c.useCallback)(async()=>{m(a=>({sessions:a?.sessions??0,building:!0}));try{let a=await fetch("/api/agent/index",{method:"POST"});if(!a.body)return;let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n");for(let a of(d=f.pop()??"",f))if(a.startsWith("data: "))try{let b=JSON.parse(a.slice(6));"progress"===b.type?m({sessions:b.total??0,building:!0,progress:{built:b.built??0,total:b.total??0}}):"done"===b.type&&m({sessions:b.sessions??0,building:!1})}catch{}}}catch{m(a=>a?{...a,building:!1}:null)}},[]);(0,c.useEffect)(()=>{let a=!1;return fetch("/api/agent/index").then(a=>a.json()).then(b=>{!a&&(m({sessions:b.sessions,building:b.building}),0!==b.sessions||b.building||M())}).catch(()=>{}),()=>{a=!0}},[M]),(0,c.useEffect)(()=>{let a,b=!1,c=d=>{fetch("/api/agent/suggestions").then(a=>a.json()).then(e=>{!b&&(Array.isArray(e.suggestions)&&e.suggestions.length>0&&s(e.suggestions),e.refreshing&&d<2&&(a=setTimeout(()=>c(d+1),25e3)))}).catch(()=>{})};return c(0),()=>{b=!0,a&&clearTimeout(a)}},[]);let N=(0,c.useCallback)(async a=>{let b=a.trim();if(b&&!j&&!G){k(!0),i(""),F.current=!0;try{let a=e?.id;if(!a){let b=await fetch("/api/agent/chats",{method:"POST"});A.current=a=(await b.json()).id,window.history.replaceState(null,"",E(a))}let c=await fetch(`/api/agent/chats/${a}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b})});if(A.current!==a)return;if(!c.ok){let d=(await c.json().catch(()=>({}))).error??`HTTP ${c.status}`,f=e??await fetch(`/api/agent/chats/${a}`).then(a=>a.ok?a.json():null).catch(()=>null)??{version:1,id:a,title:b.replace(/\s+/g," ").trim().slice(0,80),created_at:new Date().toISOString(),updated_at:new Date().toISOString(),status:"idle",lastSeq:0,messages:[]};g({...f,messages:[...f.messages,{role:"user",text:b},{role:"assistant",segments:[{kind:"text",text:`**Error:** ${d}`}]}]}),H();return}let d=await c.json();g(d),I(),J(d),H()}finally{k(!1)}}},[e,j,G,I,J,H]),O=(0,c.useCallback)(()=>{e&&fetch(`/api/agent/chats/${e.id}/stop`,{method:"POST"})},[e]),P=(0,c.useCallback)(async a=>{await fetch(`/api/agent/chats/${a}`,{method:"DELETE"}),e?.id===a&&K(null),H()},[e?.id,K,H]),Q=l&&(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:100,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",whiteSpace:"nowrap"},children:l.building?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.Loader2,{size:11,style:{animation:"spin 1s linear infinite"}}),l.progress?`indexing ${l.progress.built}/${l.progress.total}`:"indexing…"]}):(0,b.jsxs)(b.Fragment,{children:[l.sessions.toLocaleString()," sessions indexed"]})}),R=!e||0===e.messages.length;return(0,b.jsxs)("div",{style:{height:"100%",display:"flex",minHeight:0},children:[(0,b.jsx)("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"}),(0,b.jsxs)("div",{style:{width:230,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",minHeight:0,background:"var(--af-surface)"},children:[(0,b.jsx)("div",{style:{padding:"12px 12px 8px"},children:(0,b.jsxs)("button",{type:"button",onClick:()=>void K(null),style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,padding:"8px 12px",borderRadius:8,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface-hover)",color:"var(--af-text)",fontSize:12.5,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:[(0,b.jsx)(p,{size:14}),"New chat"]})}),(0,b.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:"0 8px 12px"},children:[0===a.length&&(0,b.jsx)("div",{style:{padding:"14px 8px",fontSize:11.5,color:"var(--af-text-tertiary)",lineHeight:1.5},children:"No conversations yet. Runs keep going even if you leave the page."}),a.map(a=>{let c=a.id===e?.id;return(0,b.jsxs)("div",{onClick:()=>void K(a.id),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",marginBottom:2,borderRadius:8,cursor:"pointer",background:c?"var(--af-accent-subtle)":"transparent",border:`1px solid ${c?"var(--af-accent)":"transparent"}`},children:[(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsx)("div",{style:{fontSize:12,fontWeight:c?600:500,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.title}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:2},children:["running"===a.status&&(0,b.jsx)(o.Loader2,{size:10,color:"var(--af-accent)",style:{animation:"spin 1s linear infinite"}}),"error"===a.status&&(0,b.jsx)("span",{style:{width:6,height:6,borderRadius:3,background:"var(--af-danger)"}}),(0,b.jsx)("span",{style:{fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:"running"===a.status?"running":(0,f.formatRelative)(a.updated_at)})]})]}),(0,b.jsx)("button",{type:"button",title:"Delete conversation",onClick:b=>{b.stopPropagation(),P(a.id)},style:{border:"none",background:"transparent",color:"var(--af-text-tertiary)",cursor:"pointer",padding:2,borderRadius:4,flexShrink:0},children:(0,b.jsx)(x.X,{size:12})})]},a.id)})]})]}),(0,b.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0,minWidth:0},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 28px",borderBottom:"1px solid var(--af-border-subtle)",background:"color-mix(in srgb, var(--background) 82%, transparent)",backdropFilter:"blur(10px)",flexShrink:0},children:[(0,b.jsx)(v.Sparkles,{size:16,color:"var(--af-accent)"}),(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)"},children:"Agent"}),(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Search, synthesize, and hand off your local session history"})]}),Q,(0,b.jsxs)("a",{href:"/runs",title:"LLM runs — inspect every local model call",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"6px 10px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"transparent",color:"var(--af-text-tertiary)",fontSize:11.5,textDecoration:"none"},children:[(0,b.jsx)(q.Radio,{size:13}),"Runs"]}),(0,b.jsx)("button",{type:"button",title:"Refresh search index",onClick:()=>void M(),disabled:l?.building??!1,style:{display:"inline-flex",alignItems:"center",padding:6,borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"transparent",color:"var(--af-text-tertiary)",cursor:l?.building?"wait":"pointer"},children:(0,b.jsx)(r,{size:13})})]}),(0,b.jsx)("div",{ref:B,onScroll:()=>{let a=B.current;a&&(F.current=a.scrollHeight-a.scrollTop-a.clientHeight<80)},style:{flex:1,minHeight:0,overflowY:"auto",padding:"22px 28px"},children:(0,b.jsxs)("div",{style:{maxWidth:780,margin:"0 auto",display:"flex",flexDirection:"column",gap:18},children:[R&&(0,b.jsxs)("div",{style:{paddingTop:48,textAlign:"center"},children:[(0,b.jsx)(v.Sparkles,{size:26,color:"var(--af-accent)",style:{marginBottom:12}}),(0,b.jsx)("div",{style:{fontSize:15,fontWeight:600,color:"var(--af-text)",marginBottom:6},children:"Ask anything about your past sessions"}),(0,b.jsxs)("div",{style:{fontSize:12.5,color:"var(--af-text-secondary)",marginBottom:26,lineHeight:1.5},children:["Search runs locally against your transcripts; synthesis uses your local claude CLI with your existing Claude Code account.",(0,b.jsx)("br",{}),"Find past work, get it synthesized, or turn it into a prompt for your next agent run."]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:520,margin:"0 auto"},children:n.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>void N(a.label),disabled:j,style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)",color:"var(--af-text)",fontSize:12.5,cursor:j?"wait":"pointer",textAlign:"left",transition:"all 0.12s",fontFamily:"inherit"},onMouseEnter:a=>{a.currentTarget.style.borderColor="var(--af-accent)",a.currentTarget.style.background="var(--af-accent-subtle)"},onMouseLeave:a=>{a.currentTarget.style.borderColor="var(--af-border-subtle)",a.currentTarget.style.background="var(--af-surface)"},children:[(0,b.jsx)("span",{style:{color:"var(--af-accent)",flexShrink:0,display:"inline-flex"},children:z[a.category]}),a.label]},a.category))})]}),e?.messages.map((a,c)=>"user"===a.role?(0,b.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,b.jsx)("div",{style:{maxWidth:"82%",padding:"9px 14px",borderRadius:12,background:"var(--af-surface-hover)",border:"1px solid var(--af-border-subtle)",fontSize:13,lineHeight:1.5,color:"var(--af-text)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a.text})},c):(0,b.jsxs)("div",{style:{minWidth:0},children:[0===a.segments.length&&G&&c===e.messages.length-1&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,color:"var(--af-text-tertiary)",fontSize:12},children:[(0,b.jsx)(o.Loader2,{size:13,style:{animation:"spin 1s linear infinite"}}),"Thinking…"]}),a.segments.map((a,c)=>"tool"===a.kind?(0,b.jsx)("div",{children:(0,b.jsx)(D,{seg:a})},c):(0,b.jsx)("div",{className:"sl-prose",style:{fontSize:13.5,lineHeight:1.6},children:(0,b.jsx)(C,{text:a.text})},c))]},c))]})}),(0,b.jsx)("div",{style:{borderTop:"1px solid var(--af-border-subtle)",padding:"14px 28px 18px",background:"var(--background)",flexShrink:0},children:(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),N(h)},style:{maxWidth:780,margin:"0 auto",display:"flex",gap:8,alignItems:"flex-end"},children:[(0,b.jsx)("textarea",{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||(a.preventDefault(),N(h))},placeholder:G?"The agent is working — you can leave this page and come back…":"Search your session history, ask for a synthesis, or request a handoff prompt…",rows:Math.min(4,Math.max(1,h.split("\n").length)),style:{flex:1,resize:"none",padding:"10px 14px",borderRadius:10,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text)",fontSize:13,lineHeight:1.5,fontFamily:"inherit",outline:"none"}}),G?(0,b.jsx)("button",{type:"button",onClick:O,title:"Stop this run",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:10,border:"1px solid var(--af-danger)",background:"transparent",color:"var(--af-danger)",cursor:"pointer",flexShrink:0},children:(0,b.jsx)(w,{size:14})}):(0,b.jsx)("button",{type:"submit",disabled:!h.trim()||j,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:10,border:"none",background:h.trim()&&!j?"var(--af-accent)":"var(--af-border-subtle)",color:h.trim()&&!j?"#fff":"var(--af-text-tertiary)",cursor:h.trim()&&!j?"pointer":"not-allowed",flexShrink:0},children:(0,b.jsx)(t.Send,{size:15})})]})})]})]})}],71012)}];
|
|
4
4
|
|
|
5
5
|
//# sourceMappingURL=apps_web_components_agent-chat_tsx_0xbtx2n._.js.map
|