@hirra/vibemeter 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  20. package/.next/server/app/admin/page.js.nft.json +1 -1
  21. package/.next/server/app/api/codex-accounts/route.js.nft.json +1 -1
  22. package/.next/server/app/api/import-sessions/route.js.nft.json +1 -1
  23. package/.next/server/app/api/usage/route.js +1 -1
  24. package/.next/server/app/api/usage/route.js.nft.json +1 -1
  25. package/.next/server/app/page.js.nft.json +1 -1
  26. package/.next/server/app/page_client-reference-manifest.js +1 -1
  27. package/.next/server/chunks/[root-of-the-server]__0chedn~._.js +1 -1
  28. package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js +62 -0
  29. package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js.map +1 -0
  30. package/.next/server/chunks/{[root-of-the-server]__0ade2u0._.js → [root-of-the-server]__0y68a5d._.js} +5 -5
  31. package/.next/server/chunks/[root-of-the-server]__0y68a5d._.js.map +1 -0
  32. package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js +8 -8
  33. package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js.map +1 -1
  34. package/.next/server/chunks/ssr/_0ye~8el._.js +1 -1
  35. package/.next/server/chunks/ssr/_0ye~8el._.js.map +1 -1
  36. package/.next/server/middleware-build-manifest.js +3 -3
  37. package/.next/server/pages/404.html +1 -1
  38. package/.next/server/pages/500.html +1 -1
  39. package/.next/server/server-reference-manifest.js +1 -1
  40. package/.next/server/server-reference-manifest.json +1 -1
  41. package/.next/static/chunks/{05t54y~yfn5og.js → 0erq0bmub6w_z.js} +1 -1
  42. package/bin/require-hook.cjs +11 -0
  43. package/bin/vibemeter.mjs +9 -1
  44. package/package.json +17 -4
  45. package/.next/server/chunks/[root-of-the-server]__0ade2u0._.js.map +0 -1
  46. package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js +0 -63
  47. package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js.map +0 -1
  48. /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → Ong62ufsHaRU36s0QK5ZZ}/_buildManifest.js +0 -0
  49. /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → Ong62ufsHaRU36s0QK5ZZ}/_clientMiddlewareManifest.js +0 -0
  50. /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → Ong62ufsHaRU36s0QK5ZZ}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/%40swc/helpers/cjs/_interop_require_wildcard.cjs","../../../../node_modules/next/dist/client/app-dir/link.js/__nextjs-internal-proxy.cjs","../../../../node_modules/next/src/client/app-dir/link.tsx","../../../../node_modules/next/src/client/app-dir/link.react-server.tsx","../../../../src/lib/codex-auth.ts","../../../../src/app/favicon.ico.mjs%20%28structured%20image%20object%29","../../../../src/components/Dashboard.tsx/__nextjs-internal-proxy.mjs","../../../../src/lib/db.ts","../../../../src/lib/data-dir.ts","../../../../src/lib/db-bootstrap.ts","../../../../src/app/page.tsx","../../../../src/lib/stats.ts","../../../../src/lib/usage-snapshots.ts"],"sourcesContent":["\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nconst { createClientModuleProxy } = require(\"react-server-dom-turbopack/server\");\n\n__turbopack_context__.n(createClientModuleProxy(\"[project]/node_modules/next/dist/client/app-dir/link.js\"));\n","'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport { errorOnce } from '../../shared/lib/utils/error-once'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[]\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n","import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n","import { mkdir, readFile, rename, readdir, stat, unlink, writeFile } from 'node:fs/promises';\nimport { readFileSync, statSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\n\ninterface CodexAuthFile {\n auth_mode?: unknown;\n OPENAI_API_KEY?: unknown;\n tokens?: {\n id_token?: unknown;\n access_token?: unknown;\n refresh_token?: unknown;\n account_id?: unknown;\n };\n last_refresh?: unknown;\n}\n\nexport interface CodexAccountSummary {\n accountId: string;\n label: string;\n email: string | null;\n name: string | null;\n planType: string | null;\n userId: string | null;\n lastRefresh: string | null;\n idTokenExpiresAt: string | null;\n accessTokenExpiresAt: string | null;\n storedAt: string | null;\n isCurrent: boolean;\n}\n\nexport interface CodexAuthPaths {\n authPath?: string;\n storeDir?: string;\n}\n\nexport interface CurrentCodexAccount {\n accountId: string;\n authMtimeMs: number;\n}\n\nconst AUTH_CLAIMS_KEY = 'https://api.openai.com/auth';\n\nfunction defaultAuthPath() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth.json');\n}\n\nfunction defaultStoreDir() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth-accounts');\n}\n\nfunction resolvePaths(paths: CodexAuthPaths = {}) {\n return {\n authPath: paths.authPath ?? defaultAuthPath(),\n storeDir: paths.storeDir ?? defaultStoreDir(),\n };\n}\n\nfunction accountPath(accountId: string, storeDir: string) {\n return path.join(/* turbopackIgnore: true */ storeDir, `${accountId.replace(/[^a-zA-Z0-9_-]/g, '_')}.json`);\n}\n\nasync function readAuthFile(filePath: string): Promise<CodexAuthFile> {\n const raw = await readFile(filePath, 'utf8');\n const parsed = JSON.parse(raw) as CodexAuthFile;\n if (!parsed.tokens || typeof parsed.tokens.account_id !== 'string') {\n throw new Error('Codex auth file is missing tokens.account_id');\n }\n return parsed;\n}\n\nasync function writeJsonAtomic(filePath: string, data: unknown) {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmp, `${JSON.stringify(data, null, 2)}\\n`, { encoding: 'utf8', mode: 0o600 });\n await rename(tmp, filePath);\n}\n\nfunction decodeJwtPayload(token: unknown): Record<string, unknown> | null {\n if (typeof token !== 'string') return null;\n const [, payload] = token.split('.');\n if (!payload) return null;\n\n try {\n return JSON.parse(Buffer.from(payload, 'base64url').toString('utf8')) as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\nfunction stringClaim(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null;\n}\n\nfunction expiryClaim(value: unknown): string | null {\n return typeof value === 'number' ? new Date(value * 1000).toISOString() : null;\n}\n\nfunction summarizeAuth(auth: CodexAuthFile, storedAt: string | null, currentAccountId: string | null): CodexAccountSummary {\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) throw new Error('Codex auth file is missing tokens.account_id');\n\n const idPayload = decodeJwtPayload(auth.tokens?.id_token);\n const accessPayload = decodeJwtPayload(auth.tokens?.access_token);\n const idAuthClaims = idPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n const accessAuthClaims = accessPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n\n const email = stringClaim(idPayload?.email);\n const name = stringClaim(idPayload?.name);\n const planType = stringClaim(idAuthClaims?.chatgpt_plan_type) ?? stringClaim(accessAuthClaims?.chatgpt_plan_type);\n const userId = stringClaim(idAuthClaims?.user_id) ?? stringClaim(accessAuthClaims?.user_id);\n const label = email ?? name ?? `${accountId.slice(0, 8)}...${accountId.slice(-4)}`;\n\n return {\n accountId,\n label,\n email,\n name,\n planType,\n userId,\n lastRefresh: stringClaim(auth.last_refresh),\n idTokenExpiresAt: expiryClaim(idPayload?.exp),\n accessTokenExpiresAt: expiryClaim(accessPayload?.exp),\n storedAt,\n isCurrent: accountId === currentAccountId,\n };\n}\n\nexport async function getCodexAccounts(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary[]> {\n const { authPath, storeDir } = resolvePaths(paths);\n let currentAccountId: string | null = null;\n let currentAuth: CodexAuthFile | null = null;\n\n try {\n currentAuth = await readAuthFile(authPath);\n currentAccountId = stringClaim(currentAuth.tokens?.account_id);\n } catch {\n currentAuth = null;\n }\n\n const accounts = new Map<string, CodexAccountSummary>();\n\n try {\n const entries = await readdir(storeDir);\n for (const entry of entries) {\n if (!entry.endsWith('.json')) continue;\n const filePath = path.join(storeDir, entry);\n try {\n const storedAuth = await readAuthFile(filePath);\n const storedStat = await stat(filePath);\n const summary = summarizeAuth(storedAuth, storedStat.mtime.toISOString(), currentAccountId);\n accounts.set(summary.accountId, summary);\n } catch {\n // Ignore malformed account snapshots so one bad file does not break the admin page.\n }\n }\n } catch {\n // Missing store just means no saved accounts yet.\n }\n\n if (currentAuth && currentAccountId && !accounts.has(currentAccountId)) {\n accounts.set(currentAccountId, summarizeAuth(currentAuth, null, currentAccountId));\n }\n\n return [...accounts.values()].sort((a, b) => {\n if (a.isCurrent !== b.isCurrent) return a.isCurrent ? -1 : 1;\n return a.label.localeCompare(b.label);\n });\n}\n\nexport function getCurrentCodexAccount(paths: CodexAuthPaths = {}): CurrentCodexAccount | null {\n const { authPath } = resolvePaths(paths);\n try {\n const auth = JSON.parse(readFileSync(authPath, 'utf8')) as CodexAuthFile;\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) return null;\n return {\n accountId,\n authMtimeMs: statSync(authPath).mtimeMs,\n };\n } catch {\n return null;\n }\n}\n\nexport async function importCurrentCodexAuth(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary> {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath);\n const accountId = auth.tokens?.account_id as string;\n const destination = accountPath(accountId, storeDir);\n await writeJsonAtomic(destination, auth);\n const storedStat = await stat(destination);\n return summarizeAuth(auth, storedStat.mtime.toISOString(), accountId);\n}\n\nexport async function switchCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const source = accountPath(accountId, storeDir);\n const auth = await readAuthFile(source);\n const sourceAccountId = auth.tokens?.account_id;\n if (sourceAccountId !== accountId) {\n throw new Error('Stored account id does not match requested account');\n }\n\n let backupPath: string | null = null;\n try {\n const current = await readFile(authPath, 'utf8');\n backupPath = `${authPath}.${new Date().toISOString().replace(/[:.]/g, '-')}.bak`;\n await writeFile(backupPath, current, { encoding: 'utf8', mode: 0o600 });\n } catch {\n backupPath = null;\n }\n\n await writeJsonAtomic(authPath, auth);\n return {\n ...summarizeAuth(auth, null, accountId),\n backupPath,\n };\n}\n\nexport async function deleteCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath).catch(() => null);\n if (auth?.tokens?.account_id === accountId) {\n throw new Error('Cannot delete the currently active Codex account');\n }\n await unlink(accountPath(accountId, storeDir));\n}\n","import src from \"IMAGE\";\nexport default { src, width: 256, height: 256 }\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const Dashboard = registerClientReference(\n function() { throw new Error(\"Attempted to call Dashboard() from the server but Dashboard 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.\"); },\n \"[project]/src/components/Dashboard.tsx\",\n \"Dashboard\",\n);\n","import Database from 'better-sqlite3';\nimport path from 'path';\nimport fs from 'fs';\nimport { dataDir } from './data-dir';\nimport { bootstrap } from './db-bootstrap';\n\nlet _db: Database.Database | null = null;\n\nexport function getDb(): Database.Database {\n if (_db) return _db;\n const dir = dataDir();\n fs.mkdirSync(dir, { recursive: true });\n _db = new Database(path.join(dir, 'continuity.sqlite'));\n _db.pragma('journal_mode = WAL');\n bootstrap(_db);\n return _db;\n}\n","import path from 'path';\n\n/**\n * Where Vibemeter stores its SQLite DB and statusline snapshot.\n *\n * - When installed via `npx @hirra/vibemeter`: the bin script sets\n * VIBEMETER_DATA_DIR to `~/.vibemeter` for a stable user-data location.\n * - In local development from a checkout: defaults to `<cwd>/.data`.\n */\nexport function dataDir(): string {\n return process.env.VIBEMETER_DATA_DIR ?? path.join(process.cwd(), '.data');\n}\n","import type Database from 'better-sqlite3';\n\nexport function bootstrap(db: Database.Database): void {\n db.exec(`\n CREATE TABLE IF NOT EXISTS sessions (\n id TEXT PRIMARY KEY,\n tool TEXT NOT NULL,\n started_at INTEGER NOT NULL,\n ended_at INTEGER,\n exit_code INTEGER,\n cwd TEXT,\n cli_args TEXT,\n summary TEXT,\n confidence TEXT NOT NULL DEFAULT 'medium'\n );\n\n CREATE TABLE IF NOT EXISTS usage_snapshots (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n captured_at INTEGER NOT NULL,\n source TEXT NOT NULL,\n account_id TEXT,\n window_5h_used_pct REAL,\n window_weekly_used_pct REAL,\n reset_at_5h INTEGER,\n reset_at_weekly INTEGER,\n raw_output TEXT,\n confidence TEXT NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS file_changes (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT NOT NULL,\n path TEXT NOT NULL,\n change_type TEXT NOT NULL,\n detected_at INTEGER NOT NULL,\n FOREIGN KEY (session_id) REFERENCES sessions(id)\n );\n `);\n\n // Idempotent column additions (SQLite has no ADD COLUMN IF NOT EXISTS)\n const addCol = (table: string, col: string, def: string) => {\n try { db.exec(`ALTER TABLE ${table} ADD COLUMN ${col} ${def}`); } catch { /* already exists */ }\n };\n addCol('sessions', 'ai_title', 'TEXT');\n addCol('sessions', 'tags', 'TEXT DEFAULT \"[]\"');\n addCol('sessions', 'codex_category', 'TEXT');\n addCol('sessions', 'tokens_used', 'INTEGER');\n addCol('usage_snapshots', 'account_id', 'TEXT');\n\n db.exec(`\n CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);\n `);\n}\n","export const dynamic = 'force-dynamic';\n\nimport { getDb } from '@/lib/db';\nimport { Dashboard } from '@/components/Dashboard';\nimport Link from 'next/link';\nimport { activityStreak, burndownPoints, fileHotspots, spendingStats, dayTimeline, achievements } from '@/lib/stats';\nimport type { SessionRow } from '@/lib/schema';\nimport { getCodexAccounts } from '@/lib/codex-auth';\nimport { getLatestUsageSnapshot } from '@/lib/usage-snapshots';\n\nconst DEMO_PROJECTS = [\n 'kanban-board', 'pomodoro', 'weather-widget', 'recipe-box', 'mood-journal',\n 'habit-tracker', 'flashcards', 'spelling-bee', 'budget-app', 'markdown-blog',\n 'todo-cli', 'music-player', 'photo-gallery', 'note-vault', 'expense-split',\n];\n\nconst DEMO_TITLES = [\n 'add dark mode toggle',\n 'refactor router boundaries',\n 'fix mobile layout overflow',\n 'wire up websocket reconnect',\n 'optimize image lazy loading',\n 'migrate to server components',\n 'tighten type signatures',\n 'investigate flaky e2e tests',\n 'add keyboard shortcuts',\n 'improve empty states',\n];\n\nfunction anonymize<T extends { cwd: string | null; ai_title: string | null; id: string }>(\n rows: T[],\n): T[] {\n const projectMap = new Map<string, string>();\n return rows.map((s, i) => {\n if (!s.cwd) return s;\n const base = s.cwd.split('/').filter(Boolean).pop() ?? '';\n if (!projectMap.has(base)) {\n projectMap.set(base, DEMO_PROJECTS[projectMap.size % DEMO_PROJECTS.length]);\n }\n return {\n ...s,\n cwd: `/Users/demo/code/${projectMap.get(base)}`,\n ai_title: s.ai_title ? DEMO_TITLES[i % DEMO_TITLES.length] : null,\n };\n });\n}\n\nfunction injectMockCursorSessions<T extends { id: string; tool: string; started_at: number; ended_at: number | null; cwd: string | null; confidence: string; summary: string | null; ai_title: string | null; tags: string | null }>(\n rows: T[],\n): T[] {\n const now = Date.now();\n const extra: T[] = [];\n for (let i = 0; i < 160; i++) {\n const proj = DEMO_PROJECTS[i % DEMO_PROJECTS.length];\n const start = now - (i * 2 + 1) * 2_700_000 - Math.random() * 3_600_000;\n const dur = (15 + Math.random() * 80) * 60_000;\n extra.push({\n id: `demo-cursor-${i}`,\n tool: 'cursor',\n started_at: Math.round(start),\n ended_at: Math.round(start + dur),\n cwd: `/Users/demo/code/${proj}`,\n confidence: 'high',\n summary: null,\n ai_title: DEMO_TITLES[i % DEMO_TITLES.length],\n tags: null,\n } as T);\n }\n return [...rows, ...extra].sort((a, b) => b.started_at - a.started_at);\n}\n\nexport default async function DashboardPage({ searchParams }: { searchParams: Promise<{ demo?: string; codexAccount?: string }> }) {\n const params = await searchParams;\n const demo = params.demo === '1' || params.demo === 'true';\n\n const db = getDb();\n const codexAccounts = await getCodexAccounts();\n const currentCodexAccountId = codexAccounts.find((account) => account.isCurrent)?.accountId ?? null;\n const requestedCodexAccountId = params.codexAccount ?? null;\n const selectedCodexAccountId =\n requestedCodexAccountId && codexAccounts.some((account) => account.accountId === requestedCodexAccountId)\n ? requestedCodexAccountId\n : currentCodexAccountId;\n\n let sessions = db.prepare(`\n SELECT id, tool, started_at, ended_at, cwd, confidence, summary, ai_title, tags\n FROM sessions\n ORDER BY started_at DESC\n `).all() as Pick<SessionRow, 'id' | 'tool' | 'started_at' | 'ended_at' | 'cwd' | 'confidence' | 'summary' | 'ai_title' | 'tags'>[];\n\n if (demo) {\n sessions = anonymize(sessions);\n sessions = injectMockCursorSessions(sessions);\n }\n\n const claudeUsageRow = getLatestUsageSnapshot(db, 'statusline');\n const codexUsageRow = selectedCodexAccountId\n ? getLatestUsageSnapshot(db, 'codex', selectedCodexAccountId)\n : getLatestUsageSnapshot(db, 'codex');\n\n const toUsageInfo = (row: typeof claudeUsageRow) => row ? {\n window_5h_used_pct: row.window_5h_used_pct,\n window_weekly_used_pct: row.window_weekly_used_pct,\n reset_at_5h: row.reset_at_5h,\n reset_at_weekly: row.reset_at_weekly,\n } : null;\n\n // For demo, also fabricate a \"today's timeline\" mostly populated with cursor work\n let timeline = dayTimeline(0);\n if (demo) {\n const dayStart = new Date().setHours(0, 0, 0, 0);\n const mockToday = [\n { id: 'demo-t1', tool: 'cursor', project: 'kanban-board', startMs: dayStart + 9 * 3_600_000, endMs: dayStart + 10 * 3_600_000 + 30 * 60_000, aiTitle: 'add drag-drop sorting' },\n { id: 'demo-t2', tool: 'claude-code', project: 'note-vault', startMs: dayStart + 10 * 3_600_000 + 45 * 60_000, endMs: dayStart + 12 * 3_600_000 + 15 * 60_000, aiTitle: 'wire markdown export' },\n { id: 'demo-t3', tool: 'cursor', project: 'pomodoro', startMs: dayStart + 13 * 3_600_000, endMs: dayStart + 14 * 3_600_000 + 50 * 60_000, aiTitle: 'fix timer drift' },\n { id: 'demo-t4', tool: 'codex', project: 'recipe-box', startMs: dayStart + 15 * 3_600_000, endMs: dayStart + 17 * 3_600_000, aiTitle: 'design ingredient parser' },\n { id: 'demo-t5', tool: 'cursor', project: 'habit-tracker', startMs: dayStart + 17 * 3_600_000 + 10 * 60_000, endMs: dayStart + 19 * 3_600_000, aiTitle: 'streak animation polish' },\n { id: 'demo-t6', tool: 'cursor', project: 'budget-app', startMs: dayStart + 20 * 3_600_000, endMs: dayStart + 21 * 3_600_000 + 30 * 60_000, aiTitle: 'csv import wizard' },\n ];\n timeline = { dateLabel: new Date().toISOString().slice(0, 10), sessions: mockToday };\n }\n\n return (\n <div className=\"min-h-screen bg-zinc-950 text-zinc-100 font-mono\">\n <div className=\"max-w-6xl mx-auto px-6 py-8\">\n <div className=\"mb-6 flex items-start justify-between gap-4\">\n <div>\n <h1 className=\"text-xl font-semibold tracking-tight text-zinc-100\">\n <span className=\"text-violet-400\">Vibe</span>meter\n </h1>\n <p className=\"text-zinc-600 text-xs mt-1\">measure your AI coding vibe · local-first · data never leaves this machine</p>\n </div>\n <Link\n href=\"/admin\"\n className=\"rounded-md border border-zinc-800 px-3 py-2 text-xs text-zinc-400 transition-colors hover:border-zinc-600 hover:text-zinc-100\"\n >\n Admin\n </Link>\n </div>\n\n <Dashboard\n sessions={sessions}\n streak={activityStreak()}\n claudeBurndown={burndownPoints(168, 'statusline')}\n codexBurndown={burndownPoints(168, 'codex', selectedCodexAccountId)}\n hotspots={fileHotspots(8)}\n spending={spendingStats()}\n timeline={timeline}\n achievements={achievements()}\n claudeUsage={toUsageInfo(claudeUsageRow)}\n codexUsage={toUsageInfo(codexUsageRow)}\n codexAccounts={codexAccounts}\n selectedCodexAccountId={selectedCodexAccountId}\n />\n </div>\n </div>\n );\n}\n","import { getDb } from './db';\n\nexport interface ToolSplit {\n tool: string;\n sessions: number;\n totalMs: number;\n pct: number;\n}\n\nexport function toolSplit(): ToolSplit[] {\n const rows = getDb().prepare(`\n SELECT tool,\n COUNT(*) AS sessions,\n SUM(COALESCE(ended_at, started_at) - started_at) AS total_ms\n FROM sessions\n GROUP BY tool\n ORDER BY total_ms DESC\n `).all() as { tool: string; sessions: number; total_ms: number }[];\n\n const grand = rows.reduce((s, r) => s + (r.total_ms ?? 0), 0) || 1;\n return rows.map((r) => ({\n tool: r.tool,\n sessions: r.sessions,\n totalMs: r.total_ms ?? 0,\n pct: Math.round(((r.total_ms ?? 0) / grand) * 100),\n }));\n}\n\nexport interface StreakInfo {\n current: number; // consecutive days up to today\n longest: number;\n totalDays: number;\n heatmap: { date: string; count: number }[]; // last 84 days (12 weeks)\n}\n\nexport function activityStreak(): StreakInfo {\n const rows = getDb().prepare(`\n SELECT DATE(started_at / 1000, 'unixepoch', 'localtime') AS day,\n COUNT(*) AS n\n FROM sessions\n GROUP BY day\n ORDER BY day ASC\n `).all() as { day: string; n: number }[];\n\n const byDay = new Map(rows.map((r) => [r.day, r.n]));\n\n // Build last 84 days heatmap\n const heatmap: { date: string; count: number }[] = [];\n const now = new Date();\n for (let i = 83; i >= 0; i--) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n heatmap.push({ date: key, count: byDay.get(key) ?? 0 });\n }\n\n // Current streak (backwards from today)\n let current = 0;\n for (let i = 0; i < 365; i++) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n if (byDay.has(key)) { current++; } else { break; }\n }\n\n // Longest streak\n let longest = 0, run = 0;\n const allDays = rows.map((r) => r.day).sort();\n for (let i = 0; i < allDays.length; i++) {\n if (i === 0) { run = 1; continue; }\n const prev = new Date(allDays[i - 1]);\n const cur = new Date(allDays[i]);\n const diff = (cur.getTime() - prev.getTime()) / 86400000;\n run = diff === 1 ? run + 1 : 1;\n if (run > longest) longest = run;\n }\n if (current > longest) longest = current;\n\n return { current, longest, totalDays: byDay.size, heatmap };\n}\n\nexport interface BurndownPoint {\n ts: number;\n pct5h: number | null;\n pctWeekly: number | null;\n}\n\nexport function burndownPoints(limitHours = 168, source?: string, accountId?: string | null): BurndownPoint[] {\n const since = Date.now() - limitHours * 3_600_000;\n const q = source && accountId != null\n ? `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? AND source = ? AND account_id = ? ORDER BY captured_at ASC`\n : source\n ? `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? AND source = ? ORDER BY captured_at ASC`\n : `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? ORDER BY captured_at ASC`;\n const args = source && accountId != null ? [since, source, accountId] : source ? [since, source] : [since];\n return (getDb().prepare(q).all(...args) as BurndownPoint[]);\n}\n\nexport interface FileHotspot {\n path: string;\n changes: number;\n sessions: number;\n}\n\nexport function fileHotspots(limit = 10): FileHotspot[] {\n return getDb().prepare(`\n SELECT path,\n COUNT(*) AS changes,\n COUNT(DISTINCT session_id) AS sessions\n FROM file_changes\n GROUP BY path\n ORDER BY changes DESC\n LIMIT ?\n `).all(limit) as FileHotspot[];\n}\n\nexport interface CodexCategorySplit {\n category: string;\n count: number;\n}\n\nexport function codexCategories(): CodexCategorySplit[] {\n return getDb().prepare(`\n SELECT COALESCE(codex_category, 'unclassified') AS category,\n COUNT(*) AS count\n FROM sessions\n WHERE tool = 'codex'\n GROUP BY category\n ORDER BY count DESC\n `).all() as CodexCategorySplit[];\n}\n\nexport interface DailySpend {\n date: string; // YYYY-MM-DD\n claudeUsd: number;\n codexTokens: number;\n}\n\nexport interface SpendingStats {\n claudeTotalUsd: number;\n codexTotalTokens: number;\n daily: DailySpend[]; // last 14 days\n}\n\nexport function spendingStats(): SpendingStats {\n const db = getDb();\n\n // Claude Code: sum max cost per session from usage_snapshots JSON\n const claudeTotal = (db.prepare(`\n SELECT COALESCE(SUM(session_max), 0) AS total\n FROM (\n SELECT MAX(CAST(json_extract(raw_output, '$.cost.total_cost_usd') AS REAL)) AS session_max\n FROM usage_snapshots\n WHERE source = 'statusline'\n AND json_extract(raw_output, '$.cost.total_cost_usd') IS NOT NULL\n GROUP BY json_extract(raw_output, '$.session_id')\n )\n `).get() as { total: number }).total;\n\n // Codex: sum tokens_used\n const codexTotal = (db.prepare(`\n SELECT COALESCE(SUM(tokens_used), 0) AS total\n FROM sessions WHERE tool = 'codex' AND tokens_used IS NOT NULL\n `).get() as { total: number }).total;\n\n // Daily Claude cost: per session per day (max cost snapshot that day)\n const since = Date.now() - 14 * 86_400_000;\n const claudeDaily = db.prepare(`\n SELECT DATE(captured_at/1000, 'unixepoch', 'localtime') AS day,\n json_extract(raw_output, '$.session_id') AS sid,\n MAX(CAST(json_extract(raw_output, '$.cost.total_cost_usd') AS REAL)) AS cost\n FROM usage_snapshots\n WHERE source = 'statusline'\n AND captured_at > ?\n AND json_extract(raw_output, '$.cost.total_cost_usd') IS NOT NULL\n GROUP BY day, sid\n `).all(since) as { day: string; sid: string; cost: number }[];\n\n const claudeByDay = new Map<string, number>();\n for (const r of claudeDaily) {\n claudeByDay.set(r.day, (claudeByDay.get(r.day) ?? 0) + (r.cost ?? 0));\n }\n\n // Daily Codex tokens\n const codexDaily = db.prepare(`\n SELECT DATE(started_at/1000, 'unixepoch', 'localtime') AS day,\n SUM(tokens_used) AS tokens\n FROM sessions\n WHERE tool = 'codex' AND tokens_used IS NOT NULL AND started_at > ?\n GROUP BY day\n `).all(since) as { day: string; tokens: number }[];\n\n const codexByDay = new Map(codexDaily.map((r) => [r.day, r.tokens]));\n\n // Build last 14 days\n const daily: DailySpend[] = [];\n const now = new Date();\n for (let i = 13; i >= 0; i--) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n daily.push({\n date: key,\n claudeUsd: claudeByDay.get(key) ?? 0,\n codexTokens: codexByDay.get(key) ?? 0,\n });\n }\n\n return { claudeTotalUsd: claudeTotal, codexTotalTokens: codexTotal, daily };\n}\n\nexport interface TimelineSession {\n id: string;\n tool: string;\n project: string;\n startMs: number;\n endMs: number;\n aiTitle: string | null;\n}\n\nexport function dayTimeline(dayOffset = 0): { dateLabel: string; sessions: TimelineSession[] } {\n const target = new Date();\n target.setDate(target.getDate() + dayOffset);\n target.setHours(0, 0, 0, 0);\n const start = target.getTime();\n const end = start + 86_400_000;\n\n const rows = getDb().prepare(`\n SELECT id, tool, cwd, started_at, ended_at, ai_title\n FROM sessions\n WHERE started_at < ? AND COALESCE(ended_at, started_at + 60000) > ?\n ORDER BY started_at ASC\n `).all(end, start) as { id: string; tool: string; cwd: string | null; started_at: number; ended_at: number | null; ai_title: string | null }[];\n\n return {\n dateLabel: target.toISOString().slice(0, 10),\n sessions: rows.map((r) => ({\n id: r.id,\n tool: r.tool,\n project: r.cwd?.split('/').filter(Boolean).pop() ?? '—',\n startMs: r.started_at,\n endMs: r.ended_at ?? Math.min(Date.now(), end),\n aiTitle: r.ai_title,\n })),\n };\n}\n\nexport interface Achievement {\n id: string;\n title: string;\n description: string;\n unlocked: boolean;\n progress?: { current: number; target: number };\n}\n\nexport function achievements(): Achievement[] {\n const db = getDb();\n const totalSessions = (db.prepare(`SELECT COUNT(*) AS n FROM sessions`).get() as { n: number }).n;\n const longestStreak = activityStreak().longest;\n const sp = spendingStats();\n const longestMs = (db.prepare(`\n SELECT COALESCE(MAX(COALESCE(ended_at, started_at) - started_at), 0) AS ms FROM sessions\n `).get() as { ms: number }).ms;\n const projectCount = (db.prepare(`\n SELECT COUNT(DISTINCT cwd) AS n FROM sessions WHERE cwd IS NOT NULL\n `).get() as { n: number }).n;\n const lateNight = (db.prepare(`\n SELECT COUNT(*) AS n FROM sessions\n WHERE CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) >= 23\n OR CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) < 4\n `).get() as { n: number }).n;\n const earlyBird = (db.prepare(`\n SELECT COUNT(*) AS n FROM sessions\n WHERE CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) >= 4\n AND CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) < 7\n `).get() as { n: number }).n;\n const toolCount = (db.prepare(`SELECT COUNT(DISTINCT tool) AS n FROM sessions`).get() as { n: number }).n;\n\n const prog = (current: number, target: number) => ({ current: Math.min(current, target), target });\n\n return [\n { id: 'sessions-100', title: '百战不殆', description: '100 sessions logged', unlocked: totalSessions >= 100, progress: prog(totalSessions, 100) },\n { id: 'sessions-500', title: '已成习惯', description: '500 sessions logged', unlocked: totalSessions >= 500, progress: prog(totalSessions, 500) },\n { id: 'sessions-1000', title: '千锤百炼', description: '1000 sessions logged', unlocked: totalSessions >= 1000, progress: prog(totalSessions, 1000) },\n { id: 'streak-7', title: '一周连击', description: '7-day coding streak', unlocked: longestStreak >= 7, progress: prog(longestStreak, 7) },\n { id: 'streak-30', title: '月度坚持', description: '30-day coding streak', unlocked: longestStreak >= 30, progress: prog(longestStreak, 30) },\n { id: 'spend-10', title: '小试牛刀', description: 'Claude spend $10+', unlocked: sp.claudeTotalUsd >= 10, progress: prog(sp.claudeTotalUsd, 10) },\n { id: 'spend-100', title: '挥金如土', description: 'Claude spend $100+', unlocked: sp.claudeTotalUsd >= 100, progress: prog(sp.claudeTotalUsd, 100) },\n { id: 'tokens-100m', title: 'Token 富翁', description: '100M Codex tokens', unlocked: sp.codexTotalTokens >= 100_000_000, progress: prog(sp.codexTotalTokens, 100_000_000) },\n { id: 'tokens-1b', title: 'Token 大户', description: '1B Codex tokens', unlocked: sp.codexTotalTokens >= 1_000_000_000, progress: prog(sp.codexTotalTokens, 1_000_000_000) },\n { id: 'marathon-4h', title: '马拉松选手', description: 'Single session 4h+', unlocked: longestMs >= 4 * 3_600_000, progress: prog(longestMs, 4 * 3_600_000) },\n { id: 'marathon-8h', title: '通宵达旦', description: 'Single session 8h+', unlocked: longestMs >= 8 * 3_600_000, progress: prog(longestMs, 8 * 3_600_000) },\n { id: 'projects-10', title: '博学多才', description: 'Worked on 10+ projects', unlocked: projectCount >= 10, progress: prog(projectCount, 10) },\n { id: 'projects-30', title: '杂家', description: 'Worked on 30+ projects', unlocked: projectCount >= 30, progress: prog(projectCount, 30) },\n { id: 'night-owl', title: '夜猫子', description: 'Past-midnight sessions 10+', unlocked: lateNight >= 10, progress: prog(lateNight, 10) },\n { id: 'early-bird', title: '晨型人', description: 'Pre-7am sessions 5+', unlocked: earlyBird >= 5, progress: prog(earlyBird, 5) },\n { id: 'multi-tool', title: '多面手', description: 'Used 3 different tools', unlocked: toolCount >= 3, progress: prog(toolCount, 3) },\n ];\n}\n","import type Database from 'better-sqlite3';\n\nexport type UsageSource = 'claude_usage_cmd' | 'statusline' | 'manual' | 'codex';\nexport type UsageConfidence = 'high' | 'medium' | 'low';\n\nexport interface UsageSnapshotInput {\n capturedAt: number;\n source: UsageSource;\n accountId: string | null;\n window5hUsedPct: number | null;\n windowWeeklyUsedPct: number | null;\n resetAt5h: number | null;\n resetAtWeekly: number | null;\n rawOutput: string | null;\n confidence: UsageConfidence;\n}\n\nexport interface UsageSnapshotRecord {\n id: number;\n captured_at: number;\n source: UsageSource;\n account_id: string | null;\n window_5h_used_pct: number | null;\n window_weekly_used_pct: number | null;\n reset_at_5h: number | null;\n reset_at_weekly: number | null;\n raw_output: string | null;\n confidence: UsageConfidence;\n}\n\nexport function insertUsageSnapshot(db: Database.Database, input: UsageSnapshotInput): void {\n db.prepare(`\n INSERT INTO usage_snapshots\n (captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence)\n VALUES\n (@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,\n @reset_at_5h, @reset_at_weekly, @raw_output, @confidence)\n `).run({\n captured_at: input.capturedAt,\n source: input.source,\n account_id: input.accountId,\n window_5h_used_pct: input.window5hUsedPct,\n window_weekly_used_pct: input.windowWeeklyUsedPct,\n reset_at_5h: input.resetAt5h,\n reset_at_weekly: input.resetAtWeekly,\n raw_output: input.rawOutput,\n confidence: input.confidence,\n });\n}\n\nexport function getLatestUsageSnapshot(\n db: Database.Database,\n source: UsageSource,\n accountId?: string | null,\n): UsageSnapshotRecord | null {\n const row = accountId != null\n ? db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ? AND account_id = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source, accountId)\n : db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source);\n\n return (row as UsageSnapshotRecord | undefined) ?? null;\n}\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interop_require_wildcard","obj","__esModule","default","cache","has","get","newObj","__proto__","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","exports","_","createClientModuleProxy","__turbopack_context__","n","LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","ScrollBehavior","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","expected","actual","requiredPropsGuard","requiredProps","keys","forEach","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","undefined","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext","__NEXT_CACHE_COMPONENTS","Full","isLegacyBehavior","childIsHostComponent","childIsClientComponent","error","ClientLinkComponent","AUTH_CLAIMS_KEY","defaultAuthPath","join","defaultStoreDir","resolvePaths","paths","authPath","storeDir","accountPath","accountId","readAuthFile","filePath","raw","parsed","JSON","parse","tokens","account_id","writeJsonAtomic","data","dirname","recursive","tmp","pid","Date","now","stringify","encoding","mode","decodeJwtPayload","token","payload","Buffer","from","toString","stringClaim","length","expiryClaim","toISOString","summarizeAuth","auth","storedAt","currentAccountId","idPayload","id_token","accessPayload","access_token","idAuthClaims","accessAuthClaims","email","name","planType","chatgpt_plan_type","userId","user_id","label","slice","lastRefresh","last_refresh","idTokenExpiresAt","exp","accessTokenExpiresAt","isCurrent","getCodexAccounts","currentAuth","accounts","Map","entries","entry","storedAuth","storedStat","summary","mtime","values","sort","b","localeCompare","getCurrentCodexAccount","authMtimeMs","mtimeMs","importCurrentCodexAuth","destination","switchCodexAccount","source","sourceAccountId","backupPath","deleteCodexAccount","catch","src","width","height","Dashboard","dataDir","VIBEMETER_DATA_DIR","cwd"],"mappings":"oMAEA,SAASA,EAAyBC,CAAW,EACzC,GAAuB,YAAnB,OAAOC,QAAwB,OAAO,KAE1C,IAAIC,EAAoB,IAAID,QACxBE,EAAmB,IAAIF,QAE3B,MAAO,CAACF,EAA2B,SAASC,CAAW,EACnD,OAAOA,EAAcG,EAAmBD,EAC5C,CAAC,CAAEF,EACP,CA0BAuB,EAAQC,CAAC,CAzBT,EAyBYpB,OAzBHA,AAA0BC,CAAG,CAAEL,CAAW,EAC/C,GAAI,CAACA,GAAeK,GAAOA,EAAIC,UAAU,CAAE,OAAOD,EAClD,GAAY,OAARA,GAA+B,UAAf,OAAOA,GAAmC,YAAf,OAAOA,EAAoB,MAAO,CAAEE,QAASF,CAAI,EAEhG,IAAIG,EAAQT,EAAyBC,GAErC,GAAIQ,GAASA,EAAMC,GAAG,CAACJ,GAAM,OAAOG,EAAME,GAAG,CAACL,GAE9C,IAAIM,EAAS,CAAEC,UAAW,IAAK,EAC3BC,EAAwBC,OAAOC,cAAc,EAAID,OAAOE,wBAAwB,CAEpF,IAAK,IAAIC,KAAOZ,EACZ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C,SAAU,EAAG,gBAAgB,EAAI,IAAe,SAAU,EAAK,EAAG,gBAAgB,CAAE,IAAe,EAC5L,CAAE,GAAI,cAAiB,MAAO,QAAW,YAAa,qBAAgC,SAAU,GAAa,IAAI,EAAW,SAAU,EAAK,EAAW,IAAI,EAAW,EACrK,CAAE,GAAI,cAAiB,MAAO,OAAY,YAAa,qBAAgC,SAAU,GAAa,IAAI,EAAW,SAAU,EAAK,EAAW,IAAI,EAAW,EACtK,CAAE,GAAI,cAAiB,MAAO,OAAY,YAAa,yBAAgC,SAAU,GAAgB,GAAQ,SAAU,EAAK,EAAc,GAAI,EAC1J,CAAE,GAAI,cAAiB,MAAO,KAAc,YAAa,yBAAgC,SAAU,GAAgB,GAAQ,SAAU,EAAK,EAAc,GAAI,EAC5J,CAAE,GAAI,YAAiB,MAAO,MAAa,YAAa,6BAAgC,SAAU,GAAa,GAAW,SAAU,EAAK,EAAW,GAAI,EACxJ,CAAE,GAAI,aAAiB,MAAO,MAAa,YAAa,sBAAgC,SAAU,GAAa,EAAW,SAAU,EAAK,EAAW,EAAG,EACvJ,CAAE,GAAI,aAAiB,MAAO,MAAa,YAAa,yBAAgC,SAAU,GAAa,EAAW,SAAU,EAAK,EAAW,EAAG,EACxJ,EDvJO,YAAa,EAAY,GACzB,WAAY,EAAY,GACxB,cAAe,EACf,uBAAwB,QAKlC,gCA7JuB","ignoreList":[0,1,3,6]}
1
+ {"version":3,"sources":["../../../../node_modules/%40swc/helpers/cjs/_interop_require_wildcard.cjs","../../../../node_modules/next/dist/client/app-dir/link.js/__nextjs-internal-proxy.cjs","../../../../node_modules/next/src/client/app-dir/link.tsx","../../../../node_modules/next/src/client/app-dir/link.react-server.tsx","../../../../src/lib/codex-auth.ts","../../../../src/app/favicon.ico.mjs%20%28structured%20image%20object%29","../../../../src/components/Dashboard.tsx/__nextjs-internal-proxy.mjs","../../../../src/lib/db.ts","../../../../src/lib/data-dir.ts","../../../../src/lib/db-bootstrap.ts","../../../../src/app/page.tsx","../../../../src/lib/stats.ts","../../../../src/lib/usage-snapshots.ts"],"sourcesContent":["\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nconst { createClientModuleProxy } = require(\"react-server-dom-turbopack/server\");\n\n__turbopack_context__.n(createClientModuleProxy(\"[project]/node_modules/next/dist/client/app-dir/link.js\"));\n","'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport { ScrollBehavior } from '../components/router-reducer/router-reducer-types'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport { errorOnce } from '../../shared/lib/utils/error-once'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n\n /**\n * Transition types to apply when navigating. These types are passed to\n * [`React.addTransitionType`](https://react.dev/reference/react/addTransitionType)\n * inside the navigation transition, enabling\n * [`<ViewTransition>`](https://react.dev/reference/react/ViewTransition) components\n * to apply different animations based on the type of navigation.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" transitionTypes={['slide-in']}>About</Link>\n * ```\n */\n transitionTypes?: string[]\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler,\n transitionTypes?: string[]\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n href,\n replace ? 'replace' : 'push',\n scroll === false ? ScrollBehavior.NoScroll : ScrollBehavior.Default,\n linkInstanceRef.current,\n transitionTypes\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n transitionTypes,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n transitionTypes: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else if (key === 'transitionTypes') {\n if (props[key] != null && !Array.isArray(props[key])) {\n throw createPropError({\n key,\n expected: '`string[]`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n const resolvedHref = asProp || hrefProp\n const formattedHref = formatStringOrUrl(resolvedHref)\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof resolvedHref === 'string') {\n href = resolvedHref\n } else if (\n typeof resolvedHref === 'object' &&\n typeof resolvedHref.pathname === 'string'\n ) {\n href = resolvedHref.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${formattedHref}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n formattedHref,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [\n prefetchEnabled,\n formattedHref,\n router,\n fetchStrategy,\n setOptimisticLinkStatus,\n ]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(\n e,\n formattedHref,\n linkInstanceRef,\n replace,\n scroll,\n onNavigate,\n transitionTypes\n )\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(formattedHref)) {\n childProps.href = formattedHref\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(formattedHref)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n","import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n","import { mkdir, readFile, rename, readdir, stat, unlink, writeFile } from 'node:fs/promises';\nimport { readFileSync, statSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\n\ninterface CodexAuthFile {\n auth_mode?: unknown;\n OPENAI_API_KEY?: unknown;\n tokens?: {\n id_token?: unknown;\n access_token?: unknown;\n refresh_token?: unknown;\n account_id?: unknown;\n };\n last_refresh?: unknown;\n}\n\nexport interface CodexAccountSummary {\n accountId: string;\n label: string;\n email: string | null;\n name: string | null;\n planType: string | null;\n userId: string | null;\n lastRefresh: string | null;\n idTokenExpiresAt: string | null;\n accessTokenExpiresAt: string | null;\n storedAt: string | null;\n isCurrent: boolean;\n}\n\nexport interface CodexAuthPaths {\n authPath?: string;\n storeDir?: string;\n}\n\nexport interface CurrentCodexAccount {\n accountId: string;\n authMtimeMs: number;\n}\n\nconst AUTH_CLAIMS_KEY = 'https://api.openai.com/auth';\n\nfunction defaultAuthPath() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth.json');\n}\n\nfunction defaultStoreDir() {\n return path.join(/* turbopackIgnore: true */ homedir(), '.codex', 'auth-accounts');\n}\n\nfunction resolvePaths(paths: CodexAuthPaths = {}) {\n return {\n authPath: paths.authPath ?? defaultAuthPath(),\n storeDir: paths.storeDir ?? defaultStoreDir(),\n };\n}\n\nfunction accountPath(accountId: string, storeDir: string) {\n return path.join(/* turbopackIgnore: true */ storeDir, `${accountId.replace(/[^a-zA-Z0-9_-]/g, '_')}.json`);\n}\n\nasync function readAuthFile(filePath: string): Promise<CodexAuthFile> {\n const raw = await readFile(filePath, 'utf8');\n const parsed = JSON.parse(raw) as CodexAuthFile;\n if (!parsed.tokens || typeof parsed.tokens.account_id !== 'string') {\n throw new Error('Codex auth file is missing tokens.account_id');\n }\n return parsed;\n}\n\nasync function writeJsonAtomic(filePath: string, data: unknown) {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmp, `${JSON.stringify(data, null, 2)}\\n`, { encoding: 'utf8', mode: 0o600 });\n await rename(tmp, filePath);\n}\n\nfunction decodeJwtPayload(token: unknown): Record<string, unknown> | null {\n if (typeof token !== 'string') return null;\n const [, payload] = token.split('.');\n if (!payload) return null;\n\n try {\n return JSON.parse(Buffer.from(payload, 'base64url').toString('utf8')) as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\nfunction stringClaim(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null;\n}\n\nfunction expiryClaim(value: unknown): string | null {\n return typeof value === 'number' ? new Date(value * 1000).toISOString() : null;\n}\n\nfunction summarizeAuth(auth: CodexAuthFile, storedAt: string | null, currentAccountId: string | null): CodexAccountSummary {\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) throw new Error('Codex auth file is missing tokens.account_id');\n\n const idPayload = decodeJwtPayload(auth.tokens?.id_token);\n const accessPayload = decodeJwtPayload(auth.tokens?.access_token);\n const idAuthClaims = idPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n const accessAuthClaims = accessPayload?.[AUTH_CLAIMS_KEY] as Record<string, unknown> | undefined;\n\n const email = stringClaim(idPayload?.email);\n const name = stringClaim(idPayload?.name);\n const planType = stringClaim(idAuthClaims?.chatgpt_plan_type) ?? stringClaim(accessAuthClaims?.chatgpt_plan_type);\n const userId = stringClaim(idAuthClaims?.user_id) ?? stringClaim(accessAuthClaims?.user_id);\n const label = email ?? name ?? `${accountId.slice(0, 8)}...${accountId.slice(-4)}`;\n\n return {\n accountId,\n label,\n email,\n name,\n planType,\n userId,\n lastRefresh: stringClaim(auth.last_refresh),\n idTokenExpiresAt: expiryClaim(idPayload?.exp),\n accessTokenExpiresAt: expiryClaim(accessPayload?.exp),\n storedAt,\n isCurrent: accountId === currentAccountId,\n };\n}\n\nexport async function getCodexAccounts(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary[]> {\n const { authPath, storeDir } = resolvePaths(paths);\n let currentAccountId: string | null = null;\n let currentAuth: CodexAuthFile | null = null;\n\n try {\n currentAuth = await readAuthFile(authPath);\n currentAccountId = stringClaim(currentAuth.tokens?.account_id);\n } catch {\n currentAuth = null;\n }\n\n const accounts = new Map<string, CodexAccountSummary>();\n\n try {\n const entries = await readdir(storeDir);\n for (const entry of entries) {\n if (!entry.endsWith('.json')) continue;\n const filePath = path.join(storeDir, entry);\n try {\n const storedAuth = await readAuthFile(filePath);\n const storedStat = await stat(filePath);\n const summary = summarizeAuth(storedAuth, storedStat.mtime.toISOString(), currentAccountId);\n accounts.set(summary.accountId, summary);\n } catch {\n // Ignore malformed account snapshots so one bad file does not break the admin page.\n }\n }\n } catch {\n // Missing store just means no saved accounts yet.\n }\n\n if (currentAuth && currentAccountId && !accounts.has(currentAccountId)) {\n accounts.set(currentAccountId, summarizeAuth(currentAuth, null, currentAccountId));\n }\n\n return [...accounts.values()].sort((a, b) => {\n if (a.isCurrent !== b.isCurrent) return a.isCurrent ? -1 : 1;\n return a.label.localeCompare(b.label);\n });\n}\n\nexport function getCurrentCodexAccount(paths: CodexAuthPaths = {}): CurrentCodexAccount | null {\n const { authPath } = resolvePaths(paths);\n try {\n const auth = JSON.parse(readFileSync(authPath, 'utf8')) as CodexAuthFile;\n const accountId = stringClaim(auth.tokens?.account_id);\n if (!accountId) return null;\n return {\n accountId,\n authMtimeMs: statSync(authPath).mtimeMs,\n };\n } catch {\n return null;\n }\n}\n\nexport async function importCurrentCodexAuth(paths: CodexAuthPaths = {}): Promise<CodexAccountSummary> {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath);\n const accountId = auth.tokens?.account_id as string;\n const destination = accountPath(accountId, storeDir);\n await writeJsonAtomic(destination, auth);\n const storedStat = await stat(destination);\n return summarizeAuth(auth, storedStat.mtime.toISOString(), accountId);\n}\n\nexport async function switchCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const source = accountPath(accountId, storeDir);\n const auth = await readAuthFile(source);\n const sourceAccountId = auth.tokens?.account_id;\n if (sourceAccountId !== accountId) {\n throw new Error('Stored account id does not match requested account');\n }\n\n let backupPath: string | null = null;\n try {\n const current = await readFile(authPath, 'utf8');\n backupPath = `${authPath}.${new Date().toISOString().replace(/[:.]/g, '-')}.bak`;\n await writeFile(backupPath, current, { encoding: 'utf8', mode: 0o600 });\n } catch {\n backupPath = null;\n }\n\n await writeJsonAtomic(authPath, auth);\n return {\n ...summarizeAuth(auth, null, accountId),\n backupPath,\n };\n}\n\nexport async function deleteCodexAccount(accountId: string, paths: CodexAuthPaths = {}) {\n const { authPath, storeDir } = resolvePaths(paths);\n const auth = await readAuthFile(authPath).catch(() => null);\n if (auth?.tokens?.account_id === accountId) {\n throw new Error('Cannot delete the currently active Codex account');\n }\n await unlink(accountPath(accountId, storeDir));\n}\n","import src from \"IMAGE\";\nexport default { src, width: 256, height: 256 }\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const Dashboard = registerClientReference(\n function() { throw new Error(\"Attempted to call Dashboard() from the server but Dashboard 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.\"); },\n \"[project]/src/components/Dashboard.tsx\",\n \"Dashboard\",\n);\n","import Database from 'better-sqlite3';\nimport path from 'path';\nimport fs from 'fs';\nimport { dataDir } from './data-dir';\nimport { bootstrap } from './db-bootstrap';\n\nlet _db: Database.Database | null = null;\n\nexport function getDb(): Database.Database {\n if (_db) return _db;\n const dir = dataDir();\n fs.mkdirSync(dir, { recursive: true });\n _db = new Database(path.join(dir, 'continuity.sqlite'));\n _db.pragma('journal_mode = WAL');\n bootstrap(_db);\n return _db;\n}\n","import path from 'path';\n\n/**\n * Where Vibemeter stores its SQLite DB and statusline snapshot.\n *\n * - When installed via `npx @hirra/vibemeter`: the bin script sets\n * VIBEMETER_DATA_DIR to `~/.vibemeter` for a stable user-data location.\n * - In local development from a checkout: defaults to `<cwd>/.data`.\n */\nexport function dataDir(): string {\n return process.env.VIBEMETER_DATA_DIR ?? path.join(process.cwd(), '.data');\n}\n","import type Database from 'better-sqlite3';\n\nexport function bootstrap(db: Database.Database): void {\n db.exec(`\n CREATE TABLE IF NOT EXISTS sessions (\n id TEXT PRIMARY KEY,\n tool TEXT NOT NULL,\n started_at INTEGER NOT NULL,\n ended_at INTEGER,\n exit_code INTEGER,\n cwd TEXT,\n cli_args TEXT,\n summary TEXT,\n confidence TEXT NOT NULL DEFAULT 'medium'\n );\n\n CREATE TABLE IF NOT EXISTS usage_snapshots (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n captured_at INTEGER NOT NULL,\n source TEXT NOT NULL,\n account_id TEXT,\n window_5h_used_pct REAL,\n window_weekly_used_pct REAL,\n reset_at_5h INTEGER,\n reset_at_weekly INTEGER,\n raw_output TEXT,\n confidence TEXT NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS file_changes (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT NOT NULL,\n path TEXT NOT NULL,\n change_type TEXT NOT NULL,\n detected_at INTEGER NOT NULL,\n FOREIGN KEY (session_id) REFERENCES sessions(id)\n );\n `);\n\n // Idempotent column additions (SQLite has no ADD COLUMN IF NOT EXISTS)\n const addCol = (table: string, col: string, def: string) => {\n try { db.exec(`ALTER TABLE ${table} ADD COLUMN ${col} ${def}`); } catch { /* already exists */ }\n };\n addCol('sessions', 'ai_title', 'TEXT');\n addCol('sessions', 'tags', 'TEXT DEFAULT \"[]\"');\n addCol('sessions', 'codex_category', 'TEXT');\n addCol('sessions', 'tokens_used', 'INTEGER');\n addCol('usage_snapshots', 'account_id', 'TEXT');\n\n db.exec(`\n CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);\n CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);\n `);\n}\n","export const dynamic = 'force-dynamic';\n\nimport { getDb } from '@/lib/db';\nimport { Dashboard } from '@/components/Dashboard';\nimport Link from 'next/link';\nimport { activityStreak, burndownPoints, fileHotspots, spendingStats, dayTimeline, achievements } from '@/lib/stats';\nimport type { SessionRow } from '@/lib/schema';\nimport { getCodexAccounts } from '@/lib/codex-auth';\nimport { getLatestUsageSnapshot } from '@/lib/usage-snapshots';\n\nconst DEMO_PROJECTS = [\n 'kanban-board', 'pomodoro', 'weather-widget', 'recipe-box', 'mood-journal',\n 'habit-tracker', 'flashcards', 'spelling-bee', 'budget-app', 'markdown-blog',\n 'todo-cli', 'music-player', 'photo-gallery', 'note-vault', 'expense-split',\n];\n\nconst DEMO_TITLES = [\n 'add dark mode toggle',\n 'refactor router boundaries',\n 'fix mobile layout overflow',\n 'wire up websocket reconnect',\n 'optimize image lazy loading',\n 'migrate to server components',\n 'tighten type signatures',\n 'investigate flaky e2e tests',\n 'add keyboard shortcuts',\n 'improve empty states',\n];\n\nfunction anonymize<T extends { cwd: string | null; ai_title: string | null; id: string }>(\n rows: T[],\n): T[] {\n const projectMap = new Map<string, string>();\n return rows.map((s, i) => {\n if (!s.cwd) return s;\n const base = s.cwd.split('/').filter(Boolean).pop() ?? '';\n if (!projectMap.has(base)) {\n projectMap.set(base, DEMO_PROJECTS[projectMap.size % DEMO_PROJECTS.length]);\n }\n return {\n ...s,\n cwd: `/Users/demo/code/${projectMap.get(base)}`,\n ai_title: s.ai_title ? DEMO_TITLES[i % DEMO_TITLES.length] : null,\n };\n });\n}\n\nfunction injectMockCursorSessions<T extends { id: string; tool: string; started_at: number; ended_at: number | null; cwd: string | null; confidence: string; summary: string | null; ai_title: string | null; tags: string | null }>(\n rows: T[],\n): T[] {\n const now = Date.now();\n const extra: T[] = [];\n for (let i = 0; i < 160; i++) {\n const proj = DEMO_PROJECTS[i % DEMO_PROJECTS.length];\n const start = now - (i * 2 + 1) * 2_700_000 - Math.random() * 3_600_000;\n const dur = (15 + Math.random() * 80) * 60_000;\n extra.push({\n id: `demo-cursor-${i}`,\n tool: 'cursor',\n started_at: Math.round(start),\n ended_at: Math.round(start + dur),\n cwd: `/Users/demo/code/${proj}`,\n confidence: 'high',\n summary: null,\n ai_title: DEMO_TITLES[i % DEMO_TITLES.length],\n tags: null,\n } as T);\n }\n return [...rows, ...extra].sort((a, b) => b.started_at - a.started_at);\n}\n\nconst AGENTS = new Set(['all', 'claude-code', 'codex', 'cursor']);\n\nexport default async function DashboardPage({ searchParams }: { searchParams: Promise<{ demo?: string; agent?: string; codexAccount?: string }> }) {\n const params = await searchParams;\n const demo = params.demo === '1' || params.demo === 'true';\n const initialAgent = AGENTS.has(params.agent ?? '') ? params.agent as 'all' | 'claude-code' | 'codex' | 'cursor' : 'all';\n\n const db = getDb();\n const codexAccounts = await getCodexAccounts();\n const requestedCodexAccountId = params.codexAccount ?? null;\n const selectedCodexAccountId =\n requestedCodexAccountId && codexAccounts.some((account) => account.accountId === requestedCodexAccountId)\n ? requestedCodexAccountId\n : null;\n\n let sessions = db.prepare(`\n SELECT id, tool, started_at, ended_at, cwd, confidence, summary, ai_title, tags\n FROM sessions\n ORDER BY started_at DESC\n `).all() as Pick<SessionRow, 'id' | 'tool' | 'started_at' | 'ended_at' | 'cwd' | 'confidence' | 'summary' | 'ai_title' | 'tags'>[];\n\n if (demo) {\n sessions = anonymize(sessions);\n sessions = injectMockCursorSessions(sessions);\n }\n\n const claudeUsageRow = getLatestUsageSnapshot(db, 'statusline');\n const codexUsageRow = selectedCodexAccountId\n ? getLatestUsageSnapshot(db, 'codex', selectedCodexAccountId)\n : getLatestUsageSnapshot(db, 'codex');\n const allUsageRow = db\n .prepare(`SELECT * FROM usage_snapshots ORDER BY captured_at DESC LIMIT 1`)\n .get() as typeof claudeUsageRow;\n\n const toUsageInfo = (row: typeof claudeUsageRow) => row ? {\n window_5h_used_pct: row.window_5h_used_pct,\n window_weekly_used_pct: row.window_weekly_used_pct,\n reset_at_5h: row.reset_at_5h,\n reset_at_weekly: row.reset_at_weekly,\n } : null;\n\n // For demo, also fabricate a \"today's timeline\" mostly populated with cursor work\n let timeline = dayTimeline(0);\n if (demo) {\n const dayStart = new Date().setHours(0, 0, 0, 0);\n const mockToday = [\n { id: 'demo-t1', tool: 'cursor', project: 'kanban-board', startMs: dayStart + 9 * 3_600_000, endMs: dayStart + 10 * 3_600_000 + 30 * 60_000, aiTitle: 'add drag-drop sorting' },\n { id: 'demo-t2', tool: 'claude-code', project: 'note-vault', startMs: dayStart + 10 * 3_600_000 + 45 * 60_000, endMs: dayStart + 12 * 3_600_000 + 15 * 60_000, aiTitle: 'wire markdown export' },\n { id: 'demo-t3', tool: 'cursor', project: 'pomodoro', startMs: dayStart + 13 * 3_600_000, endMs: dayStart + 14 * 3_600_000 + 50 * 60_000, aiTitle: 'fix timer drift' },\n { id: 'demo-t4', tool: 'codex', project: 'recipe-box', startMs: dayStart + 15 * 3_600_000, endMs: dayStart + 17 * 3_600_000, aiTitle: 'design ingredient parser' },\n { id: 'demo-t5', tool: 'cursor', project: 'habit-tracker', startMs: dayStart + 17 * 3_600_000 + 10 * 60_000, endMs: dayStart + 19 * 3_600_000, aiTitle: 'streak animation polish' },\n { id: 'demo-t6', tool: 'cursor', project: 'budget-app', startMs: dayStart + 20 * 3_600_000, endMs: dayStart + 21 * 3_600_000 + 30 * 60_000, aiTitle: 'csv import wizard' },\n ];\n timeline = { dateLabel: new Date().toISOString().slice(0, 10), sessions: mockToday };\n }\n\n return (\n <div className=\"min-h-screen bg-zinc-950 text-zinc-100 font-mono\">\n <div className=\"max-w-6xl mx-auto px-6 py-8\">\n <div className=\"mb-6 flex items-start justify-between gap-4\">\n <div>\n <h1 className=\"text-xl font-semibold tracking-tight text-zinc-100\">\n <span className=\"text-violet-400\">Vibe</span>meter\n </h1>\n <p className=\"text-zinc-600 text-xs mt-1\">measure your AI coding vibe · local-first · data never leaves this machine</p>\n </div>\n <Link\n href=\"/admin\"\n className=\"rounded-md border border-zinc-800 px-3 py-2 text-xs text-zinc-400 transition-colors hover:border-zinc-600 hover:text-zinc-100\"\n >\n Admin\n </Link>\n </div>\n\n <Dashboard\n sessions={sessions}\n streak={activityStreak()}\n allBurndown={burndownPoints(168)}\n claudeBurndown={burndownPoints(168, 'statusline')}\n codexBurndown={burndownPoints(168, 'codex', selectedCodexAccountId)}\n hotspots={fileHotspots(8)}\n spending={spendingStats()}\n timeline={timeline}\n achievements={achievements()}\n allUsage={toUsageInfo(allUsageRow)}\n claudeUsage={toUsageInfo(claudeUsageRow)}\n codexUsage={toUsageInfo(codexUsageRow)}\n codexAccounts={codexAccounts}\n selectedCodexAccountId={selectedCodexAccountId}\n initialToolFilter={initialAgent}\n />\n </div>\n </div>\n );\n}\n","import { getDb } from './db';\n\nexport interface ToolSplit {\n tool: string;\n sessions: number;\n totalMs: number;\n pct: number;\n}\n\nexport function toolSplit(): ToolSplit[] {\n const rows = getDb().prepare(`\n SELECT tool,\n COUNT(*) AS sessions,\n SUM(COALESCE(ended_at, started_at) - started_at) AS total_ms\n FROM sessions\n GROUP BY tool\n ORDER BY total_ms DESC\n `).all() as { tool: string; sessions: number; total_ms: number }[];\n\n const grand = rows.reduce((s, r) => s + (r.total_ms ?? 0), 0) || 1;\n return rows.map((r) => ({\n tool: r.tool,\n sessions: r.sessions,\n totalMs: r.total_ms ?? 0,\n pct: Math.round(((r.total_ms ?? 0) / grand) * 100),\n }));\n}\n\nexport interface StreakInfo {\n current: number; // consecutive days up to today\n longest: number;\n totalDays: number;\n heatmap: { date: string; count: number }[]; // last 84 days (12 weeks)\n}\n\nexport function activityStreak(): StreakInfo {\n const rows = getDb().prepare(`\n SELECT DATE(started_at / 1000, 'unixepoch', 'localtime') AS day,\n COUNT(*) AS n\n FROM sessions\n GROUP BY day\n ORDER BY day ASC\n `).all() as { day: string; n: number }[];\n\n const byDay = new Map(rows.map((r) => [r.day, r.n]));\n\n // Build last 84 days heatmap\n const heatmap: { date: string; count: number }[] = [];\n const now = new Date();\n for (let i = 83; i >= 0; i--) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n heatmap.push({ date: key, count: byDay.get(key) ?? 0 });\n }\n\n // Current streak (backwards from today)\n let current = 0;\n for (let i = 0; i < 365; i++) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n if (byDay.has(key)) { current++; } else { break; }\n }\n\n // Longest streak\n let longest = 0, run = 0;\n const allDays = rows.map((r) => r.day).sort();\n for (let i = 0; i < allDays.length; i++) {\n if (i === 0) { run = 1; continue; }\n const prev = new Date(allDays[i - 1]);\n const cur = new Date(allDays[i]);\n const diff = (cur.getTime() - prev.getTime()) / 86400000;\n run = diff === 1 ? run + 1 : 1;\n if (run > longest) longest = run;\n }\n if (current > longest) longest = current;\n\n return { current, longest, totalDays: byDay.size, heatmap };\n}\n\nexport interface BurndownPoint {\n ts: number;\n pct5h: number | null;\n pctWeekly: number | null;\n}\n\nexport function burndownPoints(limitHours = 168, source?: string, accountId?: string | null): BurndownPoint[] {\n const since = Date.now() - limitHours * 3_600_000;\n const q = source && accountId != null\n ? `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? AND source = ? AND account_id = ? ORDER BY captured_at ASC`\n : source\n ? `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? AND source = ? ORDER BY captured_at ASC`\n : `SELECT captured_at AS ts, window_5h_used_pct AS pct5h, window_weekly_used_pct AS pctWeekly\n FROM usage_snapshots WHERE captured_at > ? ORDER BY captured_at ASC`;\n const args = source && accountId != null ? [since, source, accountId] : source ? [since, source] : [since];\n return (getDb().prepare(q).all(...args) as BurndownPoint[]);\n}\n\nexport interface FileHotspot {\n path: string;\n changes: number;\n sessions: number;\n}\n\nexport function fileHotspots(limit = 10): FileHotspot[] {\n return getDb().prepare(`\n SELECT path,\n COUNT(*) AS changes,\n COUNT(DISTINCT session_id) AS sessions\n FROM file_changes\n GROUP BY path\n ORDER BY changes DESC\n LIMIT ?\n `).all(limit) as FileHotspot[];\n}\n\nexport interface CodexCategorySplit {\n category: string;\n count: number;\n}\n\nexport function codexCategories(): CodexCategorySplit[] {\n return getDb().prepare(`\n SELECT COALESCE(codex_category, 'unclassified') AS category,\n COUNT(*) AS count\n FROM sessions\n WHERE tool = 'codex'\n GROUP BY category\n ORDER BY count DESC\n `).all() as CodexCategorySplit[];\n}\n\nexport interface DailySpend {\n date: string; // YYYY-MM-DD\n claudeUsd: number;\n codexTokens: number;\n}\n\nexport interface SpendingStats {\n claudeTotalUsd: number;\n codexTotalTokens: number;\n daily: DailySpend[]; // last 14 days\n}\n\nexport function spendingStats(): SpendingStats {\n const db = getDb();\n\n // Claude Code: sum max cost per session from usage_snapshots JSON\n const claudeTotal = (db.prepare(`\n SELECT COALESCE(SUM(session_max), 0) AS total\n FROM (\n SELECT MAX(CAST(json_extract(raw_output, '$.cost.total_cost_usd') AS REAL)) AS session_max\n FROM usage_snapshots\n WHERE source = 'statusline'\n AND json_extract(raw_output, '$.cost.total_cost_usd') IS NOT NULL\n GROUP BY json_extract(raw_output, '$.session_id')\n )\n `).get() as { total: number }).total;\n\n // Codex: sum tokens_used\n const codexTotal = (db.prepare(`\n SELECT COALESCE(SUM(tokens_used), 0) AS total\n FROM sessions WHERE tool = 'codex' AND tokens_used IS NOT NULL\n `).get() as { total: number }).total;\n\n // Daily Claude cost: per session per day (max cost snapshot that day)\n const since = Date.now() - 14 * 86_400_000;\n const claudeDaily = db.prepare(`\n SELECT DATE(captured_at/1000, 'unixepoch', 'localtime') AS day,\n json_extract(raw_output, '$.session_id') AS sid,\n MAX(CAST(json_extract(raw_output, '$.cost.total_cost_usd') AS REAL)) AS cost\n FROM usage_snapshots\n WHERE source = 'statusline'\n AND captured_at > ?\n AND json_extract(raw_output, '$.cost.total_cost_usd') IS NOT NULL\n GROUP BY day, sid\n `).all(since) as { day: string; sid: string; cost: number }[];\n\n const claudeByDay = new Map<string, number>();\n for (const r of claudeDaily) {\n claudeByDay.set(r.day, (claudeByDay.get(r.day) ?? 0) + (r.cost ?? 0));\n }\n\n // Daily Codex tokens\n const codexDaily = db.prepare(`\n SELECT DATE(started_at/1000, 'unixepoch', 'localtime') AS day,\n SUM(tokens_used) AS tokens\n FROM sessions\n WHERE tool = 'codex' AND tokens_used IS NOT NULL AND started_at > ?\n GROUP BY day\n `).all(since) as { day: string; tokens: number }[];\n\n const codexByDay = new Map(codexDaily.map((r) => [r.day, r.tokens]));\n\n // Build last 14 days\n const daily: DailySpend[] = [];\n const now = new Date();\n for (let i = 13; i >= 0; i--) {\n const d = new Date(now);\n d.setDate(d.getDate() - i);\n const key = d.toISOString().slice(0, 10);\n daily.push({\n date: key,\n claudeUsd: claudeByDay.get(key) ?? 0,\n codexTokens: codexByDay.get(key) ?? 0,\n });\n }\n\n return { claudeTotalUsd: claudeTotal, codexTotalTokens: codexTotal, daily };\n}\n\nexport interface TimelineSession {\n id: string;\n tool: string;\n project: string;\n startMs: number;\n endMs: number;\n aiTitle: string | null;\n}\n\nexport function dayTimeline(dayOffset = 0): { dateLabel: string; sessions: TimelineSession[] } {\n const target = new Date();\n target.setDate(target.getDate() + dayOffset);\n target.setHours(0, 0, 0, 0);\n const start = target.getTime();\n const end = start + 86_400_000;\n\n const rows = getDb().prepare(`\n SELECT id, tool, cwd, started_at, ended_at, ai_title\n FROM sessions\n WHERE started_at < ? AND COALESCE(ended_at, started_at + 60000) > ?\n ORDER BY started_at ASC\n `).all(end, start) as { id: string; tool: string; cwd: string | null; started_at: number; ended_at: number | null; ai_title: string | null }[];\n\n return {\n dateLabel: target.toISOString().slice(0, 10),\n sessions: rows.map((r) => ({\n id: r.id,\n tool: r.tool,\n project: r.cwd?.split('/').filter(Boolean).pop() ?? '—',\n startMs: r.started_at,\n endMs: r.ended_at ?? Math.min(Date.now(), end),\n aiTitle: r.ai_title,\n })),\n };\n}\n\nexport interface Achievement {\n id: string;\n title: string;\n description: string;\n unlocked: boolean;\n progress?: { current: number; target: number };\n}\n\nexport function achievements(): Achievement[] {\n const db = getDb();\n const totalSessions = (db.prepare(`SELECT COUNT(*) AS n FROM sessions`).get() as { n: number }).n;\n const longestStreak = activityStreak().longest;\n const sp = spendingStats();\n const longestMs = (db.prepare(`\n SELECT COALESCE(MAX(COALESCE(ended_at, started_at) - started_at), 0) AS ms FROM sessions\n `).get() as { ms: number }).ms;\n const projectCount = (db.prepare(`\n SELECT COUNT(DISTINCT cwd) AS n FROM sessions WHERE cwd IS NOT NULL\n `).get() as { n: number }).n;\n const lateNight = (db.prepare(`\n SELECT COUNT(*) AS n FROM sessions\n WHERE CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) >= 23\n OR CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) < 4\n `).get() as { n: number }).n;\n const earlyBird = (db.prepare(`\n SELECT COUNT(*) AS n FROM sessions\n WHERE CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) >= 4\n AND CAST(strftime('%H', started_at/1000, 'unixepoch', 'localtime') AS INT) < 7\n `).get() as { n: number }).n;\n const toolCount = (db.prepare(`SELECT COUNT(DISTINCT tool) AS n FROM sessions`).get() as { n: number }).n;\n\n const prog = (current: number, target: number) => ({ current: Math.min(current, target), target });\n\n return [\n { id: 'sessions-100', title: '百战不殆', description: '100 sessions logged', unlocked: totalSessions >= 100, progress: prog(totalSessions, 100) },\n { id: 'sessions-500', title: '已成习惯', description: '500 sessions logged', unlocked: totalSessions >= 500, progress: prog(totalSessions, 500) },\n { id: 'sessions-1000', title: '千锤百炼', description: '1000 sessions logged', unlocked: totalSessions >= 1000, progress: prog(totalSessions, 1000) },\n { id: 'streak-7', title: '一周连击', description: '7-day coding streak', unlocked: longestStreak >= 7, progress: prog(longestStreak, 7) },\n { id: 'streak-30', title: '月度坚持', description: '30-day coding streak', unlocked: longestStreak >= 30, progress: prog(longestStreak, 30) },\n { id: 'spend-10', title: '小试牛刀', description: 'Claude spend $10+', unlocked: sp.claudeTotalUsd >= 10, progress: prog(sp.claudeTotalUsd, 10) },\n { id: 'spend-100', title: '挥金如土', description: 'Claude spend $100+', unlocked: sp.claudeTotalUsd >= 100, progress: prog(sp.claudeTotalUsd, 100) },\n { id: 'tokens-100m', title: 'Token 富翁', description: '100M Codex tokens', unlocked: sp.codexTotalTokens >= 100_000_000, progress: prog(sp.codexTotalTokens, 100_000_000) },\n { id: 'tokens-1b', title: 'Token 大户', description: '1B Codex tokens', unlocked: sp.codexTotalTokens >= 1_000_000_000, progress: prog(sp.codexTotalTokens, 1_000_000_000) },\n { id: 'marathon-4h', title: '马拉松选手', description: 'Single session 4h+', unlocked: longestMs >= 4 * 3_600_000, progress: prog(longestMs, 4 * 3_600_000) },\n { id: 'marathon-8h', title: '通宵达旦', description: 'Single session 8h+', unlocked: longestMs >= 8 * 3_600_000, progress: prog(longestMs, 8 * 3_600_000) },\n { id: 'projects-10', title: '博学多才', description: 'Worked on 10+ projects', unlocked: projectCount >= 10, progress: prog(projectCount, 10) },\n { id: 'projects-30', title: '杂家', description: 'Worked on 30+ projects', unlocked: projectCount >= 30, progress: prog(projectCount, 30) },\n { id: 'night-owl', title: '夜猫子', description: 'Past-midnight sessions 10+', unlocked: lateNight >= 10, progress: prog(lateNight, 10) },\n { id: 'early-bird', title: '晨型人', description: 'Pre-7am sessions 5+', unlocked: earlyBird >= 5, progress: prog(earlyBird, 5) },\n { id: 'multi-tool', title: '多面手', description: 'Used 3 different tools', unlocked: toolCount >= 3, progress: prog(toolCount, 3) },\n ];\n}\n","import type Database from 'better-sqlite3';\n\nexport type UsageSource = 'claude_usage_cmd' | 'statusline' | 'manual' | 'codex';\nexport type UsageConfidence = 'high' | 'medium' | 'low';\n\nexport interface UsageSnapshotInput {\n capturedAt: number;\n source: UsageSource;\n accountId: string | null;\n window5hUsedPct: number | null;\n windowWeeklyUsedPct: number | null;\n resetAt5h: number | null;\n resetAtWeekly: number | null;\n rawOutput: string | null;\n confidence: UsageConfidence;\n}\n\nexport interface UsageSnapshotRecord {\n id: number;\n captured_at: number;\n source: UsageSource;\n account_id: string | null;\n window_5h_used_pct: number | null;\n window_weekly_used_pct: number | null;\n reset_at_5h: number | null;\n reset_at_weekly: number | null;\n raw_output: string | null;\n confidence: UsageConfidence;\n}\n\nexport function insertUsageSnapshot(db: Database.Database, input: UsageSnapshotInput): void {\n db.prepare(`\n INSERT INTO usage_snapshots\n (captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence)\n VALUES\n (@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,\n @reset_at_5h, @reset_at_weekly, @raw_output, @confidence)\n `).run({\n captured_at: input.capturedAt,\n source: input.source,\n account_id: input.accountId,\n window_5h_used_pct: input.window5hUsedPct,\n window_weekly_used_pct: input.windowWeeklyUsedPct,\n reset_at_5h: input.resetAt5h,\n reset_at_weekly: input.resetAtWeekly,\n raw_output: input.rawOutput,\n confidence: input.confidence,\n });\n}\n\nexport function getLatestUsageSnapshot(\n db: Database.Database,\n source: UsageSource,\n accountId?: string | null,\n): UsageSnapshotRecord | null {\n const row = accountId != null\n ? db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ? AND account_id = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source, accountId)\n : db.prepare(`\n SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,\n reset_at_5h, reset_at_weekly, raw_output, confidence\n FROM usage_snapshots\n WHERE source = ?\n ORDER BY captured_at DESC\n LIMIT 1\n `).get(source);\n\n return (row as UsageSnapshotRecord | undefined) ?? null;\n}\n"],"names":["_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interop_require_wildcard","obj","__esModule","default","cache","has","get","newObj","__proto__","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","exports","_","createClientModuleProxy","__turbopack_context__","n","LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","linkInstanceRef","replace","scroll","onNavigate","transitionTypes","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","ScrollBehavior","NoScroll","Default","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","as","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","expected","actual","requiredPropsGuard","requiredProps","keys","forEach","optionalPropsGuard","optionalProps","valType","Array","isArray","resolvedHref","formattedHref","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","undefined","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext","__NEXT_CACHE_COMPONENTS","Full","isLegacyBehavior","childIsHostComponent","childIsClientComponent","error","ClientLinkComponent","AUTH_CLAIMS_KEY","defaultAuthPath","join","defaultStoreDir","resolvePaths","paths","authPath","storeDir","accountPath","accountId","readAuthFile","filePath","raw","parsed","JSON","parse","tokens","account_id","writeJsonAtomic","data","dirname","recursive","tmp","pid","Date","now","stringify","encoding","mode","decodeJwtPayload","token","payload","Buffer","from","toString","stringClaim","length","expiryClaim","toISOString","summarizeAuth","auth","storedAt","currentAccountId","idPayload","id_token","accessPayload","access_token","idAuthClaims","accessAuthClaims","email","name","planType","chatgpt_plan_type","userId","user_id","label","slice","lastRefresh","last_refresh","idTokenExpiresAt","exp","accessTokenExpiresAt","isCurrent","getCodexAccounts","currentAuth","accounts","Map","entries","entry","storedAuth","storedStat","summary","mtime","values","sort","b","localeCompare","getCurrentCodexAccount","authMtimeMs","mtimeMs","importCurrentCodexAuth","destination","switchCodexAccount","source","sourceAccountId","backupPath","deleteCodexAccount","catch","src","width","height","Dashboard","dataDir","VIBEMETER_DATA_DIR","cwd"],"mappings":"oMAEA,SAASA,EAAyBC,CAAW,EACzC,GAAuB,YAAnB,OAAOC,QAAwB,OAAO,KAE1C,IAAIC,EAAoB,IAAID,QACxBE,EAAmB,IAAIF,QAE3B,MAAO,CAACF,EAA2B,SAASC,CAAW,EACnD,OAAOA,EAAcG,EAAmBD,EAC5C,CAAC,CAAEF,EACP,CA0BAuB,EAAQC,CAAC,CAzBT,EAyBYpB,OAzBHA,AAA0BC,CAAG,CAAEL,CAAW,EAC/C,GAAI,CAACA,GAAeK,GAAOA,EAAIC,UAAU,CAAE,OAAOD,EAClD,GAAY,OAARA,GAA+B,UAAf,OAAOA,GAAmC,YAAf,OAAOA,EAAoB,MAAO,CAAEE,QAASF,CAAI,EAEhG,IAAIG,EAAQT,EAAyBC,GAErC,GAAIQ,GAASA,EAAMC,GAAG,CAACJ,GAAM,OAAOG,EAAME,GAAG,CAACL,GAE9C,IAAIM,EAAS,CAAEC,UAAW,IAAK,EAC3BC,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