module.exports=[14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},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"))},85148,(e,t,r)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},43793,77930,e=>{"use strict";var t=e.i(85148),r=e.i(14747),a=e.i(22734);function s(){return process.env.VIBEMETER_DATA_DIR??r.default.join(process.cwd(),".data")}e.s(["dataDir",0,s],77930);let n=null;e.s(["getDb",0,function(){var e;let i;if(n)return n;let o=s();return a.default.mkdirSync(o,{recursive:!0}),(n=new t.default(r.default.join(o,"continuity.sqlite"))).pragma("journal_mode = WAL"),(e=n).exec(`
    CREATE TABLE IF NOT EXISTS sessions (
      id TEXT PRIMARY KEY,
      tool TEXT NOT NULL,
      started_at INTEGER NOT NULL,
      ended_at INTEGER,
      exit_code INTEGER,
      cwd TEXT,
      cli_args TEXT,
      summary TEXT,
      confidence TEXT NOT NULL DEFAULT 'medium'
    );

    CREATE TABLE IF NOT EXISTS usage_snapshots (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      captured_at INTEGER NOT NULL,
      source TEXT NOT NULL,
      account_id TEXT,
      window_5h_used_pct REAL,
      window_weekly_used_pct REAL,
      reset_at_5h INTEGER,
      reset_at_weekly INTEGER,
      raw_output TEXT,
      confidence TEXT NOT NULL
    );

    CREATE TABLE IF NOT EXISTS file_changes (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      session_id TEXT NOT NULL,
      path TEXT NOT NULL,
      change_type TEXT NOT NULL,
      detected_at INTEGER NOT NULL,
      FOREIGN KEY (session_id) REFERENCES sessions(id)
    );
  `),(i=(t,r,a)=>{try{e.exec(`ALTER TABLE ${t} ADD COLUMN ${r} ${a}`)}catch{}})("sessions","ai_title","TEXT"),i("sessions","tags",'TEXT DEFAULT "[]"'),i("sessions","codex_category","TEXT"),i("sessions","tokens_used","INTEGER"),i("usage_snapshots","account_id","TEXT"),e.exec(`
    CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC);
    CREATE INDEX IF NOT EXISTS idx_usage_captured ON usage_snapshots(captured_at DESC);
    CREATE INDEX IF NOT EXISTS idx_usage_source_account_captured ON usage_snapshots(source, account_id, captured_at DESC);
  `),n}],43793)},86100,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),s=e.i(59756),n=e.i(61916),i=e.i(74677),o=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),E=e.i(70101),T=e.i(26937),R=e.i(10372),h=e.i(93695);e.i(52474);var x=e.i(220),N=e.i(89171),_=e.i(43793);e.s(["GET",0,function(){let e=(0,_.getDb)().prepare(`SELECT id, tool, started_at, ended_at, exit_code, cwd, confidence
       FROM sessions
       ORDER BY started_at DESC
       LIMIT 50`).all();return N.NextResponse.json({sessions:e})}],72626);var v=e.i(72626);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sessions/route",pathname:"/api/sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/sessions/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:f,workUnitAsyncStorage:A,serverHooks:w}=g;async function C(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let N="/api/sessions/route";N=N.replace(/\/index$/,"")||"/";let _=await g.prepare(e,t,{srcPage:N,multiZoneDraftMode:!1});if(!_)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:v,deploymentId:f,params:A,nextConfig:w,parsedUrl:C,isDraftMode:I,prerenderManifest:m,routerServerContext:O,isOnDemandRevalidate:y,revalidateOnlyGenerated:S,resolvedPathname:L,clientReferenceManifest:b,serverActionsManifest:U}=_,q=(0,o.normalizeAppPath)(N),D=!!(m.dynamicRoutes[q]||m.routes[L]),X=async()=>((null==O?void 0:O.render404)?await O.render404(e,t,C,!1):t.end("This page could not be found"),null);if(D&&!I){let e=!!m.routes[L],t=m.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(w.adapterPath)return await X();throw new h.NoFallbackError}}let P=null;!D||g.isDev||I||(P="/index"===(P=L)?"/":P);let k=!0===g.isDev||!D,M=D&&!k;U&&b&&(0,i.setManifestsSingleton)({page:N,clientReferenceManifest:b,serverActionsManifest:U});let j=e.method||"GET",F=(0,n.getTracer)(),H=F.getActiveScopeSpan(),G=!!(null==O?void 0:O.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,w,m,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let $={params:A,previewProps:m.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:k,incrementalCache:K,cacheLifeProfiles:w.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>g.onRequestError(e,t,a,s,O)},sharedContext:{buildId:v,deploymentId:f}},Y=new d.NodeNextRequest(e),V=new d.NodeNextResponse(t),W=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(t));try{let s,i=async e=>g.handle(W,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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 a=r.get("next.route");if(a){let t=`${j} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",a),s.updateName(t))}else e.updateName(`${j} ${N}`)}),o=async s=>{var n,o;let d=async({previousCacheEntry:r})=>{try{if(!B&&y&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=$.renderOpts.fetchMetrics;let o=$.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let d=$.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(Y,V,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,E.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[R.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,a=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=R.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:y})},!1,O),t}},l=await g.handleResponse({req:e,nextConfig:w,cacheKey:P,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:m,isRoutePPREnabled:!1,isOnDemandRevalidate:y,revalidateOnlyGenerated:S,responseGenerator:d,waitUntil:a.waitUntil,isMinimalMode:B});if(!D)return null;if((null==l||null==(n=l.value)?void 0:n.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(o=l.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",y?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,E.fromNodeOutgoingHttpHeaders)(l.value.headers);return B&&D||u.delete(R.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,T.getCacheControlHeader)(l.cacheControl)),await (0,p.sendResponse)(Y,V,new Response(l.value.body,{headers:u,status:l.value.status||200})),null};G&&H?await o(H):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${j} ${N}`,kind:n.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},o),void 0,!G))}catch(t){if(t instanceof h.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:y})},!1,O),D)throw t;return await (0,p.sendResponse)(Y,V,new Response(null,{status:500})),null}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:A})},"routeModule",0,g,"serverHooks",0,w,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,A],86100)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0866q87._.js.map