@hirra/vibemeter 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/import-sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/usage/route.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0chedn~._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js +62 -0
- package/.next/server/chunks/[root-of-the-server]__0g0u0lm._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__0ade2u0._.js → [root-of-the-server]__0y68a5d._.js} +5 -5
- package/.next/server/chunks/[root-of-the-server]__0y68a5d._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js +8 -8
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js.map +1 -1
- package/.next/server/chunks/ssr/_0ye~8el._.js +1 -1
- package/.next/server/chunks/ssr/_0ye~8el._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{05t54y~yfn5og.js → 0erq0bmub6w_z.js} +1 -1
- package/package.json +17 -4
- package/.next/server/chunks/[root-of-the-server]__0ade2u0._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js +0 -63
- package/.next/server/chunks/[root-of-the-server]__0ub_1u.._.js.map +0 -1
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_buildManifest.js +0 -0
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{fZRw0LZi2i6aUKKet_Evv → pbaZ4xRfoDHL1KG3S0xG-}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../.data/continuity.sqlite","../../../../../.data/continuity.sqlite-shm","../../../../../.data/continuity.sqlite-wal","../../../../../.data/probe-usage.txt","../../../../../.data/sessions.db","../../../../../.data/statusline-latest.json","../../../../../AGENTS.md","../../../../../CLAUDE.md","../../../../../LICENSE","../../../../../README.md","../../../../../bin/vibemeter.mjs","../../../../../docs/demo1.png","../../../../../eslint.config.mjs","../../../../../next.config.mjs","../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../node_modules/@swc/helpers/package.json","../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../node_modules/next/dist/client/lib/console.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js","../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../node_modules/next/dist/server/node-environment.js","../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../node_modules/next/dist/server/require-hook.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../node_modules/react/cjs/react.development.js","../../../../../node_modules/react/cjs/react.production.js","../../../../../node_modules/react/index.js","../../../../../node_modules/react/package.json","../../../../../package-lock.json","../../../../../package.json","../../../../../postcss.config.mjs","../../../../../public/file.svg","../../../../../public/globe.svg","../../../../../public/next.svg","../../../../../public/vercel.svg","../../../../../public/window.svg","../../../../../src/app/admin/page.tsx","../../../../../src/app/api/codex-accounts/route.ts","../../../../../src/app/api/import-sessions/route.ts","../../../../../src/app/api/sessions/[id]/tags/route.ts","../../../../../src/app/api/sessions/route.ts","../../../../../src/app/api/usage/route.ts","../../../../../src/app/favicon.ico","../../../../../src/app/globals.css","../../../../../src/app/layout.tsx","../../../../../src/app/page.tsx","../../../../../src/components/AchievementsCard.tsx","../../../../../src/components/ActivityCard.tsx","../../../../../src/components/BurndownChart.tsx","../../../../../src/components/CodexAccountsPanel.tsx","../../../../../src/components/Dashboard.tsx","../../../../../src/components/FileHotspots.tsx","../../../../../src/components/ProjectLeaderboard.tsx","../../../../../src/components/SessionsTable.tsx","../../../../../src/components/SpendingCard.tsx","../../../../../src/components/ToolSplitCard.tsx","../../../../../src/lib/codex-auth.ts","../../../../../src/lib/collectors/codex-importer.ts","../../../../../src/lib/collectors/cursor-importer.ts","../../../../../src/lib/collectors/session-importer.ts","../../../../../src/lib/data-dir.ts","../../../../../src/lib/db-bootstrap.ts","../../../../../src/lib/db.ts","../../../../../src/lib/parsers/codex-ratelimit.ts","../../../../../src/lib/parsers/session-log.ts","../../../../../src/lib/parsers/statusline-json.ts","../../../../../src/lib/schema.ts","../../../../../src/lib/session-refresh.ts","../../../../../src/lib/stats.ts","../../../../../src/lib/usage-snapshots.ts","../../../../../tests/codex-auth.test.ts","../../../../../tests/codex-ratelimit.test.ts","../../../../../tests/db-migration.test.ts","../../../../../tests/session-refresh.test.ts","../../../../../tests/usage-accounts.test.ts","../../../../../tools/menubar/Vibemeter.app/Contents/Info.plist","../../../../../tools/menubar/Vibemeter.app/Contents/MacOS/Vibemeter","../../../../../tools/menubar/Vibemeter.swift","../../../../../tools/menubar/build.sh","../../../../../tsconfig.json","../../../../../tsconfig.tsbuildinfo","../../../../node_modules/better-sqlite3-90e2652d1716b047","../../../chunks/[root-of-the-server]__0j8-xkl._.js","../../../chunks/[root-of-the-server]__0ub_1u.._.js","../../../chunks/[turbopack]_runtime.js","../../../chunks/_next-internal_server_app_api_usage_route_actions_0rd63ni.js","./route_client-reference-manifest.js"]}
|
|
1
|
+
{"version":1,"files":["../../../../../.data/continuity.sqlite","../../../../../.data/continuity.sqlite-shm","../../../../../.data/continuity.sqlite-wal","../../../../../.data/probe-usage.txt","../../../../../.data/sessions.db","../../../../../.data/statusline-latest.json","../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../node_modules/@swc/helpers/package.json","../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../node_modules/next/dist/client/lib/console.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js","../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../node_modules/next/dist/server/node-environment.js","../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../node_modules/next/dist/server/require-hook.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../node_modules/react/cjs/react.development.js","../../../../../node_modules/react/cjs/react.production.js","../../../../../node_modules/react/index.js","../../../../../node_modules/react/package.json","../../../../node_modules/better-sqlite3-90e2652d1716b047","../../../chunks/[root-of-the-server]__0g0u0lm._.js","../../../chunks/[root-of-the-server]__0j8-xkl._.js","../../../chunks/[turbopack]_runtime.js","../../../chunks/_next-internal_server_app_api_usage_route_actions_0rd63ni.js","./route_client-reference-manifest.js"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
globalThis.__RSC_MANIFEST = globalThis.__RSC_MANIFEST || {};
|
|
2
|
-
globalThis.__RSC_MANIFEST["/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":39756,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/layout-router.js":{"id":39756,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":37457,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":37457,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":47257,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-page.js":{"id":47257,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":92825,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-segment.js":{"id":92825,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":68017,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":68017,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":97367,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":97367,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":27201,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":27201,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":68027,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/client/components/builtin/global-error.js":{"id":68027,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/src/components/Dashboard.tsx <module evaluation>":{"id":58116,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js","/_next/static/chunks/
|
|
2
|
+
globalThis.__RSC_MANIFEST["/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":39756,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/layout-router.js":{"id":39756,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":37457,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":37457,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":47257,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-page.js":{"id":47257,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":92825,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/client-segment.js":{"id":92825,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":68017,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":68017,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":97367,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":97367,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":27201,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":27201,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":68027,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/node_modules/next/dist/client/components/builtin/global-error.js":{"id":68027,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"async":false},"[project]/src/components/Dashboard.tsx <module evaluation>":{"id":58116,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js","/_next/static/chunks/0erq0bmub6w_z.js"],"async":false},"[project]/src/components/Dashboard.tsx":{"id":58116,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js","/_next/static/chunks/0erq0bmub6w_z.js"],"async":false},"[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>":{"id":22016,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js","/_next/static/chunks/0erq0bmub6w_z.js"],"async":false},"[project]/node_modules/next/dist/client/app-dir/link.js":{"id":22016,"name":"*","chunks":["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js","/_next/static/chunks/0erq0bmub6w_z.js"],"async":false}},"ssrModuleMapping":{"39756":{"*":{"id":2420,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"37457":{"*":{"id":24017,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"47257":{"*":{"id":77682,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"92825":{"*":{"id":97296,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"68017":{"*":{"id":61660,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"97367":{"*":{"id":90574,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"27201":{"*":{"id":60704,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js"],"async":false}},"68027":{"*":{"id":40622,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js","server/chunks/ssr/node_modules_09w7yel._.js"],"async":false}},"58116":{"*":{"id":39579,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js","server/chunks/ssr/_0ye~8el._.js","server/chunks/ssr/node_modules_0ck2~9g._.js"],"async":false}},"22016":{"*":{"id":38246,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__09hgk-7._.js","server/chunks/ssr/node_modules_next_dist_0e1izl_._.js","server/chunks/ssr/_0ye~8el._.js","server/chunks/ssr/node_modules_0ck2~9g._.js"],"async":false}}},"edgeSSRModuleMapping":{},"rscModuleMapping":{"39756":{"*":{"id":26768,"name":"*","chunks":[],"async":false}},"37457":{"*":{"id":17910,"name":"*","chunks":[],"async":false}},"47257":{"*":{"id":92977,"name":"*","chunks":[],"async":false}},"92825":{"*":{"id":48552,"name":"*","chunks":[],"async":false}},"68017":{"*":{"id":83919,"name":"*","chunks":[],"async":false}},"97367":{"*":{"id":24150,"name":"*","chunks":[],"async":false}},"27201":{"*":{"id":40771,"name":"*","chunks":[],"async":false}},"68027":{"*":{"id":82509,"name":"*","chunks":[],"async":false}},"58116":{"*":{"id":92848,"name":"*","chunks":[],"async":false}},"22016":{"*":{"id":84707,"name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{},"entryCSSFiles":{"[project]/src/app/layout":[{"path":"static/chunks/002~6040mndie.css","inlined":false}],"[project]/node_modules/next/dist/client/components/builtin/global-error":[{"path":"static/chunks/002~6040mndie.css","inlined":false}],"[project]/src/app/page":[{"path":"static/chunks/002~6040mndie.css","inlined":false}]},"entryJSFiles":{"[project]/src/app/layout":["static/chunks/01xlw8hd842-c.js","static/chunks/0d3shmwh5_nmn.js"],"[project]/node_modules/next/dist/client/components/builtin/global-error":["static/chunks/01xlw8hd842-c.js","static/chunks/0d3shmwh5_nmn.js"],"[project]/src/app/page":["static/chunks/01xlw8hd842-c.js","static/chunks/0d3shmwh5_nmn.js","static/chunks/0erq0bmub6w_z.js"]}};
|
|
3
3
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},72627,e=>{"use strict";let t;var r,a=e.i(47909),n=e.i(74017),s=e.i(96250),o=e.i(59756),i=e.i(61916),l=e.i(74677),d=e.i(69741),u=e.i(16795),p=e.i(87718),c=e.i(95169),h=e.i(47587),x=e.i(66012),v=e.i(70101),R=e.i(26937),m=e.i(10372),f=e.i(93695);e.i(52474);var g=e.i(220),w=e.i(89171);let y=(r=async()=>{let{importSessions:t}=await e.A(35415);return t()},t=null,{refreshSessions(){if(!t)try{t=Promise.resolve(r()).finally(()=>{t=null})}catch(e){throw t=null,e}return t}});async function E(){try{let e=Date.now(),t=await y.refreshSessions();return w.NextResponse.json({...t,durationMs:Date.now()-e})}catch(e){return w.NextResponse.json({error:e instanceof Error?e.message:"Failed to refresh sessions"},{status:500})}}e.s(["POST",0,E,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],66906);var C=e.i(66906);let A=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/import-sessions/route",pathname:"/api/import-sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/import-sessions/route.ts",nextConfigOutput:"",userland:C,...{}}),{workAsyncStorage:_,workUnitAsyncStorage:b,serverHooks:N}=A;async function P(e,t,r){r.requestMeta&&(0,o.setRequestMeta)(e,r.requestMeta),A.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/import-sessions/route";a=a.replace(/\/index$/,"")||"/";let s=await A.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:w,deploymentId:y,params:E,nextConfig:C,parsedUrl:_,isDraftMode:b,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:T,revalidateOnlyGenerated:S,resolvedPathname:k,clientReferenceManifest:q,serverActionsManifest:j}=s,O=(0,d.normalizeAppPath)(a),H=!!(N.dynamicRoutes[O]||N.routes[k]),I=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,_,!1):t.end("This page could not be found"),null);if(H&&!b){let e=!!N.routes[k],t=N.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await I();throw new f.NoFallbackError}}let M=null;!H||A.isDev||b||(M="/index"===(M=k)?"/":M);let U=!0===A.isDev||!H,D=H&&!U;j&&q&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:q,serverActionsManifest:j});let F=e.method||"GET",$=(0,i.getTracer)(),K=$.getActiveScopeSpan(),B=!!(null==P?void 0:P.isWrappedByNextServer),L=!!(0,o.getRequestMeta)(e,"minimalMode"),G=(0,o.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,C,N,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:E,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:G,cacheLifeProfiles:C.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,P)},sharedContext:{buildId:w,deploymentId:y}},W=new u.NodeNextRequest(e),X=new u.NodeNextResponse(t),z=p.NextRequestAdapter.fromNodeNextRequest(W,(0,p.signalFromNodeResponse)(t));try{let s,o=async e=>A.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${F} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${F} ${a}`)}),l=async s=>{var i,l;let d=async({previousCacheEntry:n})=>{try{if(!L&&T&&S&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=V.renderOpts.fetchMetrics;let i=V.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let l=V.renderOpts.collectedTags;if(!H)return await (0,x.sendResponse)(W,X,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,v.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,n=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),t}},u=await A.handleResponse({req:e,nextConfig:C,cacheKey:M,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:S,responseGenerator:d,waitUntil:r.waitUntil,isMinimalMode:L});if(!H)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,v.fromNodeOutgoingHttpHeaders)(u.value.headers);return L&&H||p.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,R.getCacheControlHeader)(u.cacheControl)),await (0,x.sendResponse)(W,X,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};B&&K?await l(K):(s=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${F} ${a}`,kind:i.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l),void 0,!B))}catch(t){if(t instanceof f.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),H)throw t;return await (0,x.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,P,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:b})},"routeModule",0,A,"serverHooks",0,N,"workAsyncStorage",0,_,"workUnitAsyncStorage",0,b],72627)},35415,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]
|
|
1
|
+
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},72627,e=>{"use strict";let t;var r,a=e.i(47909),n=e.i(74017),s=e.i(96250),o=e.i(59756),i=e.i(61916),l=e.i(74677),d=e.i(69741),u=e.i(16795),p=e.i(87718),c=e.i(95169),h=e.i(47587),x=e.i(66012),v=e.i(70101),R=e.i(26937),m=e.i(10372),f=e.i(93695);e.i(52474);var g=e.i(220),w=e.i(89171);let y=(r=async()=>{let{importSessions:t}=await e.A(35415);return t()},t=null,{refreshSessions(){if(!t)try{t=Promise.resolve(r()).finally(()=>{t=null})}catch(e){throw t=null,e}return t}});async function E(){try{let e=Date.now(),t=await y.refreshSessions();return w.NextResponse.json({...t,durationMs:Date.now()-e})}catch(e){return w.NextResponse.json({error:e instanceof Error?e.message:"Failed to refresh sessions"},{status:500})}}e.s(["POST",0,E,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],66906);var C=e.i(66906);let A=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/import-sessions/route",pathname:"/api/import-sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/import-sessions/route.ts",nextConfigOutput:"",userland:C,...{}}),{workAsyncStorage:_,workUnitAsyncStorage:b,serverHooks:N}=A;async function P(e,t,r){r.requestMeta&&(0,o.setRequestMeta)(e,r.requestMeta),A.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/import-sessions/route";a=a.replace(/\/index$/,"")||"/";let s=await A.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:w,deploymentId:y,params:E,nextConfig:C,parsedUrl:_,isDraftMode:b,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:T,revalidateOnlyGenerated:S,resolvedPathname:k,clientReferenceManifest:q,serverActionsManifest:j}=s,O=(0,d.normalizeAppPath)(a),H=!!(N.dynamicRoutes[O]||N.routes[k]),I=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,_,!1):t.end("This page could not be found"),null);if(H&&!b){let e=!!N.routes[k],t=N.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await I();throw new f.NoFallbackError}}let M=null;!H||A.isDev||b||(M="/index"===(M=k)?"/":M);let U=!0===A.isDev||!H,D=H&&!U;j&&q&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:q,serverActionsManifest:j});let F=e.method||"GET",$=(0,i.getTracer)(),K=$.getActiveScopeSpan(),B=!!(null==P?void 0:P.isWrappedByNextServer),L=!!(0,o.getRequestMeta)(e,"minimalMode"),G=(0,o.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,C,N,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:E,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:G,cacheLifeProfiles:C.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,P)},sharedContext:{buildId:w,deploymentId:y}},W=new u.NodeNextRequest(e),X=new u.NodeNextResponse(t),z=p.NextRequestAdapter.fromNodeNextRequest(W,(0,p.signalFromNodeResponse)(t));try{let s,o=async e=>A.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${F} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${F} ${a}`)}),l=async s=>{var i,l;let d=async({previousCacheEntry:n})=>{try{if(!L&&T&&S&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=V.renderOpts.fetchMetrics;let i=V.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let l=V.renderOpts.collectedTags;if(!H)return await (0,x.sendResponse)(W,X,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,v.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,n=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),t}},u=await A.handleResponse({req:e,nextConfig:C,cacheKey:M,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:S,responseGenerator:d,waitUntil:r.waitUntil,isMinimalMode:L});if(!H)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,v.fromNodeOutgoingHttpHeaders)(u.value.headers);return L&&H||p.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,R.getCacheControlHeader)(u.cacheControl)),await (0,x.sendResponse)(W,X,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};B&&K?await l(K):(s=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${F} ${a}`,kind:i.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l),void 0,!B))}catch(t){if(t instanceof f.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,P),H)throw t;return await (0,x.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,P,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:b})},"routeModule",0,A,"serverHooks",0,N,"workAsyncStorage",0,_,"workUnitAsyncStorage",0,b],72627)},35415,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0y68a5d._.js","server/chunks/node_modules_zod_v4_classic_external_131y~ke.js"].map(t=>e.l(t))).then(()=>t(80909)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0chedn~._.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module.exports=[14747,(e,t,a)=>{t.exports=e.x("path",()=>require("path"))},93695,(e,t,a)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,a)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,a)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},85148,(e,t,a)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},22734,(e,t,a)=>{t.exports=e.x("fs",()=>require("fs"))},43793,77930,e=>{"use strict";var t=e.i(85148),a=e.i(14747),r=e.i(22734);function s(){return process.env.VIBEMETER_DATA_DIR??a.default.join(process.cwd(),".data")}e.s(["dataDir",0,s],77930);let n=null;e.s(["getDb",0,function(){var e;let o;if(n)return n;let i=s();return r.default.mkdirSync(i,{recursive:!0}),(n=new t.default(a.default.join(i,"continuity.sqlite"))).pragma("journal_mode = WAL"),(e=n).exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS sessions (
|
|
3
|
+
id TEXT PRIMARY KEY,
|
|
4
|
+
tool TEXT NOT NULL,
|
|
5
|
+
started_at INTEGER NOT NULL,
|
|
6
|
+
ended_at INTEGER,
|
|
7
|
+
exit_code INTEGER,
|
|
8
|
+
cwd TEXT,
|
|
9
|
+
cli_args TEXT,
|
|
10
|
+
summary TEXT,
|
|
11
|
+
confidence TEXT NOT NULL DEFAULT 'medium'
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
CREATE TABLE IF NOT EXISTS usage_snapshots (
|
|
15
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
16
|
+
captured_at INTEGER NOT NULL,
|
|
17
|
+
source TEXT NOT NULL,
|
|
18
|
+
account_id TEXT,
|
|
19
|
+
window_5h_used_pct REAL,
|
|
20
|
+
window_weekly_used_pct REAL,
|
|
21
|
+
reset_at_5h INTEGER,
|
|
22
|
+
reset_at_weekly INTEGER,
|
|
23
|
+
raw_output TEXT,
|
|
24
|
+
confidence TEXT NOT NULL
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
CREATE TABLE IF NOT EXISTS file_changes (
|
|
28
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
29
|
+
session_id TEXT NOT NULL,
|
|
30
|
+
path TEXT NOT NULL,
|
|
31
|
+
change_type TEXT NOT NULL,
|
|
32
|
+
detected_at INTEGER NOT NULL,
|
|
33
|
+
FOREIGN KEY (session_id) REFERENCES sessions(id)
|
|
34
|
+
);
|
|
35
|
+
`),(o=(t,a,r)=>{try{e.exec(`ALTER TABLE ${t} ADD COLUMN ${a} ${r}`)}catch{}})("sessions","ai_title","TEXT"),o("sessions","tags",'TEXT DEFAULT "[]"'),o("sessions","codex_category","TEXT"),o("sessions","tokens_used","INTEGER"),o("usage_snapshots","account_id","TEXT"),e.exec(`
|
|
36
|
+
CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);
|
|
38
|
+
CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);
|
|
39
|
+
`),n}],43793)},81149,e=>{"use strict";e.s(["getLatestUsageSnapshot",0,function(e,t,a){return(null!=a?e.prepare(`
|
|
40
|
+
SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
41
|
+
reset_at_5h, reset_at_weekly, raw_output, confidence
|
|
42
|
+
FROM usage_snapshots
|
|
43
|
+
WHERE source = ? AND account_id = ?
|
|
44
|
+
ORDER BY captured_at DESC
|
|
45
|
+
LIMIT 1
|
|
46
|
+
`).get(t,a):e.prepare(`
|
|
47
|
+
SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
48
|
+
reset_at_5h, reset_at_weekly, raw_output, confidence
|
|
49
|
+
FROM usage_snapshots
|
|
50
|
+
WHERE source = ?
|
|
51
|
+
ORDER BY captured_at DESC
|
|
52
|
+
LIMIT 1
|
|
53
|
+
`).get(t))??null},"insertUsageSnapshot",0,function(e,t){e.prepare(`
|
|
54
|
+
INSERT INTO usage_snapshots
|
|
55
|
+
(captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
56
|
+
reset_at_5h, reset_at_weekly, raw_output, confidence)
|
|
57
|
+
VALUES
|
|
58
|
+
(@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,
|
|
59
|
+
@reset_at_5h, @reset_at_weekly, @raw_output, @confidence)
|
|
60
|
+
`).run({captured_at:t.capturedAt,source:t.source,account_id:t.accountId,window_5h_used_pct:t.window5hUsedPct,window_weekly_used_pct:t.windowWeeklyUsedPct,reset_at_5h:t.resetAt5h,reset_at_weekly:t.resetAtWeekly,raw_output:t.rawOutput,confidence:t.confidence})}])},62043,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),s=e.i(59756),n=e.i(61916),o=e.i(74677),i=e.i(69741),u=e.i(16795),d=e.i(87718),c=e.i(95169),l=e.i(47587),p=e.i(66012),E=e.i(70101),_=e.i(26937),T=e.i(10372),R=e.i(93695);e.i(52474);var h=e.i(220),w=e.i(89171),x=e.i(43793),g=e.i(81149);let N=new Set(["claude_usage_cmd","statusline","manual","codex"]);e.s(["GET",0,function(e){let t=new URL(e.url),a=t.searchParams.get("source"),r=a&&N.has(a)?a:null,s=t.searchParams.get("accountId"),n=(0,x.getDb)();if(r)return w.NextResponse.json({snapshot:(0,g.getLatestUsageSnapshot)(n,r,"codex"===r&&s?s:null)});let o=n.prepare("SELECT * FROM usage_snapshots ORDER BY captured_at DESC LIMIT 1").get();return w.NextResponse.json({snapshot:o??null})}],51548);var f=e.i(51548);let v=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/usage/route",pathname:"/api/usage",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/usage/route.ts",nextConfigOutput:"",userland:f,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:I,serverHooks:C}=v;async function y(e,t,r){r.requestMeta&&(0,s.setRequestMeta)(e,r.requestMeta),v.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/usage/route";w=w.replace(/\/index$/,"")||"/";let x=await v.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!x)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:g,deploymentId:N,params:f,nextConfig:A,parsedUrl:I,isDraftMode:C,prerenderManifest:y,routerServerContext:m,isOnDemandRevalidate:O,revalidateOnlyGenerated:S,resolvedPathname:L,clientReferenceManifest:U,serverActionsManifest:k}=x,b=(0,i.normalizeAppPath)(w),D=!!(y.dynamicRoutes[b]||y.routes[L]),P=async()=>((null==m?void 0:m.render404)?await m.render404(e,t,I,!1):t.end("This page could not be found"),null);if(D&&!C){let e=!!y.routes[L],t=y.dynamicRoutes[b];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await P();throw new R.NoFallbackError}}let q=null;!D||v.isDev||C||(q="/index"===(q=L)?"/":q);let X=!0===v.isDev||!D,M=D&&!X;k&&U&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:U,serverActionsManifest:k});let j=e.method||"GET",F=(0,n.getTracer)(),H=F.getActiveScopeSpan(),G=!!(null==m?void 0:m.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await v.getIncrementalCache(e,A,y,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let $={params:f,previewProps:y.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:X,incrementalCache:K,cacheLifeProfiles:A.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,s)=>v.onRequestError(e,t,r,s,m)},sharedContext:{buildId:g,deploymentId:N}},Y=new u.NodeNextRequest(e),W=new u.NodeNextResponse(t),V=d.NextRequestAdapter.fromNodeNextRequest(Y,(0,d.signalFromNodeResponse)(t));try{let s,o=async e=>v.handle(V,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=F.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${j} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",r),s.updateName(t))}else e.updateName(`${j} ${w}`)}),i=async s=>{var n,i;let u=async({previousCacheEntry:a})=>{try{if(!B&&O&&S&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(s);e.fetchMetrics=$.renderOpts.fetchMetrics;let i=$.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let u=$.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(Y,W,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,E.toNodeOutgoingHttpHeaders)(n.headers);u&&(t[T.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=T.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,r=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=T.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:h.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:O})},!1,m),t}},d=await v.handleResponse({req:e,nextConfig:A,cacheKey:q,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:S,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:B});if(!D)return null;if((null==d||null==(n=d.value)?void 0:n.kind)!==h.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",O?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,E.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&D||c.delete(T.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,_.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(Y,W,new Response(d.value.body,{headers:c,status:d.value.status||200})),null};G&&H?await i(H):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(c.BaseServerSpan.handleRequest,{spanName:`${j} ${w}`,kind:n.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},i),void 0,!G))}catch(t){if(t instanceof R.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:O})},!1,m),D)throw t;return await (0,p.sendResponse)(Y,W,new Response(null,{status:500})),null}}e.s(["handler",0,y,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:I})},"routeModule",0,v,"serverHooks",0,C,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,I],62043)}];
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0g0u0lm._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/db.ts","../../../src/lib/data-dir.ts","../../../src/lib/db-bootstrap.ts","../../../src/lib/usage-snapshots.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/usage/route.ts"],"sourcesContent":["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","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","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/usage/route\",\n pathname: \"/api/usage\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/usage/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/usage/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextResponse } from 'next/server';\nimport { getDb } from '@/lib/db';\nimport { getLatestUsageSnapshot, type UsageSource } from '@/lib/usage-snapshots';\n\nconst SOURCES = new Set<UsageSource>(['claude_usage_cmd', 'statusline', 'manual', 'codex']);\n\nexport function GET(request: Request) {\n const url = new URL(request.url);\n const requestedSource = url.searchParams.get('source') as UsageSource | null;\n const source = requestedSource && SOURCES.has(requestedSource) ? requestedSource : null;\n const requestedAccountId = url.searchParams.get('accountId');\n const accountId = source === 'codex' && requestedAccountId ? requestedAccountId : null;\n const db = getDb();\n\n if (source) {\n return NextResponse.json({ snapshot: getLatestUsageSnapshot(db, source, accountId) });\n }\n\n const latest = db\n .prepare(`SELECT * FROM usage_snapshots ORDER BY captured_at DESC LIMIT 1`)\n .get();\n return NextResponse.json({ snapshot: latest ?? null });\n}\n"],"names":["dataDir","process","env","VIBEMETER_DATA_DIR","join","cwd","insertUsageSnapshot","db","input","prepare","run","captured_at","capturedAt","source","account_id","accountId","window_5h_used_pct","window5hUsedPct","window_weekly_used_pct","windowWeeklyUsedPct","reset_at_5h","resetAt5h","reset_at_weekly","resetAtWeekly","raw_output","rawOutput","confidence","getLatestUsageSnapshot","row","get","SOURCES","Set","GET","request","url","URL","requestedSource","searchParams","has","requestedAccountId","json","snapshot","latest"],"mappings":"4tCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCOO,SAASA,IACd,OAAOC,QAAQC,GAAG,CAACC,kBAAkB,EAAI,EAAA,OAAI,CAACC,IAAI,CAACH,QAAQI,GAAG,GAAI,QACpE,4BDLA,IAAI,EAAgC,oBAE7B,SAAS,cACd,GAAI,EAAK,OAAO,EAChB,IAAM,EAAM,IAKZ,OAJA,EAAA,OAAE,CAAC,SAAS,CAAC,EAAK,CAAE,UAAW,EAAK,GAEpC,CADA,EAAM,IAAI,EAAA,OAAQ,CAAC,EAAA,OAAI,CAACF,IAAI,CAAC,EAAK,qBAAA,EAC9B,MAAM,CAAC,sBEVX,CADwB,EFYd,AEZmC,GAC1C,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCT,CAAC,EAMD,CAHM,EAAS,CAAC,EAAe,EAAa,KAC1C,GAAI,CAAE,EAAG,IAAI,CAAC,CAAC,YAAY,EAAE,EAAM,YAAY,EAAE,EAAI,CAAC,EAAE,EAAA,CAAK,CAAG,CAAE,KAAM,CAAuB,CACjG,GACO,WAAY,WAAY,QAC/B,EAAO,WAAY,OAAQ,qBAC3B,EAAO,WAAY,iBAAkB,QACrC,EAAO,WAAY,cAAe,WAClC,EAAO,kBAAmB,aAAc,QAExC,EAAG,IAAI,CAAC,CAAC;;;;EAIT,CAAC,EFtCM,CACT,kEGmCO,SAASwB,AACdpB,CAAqB,CACrBM,CAAmB,CACnBE,CAAyB,EAoBzB,MAAQa,CAlBIb,AAAa,QACrBR,EAAGE,OAAO,CAAC,CAAC;;;;;;;MAOZ,CAAC,EA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c,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAAiB,OAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,EACA,sBACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA5TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[4]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[14747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},22734,(e,t,n)=>{t.exports=e.x("fs",()=>require("fs"))},85148,(e,t,n)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},43793,77930,e=>{"use strict";var t=e.i(85148),n=e.i(14747),s=e.i(22734);function a(){return process.env.VIBEMETER_DATA_DIR??n.default.join(process.cwd(),".data")}e.s(["dataDir",0,a],77930);let i=null;e.s(["getDb",0,function(){var e;let r;if(i)return i;let o=a();return s.default.mkdirSync(o,{recursive:!0}),(i=new t.default(n.default.join(o,"continuity.sqlite"))).pragma("journal_mode = WAL"),(e=i).exec(`
|
|
1
|
+
module.exports=[14747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},12714,(e,t,n)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},2157,(e,t,n)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,n)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,n)=>{t.exports=e.x("node:path",()=>require("node:path"))},22734,(e,t,n)=>{t.exports=e.x("fs",()=>require("fs"))},85148,(e,t,n)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},43793,77930,e=>{"use strict";var t=e.i(85148),n=e.i(14747),s=e.i(22734);function a(){return process.env.VIBEMETER_DATA_DIR??n.default.join(process.cwd(),".data")}e.s(["dataDir",0,a],77930);let i=null;e.s(["getDb",0,function(){var e;let r;if(i)return i;let o=a();return s.default.mkdirSync(o,{recursive:!0}),(i=new t.default(n.default.join(o,"continuity.sqlite"))).pragma("journal_mode = WAL"),(e=i).exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
3
3
|
id TEXT PRIMARY KEY,
|
|
4
4
|
tool TEXT NOT NULL,
|
|
@@ -36,8 +36,7 @@ module.exports=[14747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},22734
|
|
|
36
36
|
CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);
|
|
37
37
|
CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);
|
|
38
38
|
CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);
|
|
39
|
-
`),i}],43793)},
|
|
40
|
-
`,{encoding:"utf8",mode:384}),await (0,t.rename)(s,e)}function c(e){if("string"!=typeof e)return null;let[,t]=e.split(".");if(!t)return null;try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{return null}}function u(e){return"string"==typeof e&&e.length>0?e:null}function _(e){return"number"==typeof e?new Date(1e3*e).toISOString():null}function p(e,t,n){let s=u(e.tokens?.account_id);if(!s)throw Error("Codex auth file is missing tokens.account_id");let a=c(e.tokens?.id_token),r=c(e.tokens?.access_token),o=a?.[i],d=r?.[i],l=u(a?.email),p=u(a?.name),f=u(o?.chatgpt_plan_type)??u(d?.chatgpt_plan_type),w=u(o?.user_id)??u(d?.user_id),E=l??p??`${s.slice(0,8)}...${s.slice(-4)}`;return{accountId:s,label:E,email:l,name:p,planType:f,userId:w,lastRefresh:u(e.last_refresh),idTokenExpiresAt:_(a?.exp),accessTokenExpiresAt:_(r?.exp),storedAt:t,isCurrent:s===n}}async function f(e={}){let{authPath:n,storeDir:s}=r(e),i=null,o=null;try{o=await d(n),i=u(o.tokens?.account_id)}catch{o=null}let l=new Map;try{for(let e of(await (0,t.readdir)(s))){if(!e.endsWith(".json"))continue;let n=a.default.join(s,e);try{let e=await d(n),s=await (0,t.stat)(n),a=p(e,s.mtime.toISOString(),i);l.set(a.accountId,a)}catch{}}}catch{}return o&&i&&!l.has(i)&&l.set(i,p(o,null,i)),[...l.values()].sort((e,t)=>e.isCurrent!==t.isCurrent?e.isCurrent?-1:1:e.label.localeCompare(t.label))}async function w(e={}){let{authPath:n,storeDir:s}=r(e),a=await d(n),i=a.tokens?.account_id,c=o(i,s);return await l(c,a),p(a,(await (0,t.stat)(c)).mtime.toISOString(),i)}async function E(e,n={}){let{authPath:s,storeDir:a}=r(n),i=o(e,a),c=await d(i);if(c.tokens?.account_id!==e)throw Error("Stored account id does not match requested account");let u=null;try{let e=await (0,t.readFile)(s,"utf8");u=`${s}.${new Date().toISOString().replace(/[:.]/g,"-")}.bak`,await (0,t.writeFile)(u,e,{encoding:"utf8",mode:384})}catch{u=null}return await l(s,c),{...p(c,null,e),backupPath:u}}async function h(e,n={}){let{authPath:s,storeDir:a}=r(n),i=await d(s).catch(()=>null);if(i?.tokens?.account_id===e)throw Error("Cannot delete the currently active Codex account");await (0,t.unlink)(o(e,a))}e.s(["deleteCodexAccount",0,h,"getCodexAccounts",0,f,"getCurrentCodexAccount",0,function(e={}){let{authPath:t}=r(e);try{let e=JSON.parse((0,n.readFileSync)(t,"utf8")),s=u(e.tokens?.account_id);if(!s)return null;return{accountId:s,authMtimeMs:(0,n.statSync)(t).mtimeMs}}catch{return null}},"importCurrentCodexAuth",0,w,"switchCodexAccount",0,E])},81149,e=>{"use strict";e.s(["getLatestUsageSnapshot",0,function(e,t,n){return(null!=n?e.prepare(`
|
|
39
|
+
`),i}],43793)},81149,e=>{"use strict";e.s(["getLatestUsageSnapshot",0,function(e,t,n){return(null!=n?e.prepare(`
|
|
41
40
|
SELECT id, captured_at, source, account_id, window_5h_used_pct, window_weekly_used_pct,
|
|
42
41
|
reset_at_5h, reset_at_weekly, raw_output, confidence
|
|
43
42
|
FROM usage_snapshots
|
|
@@ -58,7 +57,8 @@ module.exports=[14747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},22734
|
|
|
58
57
|
VALUES
|
|
59
58
|
(@captured_at, @source, @account_id, @window_5h_used_pct, @window_weekly_used_pct,
|
|
60
59
|
@reset_at_5h, @reset_at_weekly, @raw_output, @confidence)
|
|
61
|
-
`).run({captured_at:t.capturedAt,source:t.source,account_id:t.accountId,window_5h_used_pct:t.window5hUsedPct,window_weekly_used_pct:t.windowWeeklyUsedPct,reset_at_5h:t.resetAt5h,reset_at_weekly:t.resetAtWeekly,raw_output:t.rawOutput,confidence:t.confidence})}])},
|
|
60
|
+
`).run({captured_at:t.capturedAt,source:t.source,account_id:t.accountId,window_5h_used_pct:t.window5hUsedPct,window_weekly_used_pct:t.windowWeeklyUsedPct,reset_at_5h:t.resetAt5h,reset_at_weekly:t.resetAtWeekly,raw_output:t.rawOutput,confidence:t.confidence})}])},46023,e=>{"use strict";var t=e.i(12714),n=e.i(2157),s=e.i(60526),a=e.i(50227);let i="https://api.openai.com/auth";function r(e={}){return{authPath:e.authPath??a.default.join((0,s.homedir)(),".codex","auth.json"),storeDir:e.storeDir??a.default.join((0,s.homedir)(),".codex","auth-accounts")}}function o(e,t){return a.default.join(t,`${e.replace(/[^a-zA-Z0-9_-]/g,"_")}.json`)}async function d(e){let n=JSON.parse(await (0,t.readFile)(e,"utf8"));if(!n.tokens||"string"!=typeof n.tokens.account_id)throw Error("Codex auth file is missing tokens.account_id");return n}async function l(e,n){await (0,t.mkdir)(a.default.dirname(e),{recursive:!0});let s=`${e}.${process.pid}.${Date.now()}.tmp`;await (0,t.writeFile)(s,`${JSON.stringify(n,null,2)}
|
|
61
|
+
`,{encoding:"utf8",mode:384}),await (0,t.rename)(s,e)}function c(e){if("string"!=typeof e)return null;let[,t]=e.split(".");if(!t)return null;try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{return null}}function u(e){return"string"==typeof e&&e.length>0?e:null}function _(e){return"number"==typeof e?new Date(1e3*e).toISOString():null}function p(e,t,n){let s=u(e.tokens?.account_id);if(!s)throw Error("Codex auth file is missing tokens.account_id");let a=c(e.tokens?.id_token),r=c(e.tokens?.access_token),o=a?.[i],d=r?.[i],l=u(a?.email),p=u(a?.name),f=u(o?.chatgpt_plan_type)??u(d?.chatgpt_plan_type),w=u(o?.user_id)??u(d?.user_id),E=l??p??`${s.slice(0,8)}...${s.slice(-4)}`;return{accountId:s,label:E,email:l,name:p,planType:f,userId:w,lastRefresh:u(e.last_refresh),idTokenExpiresAt:_(a?.exp),accessTokenExpiresAt:_(r?.exp),storedAt:t,isCurrent:s===n}}async function f(e={}){let{authPath:n,storeDir:s}=r(e),i=null,o=null;try{o=await d(n),i=u(o.tokens?.account_id)}catch{o=null}let l=new Map;try{for(let e of(await (0,t.readdir)(s))){if(!e.endsWith(".json"))continue;let n=a.default.join(s,e);try{let e=await d(n),s=await (0,t.stat)(n),a=p(e,s.mtime.toISOString(),i);l.set(a.accountId,a)}catch{}}}catch{}return o&&i&&!l.has(i)&&l.set(i,p(o,null,i)),[...l.values()].sort((e,t)=>e.isCurrent!==t.isCurrent?e.isCurrent?-1:1:e.label.localeCompare(t.label))}async function w(e={}){let{authPath:n,storeDir:s}=r(e),a=await d(n),i=a.tokens?.account_id,c=o(i,s);return await l(c,a),p(a,(await (0,t.stat)(c)).mtime.toISOString(),i)}async function E(e,n={}){let{authPath:s,storeDir:a}=r(n),i=o(e,a),c=await d(i);if(c.tokens?.account_id!==e)throw Error("Stored account id does not match requested account");let u=null;try{let e=await (0,t.readFile)(s,"utf8");u=`${s}.${new Date().toISOString().replace(/[:.]/g,"-")}.bak`,await (0,t.writeFile)(u,e,{encoding:"utf8",mode:384})}catch{u=null}return await l(s,c),{...p(c,null,e),backupPath:u}}async function h(e,n={}){let{authPath:s,storeDir:a}=r(n),i=await d(s).catch(()=>null);if(i?.tokens?.account_id===e)throw Error("Cannot delete the currently active Codex account");await (0,t.unlink)(o(e,a))}e.s(["deleteCodexAccount",0,h,"getCodexAccounts",0,f,"getCurrentCodexAccount",0,function(e={}){let{authPath:t}=r(e);try{let e=JSON.parse((0,n.readFileSync)(t,"utf8")),s=u(e.tokens?.account_id);if(!s)return null;return{accountId:s,authMtimeMs:(0,n.statSync)(t).mtimeMs}}catch{return null}},"importCurrentCodexAuth",0,w,"switchCodexAccount",0,E])},46786,(e,t,n)=>{t.exports=e.x("os",()=>require("os"))},80909,e=>{"use strict";var t=e.i(22734),n=e.i(14747),s=e.i(46786),a=e.i(43793),i=e.i(69719);let r=i.z.object({timestamp:i.z.string().optional(),sessionId:i.z.string().optional(),cwd:i.z.string().optional(),gitBranch:i.z.string().optional(),version:i.z.string().optional(),type:i.z.string()}).passthrough(),o=i.z.object({type:i.z.literal("ai-title"),aiTitle:i.z.string(),sessionId:i.z.string()});var d=e.i(77930);let l=n.default.join((0,d.dataDir)(),"statusline-latest.json"),c=i.z.object({session_id:i.z.string().optional(),session_name:i.z.string().optional(),transcript_path:i.z.string().optional(),cwd:i.z.string().optional(),model:i.z.object({id:i.z.string(),display_name:i.z.string()}).optional(),cost:i.z.object({total_cost_usd:i.z.number()}).optional(),context_window:i.z.object({total_input_tokens:i.z.number(),total_output_tokens:i.z.number(),used_percentage:i.z.number()}).optional(),rate_limits:i.z.object({five_hour:i.z.object({used_percentage:i.z.number(),resets_at:i.z.number().optional()}).optional(),seven_day:i.z.object({used_percentage:i.z.number(),resets_at:i.z.number().optional()}).optional()}).optional()}).passthrough(),u=n.default.join(s.default.homedir(),".codex","sessions"),_=n.default.join(s.default.homedir(),".codex"),p=n.default.join(_,"state_5.sqlite"),f=n.default.join(_,"history.jsonl"),w=n.default.join(s.default.homedir(),"Library/Application Support/Cursor/User"),E=n.default.join(w,"workspaceStorage"),h=n.default.join(w,"globalStorage/state.vscdb");var T=e.i(46023),m=e.i(81149);let y=n.default.join(s.default.homedir(),".claude"),S=n.default.join(y,"projects"),g=n.default.join(y,"sessions");e.s(["importSessions",0,function(){let s=(0,a.getDb)(),i=function(){let e=new Set;try{for(let s of t.default.readdirSync(g))if(s.endsWith(".json"))try{let a=t.default.readFileSync(n.default.join(g,s),"utf8"),i=JSON.parse(a);i.sessionId&&e.add(i.sessionId)}catch{}}catch{}return e}(),d=function(){let e=[];try{for(let s of t.default.readdirSync(S)){let a=n.default.join(S,s);try{if(!t.default.statSync(a).isDirectory())continue;for(let s of t.default.readdirSync(a))s.endsWith(".jsonl")&&e.push(n.default.join(a,s))}catch{}}}catch{}return e}(),_=s.prepare(`
|
|
62
62
|
INSERT INTO sessions (id, tool, started_at, ended_at, exit_code, cwd, cli_args, summary, ai_title, confidence)
|
|
63
63
|
VALUES (@id, @tool, @started_at, @ended_at, @exit_code, @cwd, @cli_args, @summary, @ai_title, @confidence)
|
|
64
64
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -93,4 +93,4 @@ module.exports=[14747,(e,t,n)=>{t.exports=e.x("path",()=>require("path"))},22734
|
|
|
93
93
|
ai_title = COALESCE(sessions.ai_title, excluded.ai_title)
|
|
94
94
|
`);try{s=t.default.readdirSync(E)}catch{return}if(r.transaction(()=>{for(let e of s){let s=n.default.join(E,e,"state.vscdb"),a=n.default.join(E,e,"workspace.json");if(!t.default.existsSync(s))continue;let r=null;try{let e=JSON.parse(t.default.readFileSync(a,"utf8"));r=e.folder?.replace("file://","")??null}catch{}try{let e=new i(s,{readonly:!0}),t=e.prepare("SELECT value FROM ItemTable WHERE key = 'composer.composerData'").get();if(e.close(),!t)continue;for(let e of JSON.parse(t.value).allComposers??[])e.composerId&&e.createdAt&&o.run({id:e.composerId,started_at:e.createdAt,ended_at:e.createdAt,cwd:r,ai_title:e.name??null})}catch{}}})(),t.default.existsSync(h))try{let e=new i(h,{readonly:!0});if(e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='cursorDiskKV'").get()){let t=e.prepare("SELECT key, value FROM cursorDiskKV WHERE key LIKE 'composerData:%'").all();r.transaction(()=>{for(let e of t){let t,n=e.key.slice(13);try{t=JSON.parse("string"==typeof e.value?e.value:e.value.toString("utf8"))}catch{continue}let s=t.composerId||n,a=t.createdAt;if(!s||!a)continue;let i=t.lastUpdatedAt??a,r=t.name||(t.text?t.text.slice(0,120):null);o.run({id:s,started_at:a,ended_at:i,cwd:null,ai_title:r})}})()}e.close()}catch{}}();let N=function(){let e;try{e=t.default.readFileSync(l,"utf8")}catch{return null}let n=c.safeParse(JSON.parse(e));if(!n.success)return null;let s=n.data,a=s.rate_limits;return{window_5h_used_pct:a?.five_hour?.used_percentage??null,window_weekly_used_pct:a?.seven_day?.used_percentage??null,reset_at_5h:a?.five_hour?.resets_at!=null?1e3*a.five_hour.resets_at:null,reset_at_weekly:a?.seven_day?.resets_at!=null?1e3*a.seven_day.resets_at:null,raw_output:e.slice(0,2e3),confidence:"high",session_id:s.session_id??null,session_name:s.session_name??null,cwd:s.cwd??null}}();N&&(0,m.insertUsageSnapshot)(s,{capturedAt:Date.now(),source:"statusline",accountId:null,window5hUsedPct:N.window_5h_used_pct,windowWeeklyUsedPct:N.window_weekly_used_pct,resetAt5h:N.reset_at_5h,resetAtWeekly:N.reset_at_weekly,rawOutput:N.raw_output,confidence:"high"});let O=(0,T.getCurrentCodexAccount)(),x=function(e={}){let s=e.sessionsDir??u,a=e.minMtimeMs??0;try{let e=null;if(!t.default.existsSync(s)||(!function s(i){for(let r of t.default.readdirSync(i)){let o=n.default.join(i,r);try{let n=t.default.statSync(o);if(n.isDirectory()){s(o);continue}r.endsWith(".jsonl")&&n.mtimeMs>=a&&n.mtimeMs>(e?.mtime??0)&&(e={path:o,mtime:n.mtimeMs})}catch{}}}(s),!e))return null;for(let n of t.default.readFileSync(e.path,"utf8").split("\n").filter(Boolean).reverse())try{let t=JSON.parse(n),s=t?.payload?.rate_limits;if(!s?.primary||!s?.secondary)continue;return{window_5h_used_pct:s.primary.used_percent,window_weekly_used_pct:s.secondary.used_percent,reset_at_5h:1e3*s.primary.resets_at,reset_at_weekly:1e3*s.secondary.resets_at,source_mtime_ms:e.mtime}}catch{}return null}catch{return null}}({minMtimeMs:O?.authMtimeMs});return x&&(0,m.insertUsageSnapshot)(s,{capturedAt:Date.now(),source:"codex",accountId:O?.accountId??null,window5hUsedPct:x.window_5h_used_pct,windowWeeklyUsedPct:x.window_weekly_used_pct,resetAt5h:x.reset_at_5h,resetAtWeekly:x.reset_at_weekly,rawOutput:null,confidence:"high"}),{scanned:d.length,inserted:w,skipped:y}}],80909)}];
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
96
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0y68a5d._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/db.ts","../../../src/lib/data-dir.ts","../../../src/lib/db-bootstrap.ts","../../../src/lib/usage-snapshots.ts","../../../src/lib/codex-auth.ts","../../../src/lib/collectors/session-importer.ts","../../../src/lib/parsers/session-log.ts","../../../src/lib/parsers/statusline-json.ts","../../../src/lib/parsers/codex-ratelimit.ts","../../../src/lib/collectors/codex-importer.ts","../../../src/lib/collectors/cursor-importer.ts"],"sourcesContent":["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","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","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","/**\n * Scans ~/.claude/projects/ for session JSONL files and upserts them into SQLite.\n * Active sessions (present in ~/.claude/sessions/) get ended_at = null.\n *\n * This is the primary data source — no claude CLI alias needed.\n * confidence='high' because data comes directly from Claude Code's own files.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\nimport { parseSessionLog } from '../parsers/session-log';\nimport { parseStatuslineJson } from '../parsers/statusline-json';\nimport { parseCodexRateLimit } from '../parsers/codex-ratelimit';\nimport { importCodexSessions } from './codex-importer';\nimport { importCursorSessions } from './cursor-importer';\nimport { getCurrentCodexAccount } from '../codex-auth';\nimport { insertUsageSnapshot } from '../usage-snapshots';\n\nconst CLAUDE_DIR = path.join(os.homedir(), '.claude');\nconst PROJECTS_DIR = path.join(CLAUDE_DIR, 'projects');\nconst SESSIONS_DIR = path.join(CLAUDE_DIR, 'sessions');\n\n/** Returns the set of sessionIds currently active (file present in ~/.claude/sessions/). */\nfunction getActiveSessionIds(): Set<string> {\n const active = new Set<string>();\n try {\n const files = fs.readdirSync(SESSIONS_DIR);\n for (const f of files) {\n if (!f.endsWith('.json')) continue;\n try {\n const raw = fs.readFileSync(path.join(SESSIONS_DIR, f), 'utf8');\n const data = JSON.parse(raw) as { sessionId?: string };\n if (data.sessionId) active.add(data.sessionId);\n } catch { /* corrupt file, skip */ }\n }\n } catch { /* SESSIONS_DIR doesn't exist */ }\n return active;\n}\n\n/** Returns all .jsonl paths under ~/.claude/projects/. */\nfunction collectJsonlPaths(): string[] {\n const result: string[] = [];\n try {\n const projectDirs = fs.readdirSync(PROJECTS_DIR);\n for (const dir of projectDirs) {\n const full = path.join(PROJECTS_DIR, dir);\n try {\n const stat = fs.statSync(full);\n if (!stat.isDirectory()) continue;\n const files = fs.readdirSync(full);\n for (const f of files) {\n if (f.endsWith('.jsonl')) result.push(path.join(full, f));\n }\n } catch { /* skip */ }\n }\n } catch { /* PROJECTS_DIR doesn't exist */ }\n return result;\n}\n\nexport interface ImportResult {\n scanned: number;\n inserted: number;\n skipped: number;\n}\n\nexport function importSessions(): ImportResult {\n const db = getDb();\n const activeIds = getActiveSessionIds();\n const jsonlPaths = collectJsonlPaths();\n\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, exit_code, cwd, cli_args, summary, ai_title, confidence)\n VALUES (@id, @tool, @started_at, @ended_at, @exit_code, @cwd, @cli_args, @summary, @ai_title, @confidence)\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n exit_code = excluded.exit_code,\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title),\n confidence = excluded.confidence\n `);\n\n let inserted = 0;\n let skipped = 0;\n\n const importAll = db.transaction(() => {\n for (const jsonlPath of jsonlPaths) {\n const meta = parseSessionLog(jsonlPath);\n if (!meta || !meta.startedAt) { skipped++; continue; }\n\n const isActive = activeIds.has(meta.sessionId);\n\n upsert.run({\n id: meta.sessionId,\n tool: 'claude-code',\n started_at: meta.startedAt,\n ended_at: isActive ? null : meta.lastSeenAt,\n exit_code: null,\n cwd: meta.cwd,\n cli_args: null,\n summary: null,\n ai_title: meta.aiTitle,\n confidence: 'high',\n });\n inserted++;\n }\n });\n\n importAll();\n importCodexSessions();\n importCursorSessions();\n\n // Claude Code: from statusline-latest.json written by statusline-command.sh\n const usage = parseStatuslineJson();\n if (usage) {\n insertUsageSnapshot(db, {\n capturedAt: Date.now(),\n source: 'statusline',\n accountId: null,\n window5hUsedPct: usage.window_5h_used_pct,\n windowWeeklyUsedPct: usage.window_weekly_used_pct,\n resetAt5h: usage.reset_at_5h,\n resetAtWeekly: usage.reset_at_weekly,\n rawOutput: usage.raw_output,\n confidence: 'high',\n });\n }\n\n // Codex: from most recent ~/.codex/sessions/*/rollout-*.jsonl rate_limits event\n const currentCodexAccount = getCurrentCodexAccount();\n const codexUsage = parseCodexRateLimit({\n minMtimeMs: currentCodexAccount?.authMtimeMs,\n });\n if (codexUsage) {\n insertUsageSnapshot(db, {\n capturedAt: Date.now(),\n source: 'codex',\n accountId: currentCodexAccount?.accountId ?? null,\n window5hUsedPct: codexUsage.window_5h_used_pct,\n windowWeeklyUsedPct: codexUsage.window_weekly_used_pct,\n resetAt5h: codexUsage.reset_at_5h,\n resetAtWeekly: codexUsage.reset_at_weekly,\n rawOutput: null,\n confidence: 'high',\n });\n }\n\n return { scanned: jsonlPaths.length, inserted, skipped };\n}\n","import fs from 'fs';\nimport { z } from 'zod';\n\n// Minimal shapes we care about — extra fields are ignored via .passthrough()\nconst LineWithTimestamp = z.object({\n timestamp: z.string().optional(),\n sessionId: z.string().optional(),\n cwd: z.string().optional(),\n gitBranch: z.string().optional(),\n version: z.string().optional(),\n type: z.string(),\n}).passthrough();\n\nconst AiTitleLine = z.object({\n type: z.literal('ai-title'),\n aiTitle: z.string(),\n sessionId: z.string(),\n});\n\nexport interface SessionLogMeta {\n sessionId: string;\n cwd: string | null;\n gitBranch: string | null;\n version: string | null;\n /** Unix ms of first timestamped line */\n startedAt: number | null;\n /** Unix ms of last timestamped line */\n lastSeenAt: number | null;\n /**\n * Claude-generated session title from the ai-title event.\n * Safe to store (not user prompt content).\n * TODO Day 2: use as seed for continuation prompt generation.\n */\n aiTitle: string | null;\n}\n\nexport function parseSessionLog(jsonlPath: string): SessionLogMeta | null {\n let raw: string;\n try {\n raw = fs.readFileSync(jsonlPath, 'utf8');\n } catch {\n return null;\n }\n\n const lines = raw.split('\\n').filter(Boolean);\n if (lines.length === 0) return null;\n\n // sessionId comes from the filename (uuid before .jsonl)\n const sessionId = jsonlPath.split('/').pop()?.replace('.jsonl', '') ?? null;\n if (!sessionId) return null;\n\n let cwd: string | null = null;\n let gitBranch: string | null = null;\n let version: string | null = null;\n let startedAt: number | null = null;\n let lastSeenAt: number | null = null;\n let aiTitle: string | null = null;\n\n for (const line of lines) {\n let parsed: Record<string, unknown>;\n try {\n parsed = JSON.parse(line) as Record<string, unknown>;\n } catch {\n continue;\n }\n\n const base = LineWithTimestamp.safeParse(parsed);\n if (!base.success) continue;\n\n const data = base.data;\n\n if (data.timestamp) {\n const ms = new Date(data.timestamp).getTime();\n if (!Number.isNaN(ms)) {\n if (startedAt === null || ms < startedAt) startedAt = ms;\n if (lastSeenAt === null || ms > lastSeenAt) lastSeenAt = ms;\n }\n }\n\n if (!cwd && data.cwd) cwd = data.cwd;\n if (!gitBranch && data.gitBranch) gitBranch = data.gitBranch;\n if (!version && data.version) version = data.version;\n\n if (data.type === 'ai-title') {\n const titleParsed = AiTitleLine.safeParse(parsed);\n if (titleParsed.success) aiTitle = titleParsed.data.aiTitle;\n }\n }\n\n return { sessionId, cwd, gitBranch, version, startedAt, lastSeenAt, aiTitle };\n}\n\nexport interface ConversationTurn {\n role: 'user' | 'assistant';\n text: string;\n toolNames?: string[];\n}\n\nexport function readConversationTurns(jsonlPath: string, limit = 12): ConversationTurn[] {\n let raw: string;\n try {\n raw = fs.readFileSync(jsonlPath, 'utf8');\n } catch {\n return [];\n }\n\n const turns: ConversationTurn[] = [];\n\n for (const line of raw.split('\\n').filter(Boolean)) {\n let parsed: Record<string, unknown>;\n try { parsed = JSON.parse(line) as Record<string, unknown>; } catch { continue; }\n\n const type = parsed.type as string | undefined;\n const msg = parsed.message as Record<string, unknown> | undefined;\n if (!msg || (type !== 'user' && type !== 'assistant')) continue;\n\n const role = msg.role as string;\n const content = msg.content;\n\n if (role === 'user' && typeof content === 'string' && content.trim()) {\n turns.push({ role: 'user', text: content.trim().slice(0, 800) });\n } else if (role === 'assistant' && Array.isArray(content)) {\n const textParts: string[] = [];\n const toolNames: string[] = [];\n for (const part of content as Record<string, unknown>[]) {\n if (part.type === 'text' && typeof part.text === 'string') {\n textParts.push((part.text as string).slice(0, 600));\n } else if (part.type === 'tool_use' && typeof part.name === 'string') {\n toolNames.push(part.name as string);\n }\n }\n if (textParts.length > 0 || toolNames.length > 0) {\n turns.push({ role: 'assistant', text: textParts.join(' ').trim(), toolNames });\n }\n }\n }\n\n return turns.slice(-limit);\n}\n","/**\n * Parses ~/.data/statusline-latest.json written by the patched statusline-command.sh.\n * Claude Code writes this file on every status line render with current session context.\n * All fields come directly from Claude Code internals — confidence='high'.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport { z } from 'zod';\nimport { dataDir } from '../data-dir';\n\nexport const STATUSLINE_PATH = path.join(dataDir(), 'statusline-latest.json');\n\nconst StatuslineSchema = z.object({\n session_id: z.string().optional(),\n session_name: z.string().optional(),\n transcript_path: z.string().optional(),\n cwd: z.string().optional(),\n model: z.object({ id: z.string(), display_name: z.string() }).optional(),\n cost: z.object({ total_cost_usd: z.number() }).optional(),\n context_window: z.object({\n total_input_tokens: z.number(),\n total_output_tokens: z.number(),\n used_percentage: z.number(),\n }).optional(),\n rate_limits: z.object({\n five_hour: z.object({\n used_percentage: z.number(),\n resets_at: z.number().optional(), // unix seconds\n }).optional(),\n seven_day: z.object({\n used_percentage: z.number(),\n resets_at: z.number().optional(),\n }).optional(),\n }).optional(),\n}).passthrough();\n\nexport type StatuslineData = z.infer<typeof StatuslineSchema>;\n\nexport interface StatuslineUsage {\n window_5h_used_pct: number | null;\n window_weekly_used_pct: number | null;\n reset_at_5h: number | null; // unix ms\n reset_at_weekly: number | null; // unix ms\n raw_output: string;\n confidence: 'high';\n /** Also returned for session upsert */\n session_id: string | null;\n session_name: string | null;\n cwd: string | null;\n}\n\nexport function parseStatuslineJson(): StatuslineUsage | null {\n let raw: string;\n try {\n raw = fs.readFileSync(STATUSLINE_PATH, 'utf8');\n } catch {\n return null;\n }\n\n const parsed = StatuslineSchema.safeParse(JSON.parse(raw));\n if (!parsed.success) return null;\n\n const d = parsed.data;\n const rl = d.rate_limits;\n\n return {\n window_5h_used_pct: rl?.five_hour?.used_percentage ?? null,\n window_weekly_used_pct: rl?.seven_day?.used_percentage ?? null,\n // resets_at from Claude Code is unix seconds — convert to ms\n reset_at_5h: rl?.five_hour?.resets_at != null ? rl.five_hour.resets_at * 1000 : null,\n reset_at_weekly: rl?.seven_day?.resets_at != null ? rl.seven_day.resets_at * 1000 : null,\n raw_output: raw.slice(0, 2000),\n confidence: 'high',\n session_id: d.session_id ?? null,\n session_name: d.session_name ?? null,\n cwd: d.cwd ?? null,\n };\n}\n","/**\n * Scans the most recent ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl and extracts\n * the last rate_limits event (type=token_count with payload.rate_limits).\n * primary = 5-hour window (300 min)\n * secondary = 7-day window (10080 min)\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport os from 'os';\n\nconst SESSIONS_DIR = path.join(os.homedir(), '.codex', 'sessions');\n\ninterface RateLimitWindow {\n used_percent: number;\n window_minutes: number;\n resets_at: number; // unix seconds\n}\n\ninterface RateLimits {\n primary: RateLimitWindow;\n secondary: RateLimitWindow;\n}\n\nexport interface CodexUsage {\n window_5h_used_pct: number;\n window_weekly_used_pct: number;\n reset_at_5h: number; // unix ms\n reset_at_weekly: number; // unix ms\n source_mtime_ms: number;\n}\n\nexport interface CodexRateLimitParseOptions {\n sessionsDir?: string;\n minMtimeMs?: number;\n}\n\nexport function parseCodexRateLimit(options: CodexRateLimitParseOptions = {}): CodexUsage | null {\n // Find the most recently modified jsonl across all session dirs\n const sessionsDir = options.sessionsDir ?? SESSIONS_DIR;\n const minMtimeMs = options.minMtimeMs ?? 0;\n try {\n let bestFile: { path: string; mtime: number } | null = null as { path: string; mtime: number } | null;\n function walk(dir: string) {\n for (const entry of fs.readdirSync(dir)) {\n const full = path.join(dir, entry);\n try {\n const stat = fs.statSync(full);\n if (stat.isDirectory()) { walk(full); continue; }\n if (entry.endsWith('.jsonl') && stat.mtimeMs >= minMtimeMs && stat.mtimeMs > (bestFile?.mtime ?? 0)) {\n bestFile = { path: full, mtime: stat.mtimeMs };\n }\n } catch { /* skip */ }\n }\n }\n if (!fs.existsSync(sessionsDir)) return null;\n walk(sessionsDir);\n if (!bestFile) return null;\n\n // Read from the end — last rate_limits event wins\n const lines = fs.readFileSync(bestFile.path, 'utf8').split('\\n').filter(Boolean).reverse();\n for (const line of lines) {\n try {\n const obj = JSON.parse(line) as { payload?: { rate_limits?: RateLimits } };\n const rl = obj?.payload?.rate_limits;\n if (!rl?.primary || !rl?.secondary) continue;\n return {\n window_5h_used_pct: rl.primary.used_percent,\n window_weekly_used_pct: rl.secondary.used_percent,\n reset_at_5h: rl.primary.resets_at * 1000,\n reset_at_weekly: rl.secondary.resets_at * 1000,\n source_mtime_ms: bestFile.mtime,\n };\n } catch { /* skip */ }\n }\n return null;\n } catch {\n return null;\n }\n}\n","import fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\n\nconst CODEX_DIR = path.join(os.homedir(), '.codex');\nconst STATE_DB = path.join(CODEX_DIR, 'state_5.sqlite');\nconst HISTORY_PATH = path.join(CODEX_DIR, 'history.jsonl');\n\ninterface ThreadRow {\n id: string;\n created_at_ms: number;\n updated_at_ms: number;\n cwd: string | null;\n title: string | null;\n first_user_message: string | null;\n tokens_used: number | null;\n git_branch: string | null;\n model: string | null;\n archived: number;\n}\n\nfunction importFromStateDb(): boolean {\n if (!fs.existsSync(STATE_DB)) return false;\n try {\n // Use better-sqlite3 to read Codex's own SQLite\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BetterSqlite = require('better-sqlite3') as typeof import('better-sqlite3');\n const codexDb = new BetterSqlite(STATE_DB, { readonly: true });\n\n const threads = codexDb.prepare(`\n SELECT id, created_at_ms, updated_at_ms, cwd, title, first_user_message,\n tokens_used, git_branch, model, archived\n FROM threads\n ORDER BY created_at_ms ASC\n `).all() as ThreadRow[];\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, cwd, ai_title, tokens_used, confidence)\n VALUES (@id, 'codex', @started_at, @ended_at, @cwd, @ai_title, @tokens_used, 'high')\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n cwd = COALESCE(sessions.cwd, excluded.cwd),\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title),\n tokens_used = excluded.tokens_used,\n confidence = 'high'\n `);\n\n const importAll = db.transaction(() => {\n for (const t of threads) {\n upsert.run({\n id: t.id,\n started_at: t.created_at_ms,\n ended_at: t.updated_at_ms,\n cwd: t.cwd,\n ai_title: t.title ?? t.first_user_message?.slice(0, 120) ?? null,\n tokens_used: t.tokens_used,\n });\n }\n });\n importAll();\n codexDb.close();\n return true;\n } catch {\n return false;\n }\n}\n\nfunction importFromHistoryJsonl(): void {\n if (!fs.existsSync(HISTORY_PATH)) return;\n interface Entry { session_id: string; ts: number; }\n const bySession = new Map<string, { minTs: number; maxTs: number }>();\n try {\n for (const line of fs.readFileSync(HISTORY_PATH, 'utf8').split('\\n').filter(Boolean)) {\n try {\n const e = JSON.parse(line) as Entry;\n if (!e.session_id || !e.ts) continue;\n const cur = bySession.get(e.session_id);\n if (!cur) { bySession.set(e.session_id, { minTs: e.ts, maxTs: e.ts }); }\n else { if (e.ts < cur.minTs) cur.minTs = e.ts; if (e.ts > cur.maxTs) cur.maxTs = e.ts; }\n } catch { /* skip */ }\n }\n } catch { return; }\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, confidence)\n VALUES (@id, 'codex', @started_at, @ended_at, 'medium')\n ON CONFLICT(id) DO NOTHING\n `);\n const importAll = db.transaction(() => {\n for (const [id, { minTs, maxTs }] of bySession) {\n upsert.run({ id, started_at: minTs * 1000, ended_at: maxTs * 1000 });\n }\n });\n importAll();\n}\n\nexport function importCodexSessions(): void {\n const usedStateDb = importFromStateDb();\n if (!usedStateDb) importFromHistoryJsonl(); // fallback\n}\n","import fs from 'fs';\nimport path from 'path';\nimport os from 'os';\nimport { getDb } from '../db';\n\nconst CURSOR_BASE = path.join(\n os.homedir(),\n 'Library/Application Support/Cursor/User'\n);\nconst CURSOR_WS = path.join(CURSOR_BASE, 'workspaceStorage');\nconst CURSOR_GLOBAL_DB = path.join(CURSOR_BASE, 'globalStorage/state.vscdb');\n\ninterface ComposerEntry {\n composerId: string;\n createdAt: number;\n name?: string;\n unifiedMode?: string;\n totalLinesAdded?: number;\n totalLinesRemoved?: number;\n isArchived?: boolean;\n}\n\ninterface ComposerData {\n allComposers?: ComposerEntry[];\n}\n\nexport function importCursorSessions(): void {\n if (!fs.existsSync(CURSOR_WS)) return;\n\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const BetterSqlite = require('better-sqlite3') as typeof import('better-sqlite3');\n\n const db = getDb();\n const upsert = db.prepare(`\n INSERT INTO sessions (id, tool, started_at, ended_at, cwd, ai_title, confidence)\n VALUES (@id, 'cursor', @started_at, @ended_at, @cwd, @ai_title, 'high')\n ON CONFLICT(id) DO UPDATE SET\n ended_at = excluded.ended_at,\n cwd = COALESCE(sessions.cwd, excluded.cwd),\n ai_title = COALESCE(sessions.ai_title, excluded.ai_title)\n `);\n\n let dirs: string[];\n try { dirs = fs.readdirSync(CURSOR_WS); } catch { return; }\n\n const importAll = db.transaction(() => {\n for (const dir of dirs) {\n const vscdb = path.join(CURSOR_WS, dir, 'state.vscdb');\n const wsJson = path.join(CURSOR_WS, dir, 'workspace.json');\n if (!fs.existsSync(vscdb)) continue;\n\n let folder: string | null = null;\n try {\n const ws = JSON.parse(fs.readFileSync(wsJson, 'utf8')) as { folder?: string };\n folder = ws.folder?.replace('file://', '') ?? null;\n } catch { /* ok */ }\n\n try {\n const cdb = new BetterSqlite(vscdb, { readonly: true });\n const row = cdb.prepare(\n `SELECT value FROM ItemTable WHERE key = 'composer.composerData'`\n ).get() as { value: string } | undefined;\n cdb.close();\n if (!row) continue;\n\n const data = JSON.parse(row.value) as ComposerData;\n const composers = data.allComposers ?? [];\n\n for (const c of composers) {\n if (!c.composerId || !c.createdAt) continue;\n upsert.run({\n id: c.composerId,\n started_at: c.createdAt,\n ended_at: c.createdAt, // Cursor doesn't record end time\n cwd: folder,\n ai_title: c.name ?? null,\n });\n }\n } catch { /* corrupt db, skip */ }\n }\n });\n\n importAll();\n\n // 2026 onwards: Cursor migrated composers to a single global `cursorDiskKV`\n // table inside ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb.\n // Per-workspace storage above only covers pre-migration data; we read the new\n // table here too. Upsert dedupes on composerId.\n if (fs.existsSync(CURSOR_GLOBAL_DB)) {\n try {\n const gdb = new BetterSqlite(CURSOR_GLOBAL_DB, { readonly: true });\n // Check the table exists before querying (older Cursor versions won't have it).\n const hasTable = gdb.prepare(\n `SELECT name FROM sqlite_master WHERE type='table' AND name='cursorDiskKV'`,\n ).get();\n if (hasTable) {\n const rows = gdb.prepare(\n `SELECT key, value FROM cursorDiskKV WHERE key LIKE 'composerData:%'`,\n ).all() as { key: string; value: Buffer | string }[];\n\n const importGlobal = db.transaction(() => {\n for (const r of rows) {\n const id = r.key.slice('composerData:'.length);\n let data: { composerId?: string; createdAt?: number; lastUpdatedAt?: number; name?: string; text?: string };\n try {\n data = JSON.parse(typeof r.value === 'string' ? r.value : r.value.toString('utf8'));\n } catch { continue; }\n const composerId = data.composerId || id;\n const createdAt = data.createdAt;\n if (!composerId || !createdAt) continue;\n const endedAt = data.lastUpdatedAt ?? createdAt;\n const aiTitle = data.name || (data.text ? data.text.slice(0, 120) : null);\n upsert.run({\n id: composerId,\n started_at: createdAt,\n ended_at: endedAt,\n cwd: null,\n ai_title: aiTitle,\n });\n }\n });\n importGlobal();\n }\n gdb.close();\n } catch { /* skip — corrupt or locked */ }\n }\n}\n"],"names":["dataDir","process","env","VIBEMETER_DATA_DIR","join","cwd","insertUsageSnapshot","db","input","prepare","run","captured_at","capturedAt","source","account_id","accountId","window_5h_used_pct","window5hUsedPct","window_weekly_used_pct","windowWeeklyUsedPct","reset_at_5h","resetAt5h","reset_at_weekly","resetAtWeekly","raw_output","rawOutput","confidence","getLatestUsageSnapshot","row","get","AUTH_CLAIMS_KEY","defaultAuthPath","defaultStoreDir","resolvePaths","paths","authPath","storeDir","accountPath","replace","readAuthFile","filePath","raw","parsed","JSON","parse","tokens","Error","writeJsonAtomic","data","dirname","recursive","tmp","pid","Date","now","stringify","encoding","mode","decodeJwtPayload","token","payload","split","Buffer","from","toString","stringClaim","value","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","endsWith","storedAuth","storedStat","summary","mtime","set","has","values","sort","a","b","localeCompare","getCurrentCodexAccount","authMtimeMs","mtimeMs","importCurrentCodexAuth","destination","switchCodexAccount","sourceAccountId","backupPath","current","deleteCodexAccount","catch","AiTitleLine","LineWithTimestamp","object","timestamp","string","optional","sessionId","gitBranch","version","type","passthrough","literal","aiTitle","parseSessionLog","jsonlPath","readFileSync","lines","filter","Boolean","pop","startedAt","lastSeenAt","line","base","safeParse","success","ms","getTime","Number","isNaN","titleParsed","readConversationTurns","limit","turns","msg","message","role","content","trim","push","text","Array","isArray","textParts","toolNames","part"],"mappings":"yiBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCOO,SAASA,IACd,OAAOC,QAAQC,GAAG,CAACC,kBAAkB,EAAI,EAAA,OAAI,CAACC,IAAI,CAACH,QAAQI,GAAG,GAAI,QACpE,4BDLA,IAAI,EAAgC,oBAE7B,SAAS,MENU,EAAqB,IAsCvC,EF/BN,GAAI,EAAK,OAAO,EAChB,IAAM,EAAM,IAKZ,OAJA,EAAA,OAAE,CAAC,SAAS,CAAC,EAAK,CAAE,WAAW,CAAK,GAEpC,CADA,EAAM,IAAI,EAAA,OAAQ,CAAC,EAAA,OAAI,CAACF,IAAI,CAAC,EAAK,qBAAA,EAC9B,MAAM,CAAC,sBEVX,GFWU,GEXP,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCT,CAAC,EAMD,GAHe,CAAC,EAAe,EAAa,KAC1C,GAAI,CAAE,EAAG,IAAI,CAAC,CAAC,YAAY,EAAE,EAAM,YAAY,EAAE,EAAI,CAAC,EAAE,EAAA,CAAK,CAAG,CAAE,KAAM,CAAuB,CACjG,GACO,WAAY,WAAY,QAC/B,EAAO,WAAY,OAAQ,qBAC3B,EAAO,WAAY,iBAAkB,QACrC,EAAO,WAAY,cAAe,WAClC,EAAO,kBAAmB,aAAc,QAExC,EAAG,I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