"use strict";exports.id=944,exports.ids=[944],exports.modules={10944:(a,b,c)=>{c.d(b,{Cj:()=>y,Dq:()=>r,Ht:()=>p,JQ:()=>m,K6:()=>v,LQ:()=>i,PL:()=>C,Pw:()=>u,Qd:()=>z,TN:()=>t,U1:()=>n,ZC:()=>B,dS:()=>s,fZ:()=>A,jU:()=>x,k$:()=>l,lS:()=>q,rz:()=>j,sW:()=>o,zR:()=>w});var d=c(22446),e=c(46145),f=c(76846),g=c(97064);let h=`
  s.id, s.provider, s.project_id, p.name AS project_name, s.cwd,
  s.started_at, s.ended_at, s.duration_ms, s.model,
  s.message_count, s.user_message_count,
  s.input_tokens, s.output_tokens, s.cache_read_tokens, s.cache_write_tokens,
  s.est_cost_usd, s.first_prompt, s.summary,
  s.heuristic_title, s.category, s.categories, s.keywords,
  s.git_branch
`,i=g.L;function j(){let{start:a,end:b}=function(){let a=new Date,b=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime();return{start:b,end:b+864e5}}();return(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id
       WHERE s.started_at < ? AND s.ended_at >= ? ORDER BY s.started_at DESC`).all(b,a)}function k(a){let b=new Date(a);return new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()}function l(a={}){let b=a.limit??60,c=a.before??Date.now()+1,f=["s.started_at < ?"],g=[c];if(a.projectId&&(f.push("s.project_id = ?"),g.push(a.projectId)),a.provider&&(f.push("s.provider = ?"),g.push(a.provider)),a.search){f.push("(s.first_prompt LIKE ? OR s.summary LIKE ?)");let b=`%${a.search}%`;g.push(b,b)}let i=(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id
       WHERE ${f.join(" AND ")}
       ORDER BY s.started_at DESC LIMIT ?`).all(...g,b),j=new Map,m=a=>{let b=(0,e.EL)(a),c=j.get(b);return c||(c={day:b,dayMs:a,entries:[],totalTokens:0,totalCost:0,providers:{}},j.set(b,c)),c};for(let a of i){let b=k(a.started_at),c=k(a.ended_at),d=Math.max(1,Math.round((c-b)/864e5)+1),e=a.input_tokens+a.output_tokens+a.cache_read_tokens+a.cache_write_tokens;if(b===c){let c=m(b);c.entries.push({session:a,role:"single",spanDays:1}),c.totalTokens+=e,c.totalCost+=a.est_cost_usd,c.providers[a.provider]=(c.providers[a.provider]||0)+1;continue}for(let f=b;f<=c;f+=864e5){let g=m(f),h=f===b?"started":f===c?"closed":"continued";g.entries.push({session:a,role:h,spanDays:d}),"closed"===h&&(g.totalTokens+=e,g.totalCost+=a.est_cost_usd,g.providers[a.provider]=(g.providers[a.provider]||0)+1)}}for(let a of j.values())a.entries.sort((a,b)=>b.session.started_at-a.session.started_at);return[...j.values()].sort((a,b)=>b.dayMs-a.dayMs)}function m(){return(0,d.x)().prepare(`SELECT p.id, p.name, p.root_path, p.git_remote, p.first_seen, p.last_active,
              COUNT(s.id) AS sessions,
              COALESCE(SUM(s.input_tokens + s.output_tokens + s.cache_read_tokens + s.cache_write_tokens), 0) AS tokens,
              COALESCE(SUM(s.est_cost_usd), 0) AS cost
       FROM projects p LEFT JOIN sessions s ON s.project_id = p.id
       GROUP BY p.id ORDER BY p.last_active DESC`).all()}function n(a){return(0,d.x)().prepare(`SELECT p.id, p.name, p.root_path, p.git_remote, p.first_seen, p.last_active,
              COUNT(s.id) AS sessions,
              COALESCE(SUM(s.input_tokens + s.output_tokens + s.cache_read_tokens + s.cache_write_tokens), 0) AS tokens,
              COALESCE(SUM(s.est_cost_usd), 0) AS cost
       FROM projects p LEFT JOIN sessions s ON s.project_id = p.id
       WHERE p.id = ? GROUP BY p.id`).get(a)??null}function o(a,b=100){return(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id
       WHERE s.project_id = ? ORDER BY s.started_at DESC LIMIT ?`).all(a,b)}function p(a){return(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id WHERE s.id = ?`).get(a)??null}function q(a){return(0,d.x)().prepare("SELECT id, role, content, timestamp, model FROM messages WHERE session_id = ? ORDER BY timestamp ASC LIMIT 200").all(a)}function r(a={}){let b=a.limit??200,c=a.offset??0,e=[],f=[];a.provider&&(e.push("s.provider = ?"),f.push(a.provider)),a.projectId&&(e.push("s.project_id = ?"),f.push(a.projectId));let g=e.length?`WHERE ${e.join(" AND ")}`:"";return(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id ${g}
       ORDER BY s.started_at DESC LIMIT ? OFFSET ?`).all(...f,b,c)}function s(a=30){let b,c,f=(0,d.x)();if(null===a){let a=f.prepare("SELECT MIN(started_at) AS min FROM sessions").get();if(!a.min)return[];b=a.min,c=Math.max(1,Math.ceil((Date.now()-b)/864e5)+1)}else b=Date.now()-864e5*a,c=a;let g=f.prepare(`SELECT started_at, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, est_cost_usd
       FROM sessions WHERE started_at >= ?`).all(b),h=new Map;for(let a=0;a<c;a++){let b=new Date;b.setDate(b.getDate()-a),b.setHours(0,0,0,0);let c=(0,e.EL)(b.getTime());h.set(c,{day:c,sessions:0,tokens:0,cost:0})}for(let a of g){let b=(0,e.EL)(a.started_at),c=h.get(b);c&&(c.sessions+=1,c.tokens+=a.input_tokens+a.output_tokens+a.cache_read_tokens+a.cache_write_tokens,c.cost+=a.est_cost_usd)}return[...h.values()].sort((a,b)=>a.day.localeCompare(b.day))}function t(){return(0,d.x)().prepare(`SELECT provider,
              COUNT(*) AS sessions,
              SUM(input_tokens + output_tokens + cache_read_tokens + cache_write_tokens) AS tokens,
              SUM(est_cost_usd) AS cost
       FROM sessions GROUP BY provider ORDER BY tokens DESC`).all()}function u(){let a=(0,d.x)().prepare(`SELECT COALESCE(model, 'unknown') AS model,
              COUNT(*) AS sessions,
              SUM(input_tokens + output_tokens + cache_read_tokens + cache_write_tokens) AS tokens,
              SUM(est_cost_usd) AS cost
       FROM sessions GROUP BY model`).all(),b=new Map;for(let c of a){let a=(0,f.gW)(c.model),d=b.get(a);d?(d.sessions+=c.sessions,d.tokens+=c.tokens,d.cost+=c.cost):b.set(a,{model:a,sessions:c.sessions,tokens:c.tokens,cost:c.cost})}return[...b.values()].sort((a,b)=>b.tokens-a.tokens).slice(0,12)}function v(){return(0,d.x)().prepare(`SELECT
         COUNT(*) AS sessions,
         COUNT(DISTINCT project_id) AS projects,
         COALESCE(SUM(input_tokens + output_tokens + cache_read_tokens + cache_write_tokens), 0) AS tokens,
         COALESCE(SUM(est_cost_usd), 0) AS cost,
         COUNT(DISTINCT strftime('%Y-%m', started_at/1000, 'unixepoch')) AS active_months,
         MIN(started_at) AS first_session,
         MAX(started_at) AS last_session
       FROM sessions`).get()}function w(a=12){return(0,d.x)().prepare(`SELECT ${h} FROM sessions s JOIN projects p ON p.id = s.project_id
       ORDER BY s.started_at DESC LIMIT ?`).all(a)}function x(a=30,b=6){let c=null===a?0:Date.now()-864e5*a;return(0,d.x)().prepare(`SELECT p.id, p.name, p.last_active,
              COUNT(s.id) AS sessions,
              COALESCE(SUM(s.input_tokens + s.output_tokens + s.cache_read_tokens + s.cache_write_tokens), 0) AS tokens,
              COALESCE(SUM(s.est_cost_usd), 0) AS cost
       FROM projects p JOIN sessions s ON s.project_id = p.id
       WHERE s.started_at >= ?
       GROUP BY p.id ORDER BY tokens DESC LIMIT ?`).all(c,b)}function y(a=30){let b=null===a?0:Date.now()-864e5*a,c=(0,d.x)().prepare(`SELECT category, categories,
              (input_tokens + output_tokens + cache_read_tokens + cache_write_tokens) AS tokens
       FROM sessions WHERE started_at >= ?`).all(b),e=new Map;for(let a of c){let b=(0,g.L)(a);for(let c of b.length?b:["Unknown"]){let b=e.get(c)??{sessions:0,tokens:0};b.sessions+=1,b.tokens+=a.tokens,e.set(c,b)}}return[...e.entries()].map(([a,b])=>({category:a,...b})).sort((a,b)=>b.sessions-a.sessions)}function z(a=30){let b=(0,d.x)(),c=Date.now(),e=null===a?0:c-864e5*a,f=null===a?0:e-864e5*a,g=b.prepare(`SELECT COUNT(*) AS sessions,
              COUNT(DISTINCT project_id) AS projects,
              COALESCE(SUM(input_tokens + output_tokens + cache_read_tokens + cache_write_tokens), 0) AS tokens,
              COALESCE(SUM(est_cost_usd), 0) AS cost,
              COUNT(DISTINCT strftime('%Y-%m', started_at/1000, 'unixepoch')) AS active_months
       FROM sessions WHERE started_at >= ?`).get(e);if(null===a)return{...g,sessions_prev:0,tokens_prev:0,cost_prev:0,active_months_prev:0};let h=b.prepare(`SELECT COUNT(*) AS sessions,
              COALESCE(SUM(input_tokens + output_tokens + cache_read_tokens + cache_write_tokens), 0) AS tokens,
              COALESCE(SUM(est_cost_usd), 0) AS cost,
              COUNT(DISTINCT strftime('%Y-%m', started_at/1000, 'unixepoch')) AS active_months
       FROM sessions WHERE started_at >= ? AND started_at < ?`).get(f,e);return{...g,sessions_prev:h.sessions,tokens_prev:h.tokens,cost_prev:h.cost,active_months_prev:h.active_months}}function A(a){let b=(0,d.x)().prepare("SELECT summary FROM day_summaries WHERE day = ?").get(a);return b?.summary??null}function B(a,b){(0,d.x)().prepare("INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)").run(a,b)}function C(a){let b=(0,d.x)().prepare("SELECT value FROM settings WHERE key = ?").get(a);return b?.value??null}},22446:(a,b,c)=>{c.d(b,{L:()=>w,x:()=>x});var d={};c.r(d),c.d(d,{daySummaries:()=>s,ingestState:()=>q,messages:()=>p,projectSummaries:()=>t,projects:()=>n,sessions:()=>o,settings:()=>r});var e=c(87550),f=c.n(e),g=c(65127),h=c(48211),i=c(95417),j=c(58040),k=c(20377),l=c(4035),m=c(19643);let n=(0,i.D)("projects",{id:(0,j.Qq)("id").primaryKey(),name:(0,j.Qq)("name").notNull(),rootPath:(0,j.Qq)("root_path").notNull(),gitRemote:(0,j.Qq)("git_remote"),firstSeen:(0,k.nd)("first_seen").notNull(),lastActive:(0,k.nd)("last_active").notNull()},a=>({rootIdx:(0,l.GL)("projects_root_idx").on(a.rootPath)})),o=(0,i.D)("sessions",{id:(0,j.Qq)("id").primaryKey(),provider:(0,j.Qq)("provider").notNull(),projectId:(0,j.Qq)("project_id").notNull(),cwd:(0,j.Qq)("cwd").notNull(),startedAt:(0,k.nd)("started_at").notNull(),endedAt:(0,k.nd)("ended_at").notNull(),durationMs:(0,k.nd)("duration_ms").notNull(),model:(0,j.Qq)("model"),messageCount:(0,k.nd)("message_count").notNull().default(0),userMessageCount:(0,k.nd)("user_message_count").notNull().default(0),inputTokens:(0,k.nd)("input_tokens").notNull().default(0),outputTokens:(0,k.nd)("output_tokens").notNull().default(0),cacheReadTokens:(0,k.nd)("cache_read_tokens").notNull().default(0),cacheWriteTokens:(0,k.nd)("cache_write_tokens").notNull().default(0),estCostUsd:(0,m.x)("est_cost_usd").notNull().default(0),firstPrompt:(0,j.Qq)("first_prompt"),summary:(0,j.Qq)("summary"),summaryGenerated:(0,k.nd)("summary_generated").notNull().default(0),heuristicTitle:(0,j.Qq)("heuristic_title"),category:(0,j.Qq)("category"),keywords:(0,j.Qq)("keywords"),gitBranch:(0,j.Qq)("git_branch"),sourcePath:(0,j.Qq)("source_path").notNull()},a=>({projectIdx:(0,l.Pe)("sessions_project_idx").on(a.projectId),startedIdx:(0,l.Pe)("sessions_started_idx").on(a.startedAt),providerIdx:(0,l.Pe)("sessions_provider_idx").on(a.provider),modelIdx:(0,l.Pe)("sessions_model_idx").on(a.model)})),p=(0,i.D)("messages",{id:(0,j.Qq)("id").primaryKey(),sessionId:(0,j.Qq)("session_id").notNull(),role:(0,j.Qq)("role").notNull(),content:(0,j.Qq)("content").notNull(),timestamp:(0,k.nd)("timestamp").notNull(),model:(0,j.Qq)("model")},a=>({sessionIdx:(0,l.Pe)("messages_session_idx").on(a.sessionId),timestampIdx:(0,l.Pe)("messages_timestamp_idx").on(a.timestamp)})),q=(0,i.D)("ingest_state",{sourcePath:(0,j.Qq)("source_path").primaryKey(),mtime:(0,k.nd)("mtime").notNull(),size:(0,k.nd)("size").notNull(),sessionId:(0,j.Qq)("session_id").notNull(),ingestedAt:(0,k.nd)("ingested_at").notNull()}),r=(0,i.D)("settings",{key:(0,j.Qq)("key").primaryKey(),value:(0,j.Qq)("value").notNull()}),s=(0,i.D)("day_summaries",{day:(0,j.Qq)("day").primaryKey(),summary:(0,j.Qq)("summary").notNull(),generatedAt:(0,k.nd)("generated_at").notNull()}),t=(0,i.D)("project_summaries",{projectId:(0,j.Qq)("project_id").primaryKey(),summary:(0,j.Qq)("summary").notNull(),generatedAt:(0,k.nd)("generated_at").notNull()}),u=null,v=null;function w(){return u||((v=new(f())((0,h.W)())).pragma("journal_mode = WAL"),v.pragma("synchronous = NORMAL"),function(a){a.exec(`
    CREATE TABLE IF NOT EXISTS projects (
      id TEXT PRIMARY KEY,
      name TEXT NOT NULL,
      root_path TEXT NOT NULL,
      git_remote TEXT,
      first_seen INTEGER NOT NULL,
      last_active INTEGER NOT NULL
    );
    CREATE UNIQUE INDEX IF NOT EXISTS projects_root_idx ON projects(root_path);

    CREATE TABLE IF NOT EXISTS sessions (
      id TEXT PRIMARY KEY,
      provider TEXT NOT NULL,
      project_id TEXT NOT NULL,
      cwd TEXT NOT NULL,
      started_at INTEGER NOT NULL,
      ended_at INTEGER NOT NULL,
      duration_ms INTEGER NOT NULL,
      model TEXT,
      message_count INTEGER NOT NULL DEFAULT 0,
      user_message_count INTEGER NOT NULL DEFAULT 0,
      input_tokens INTEGER NOT NULL DEFAULT 0,
      output_tokens INTEGER NOT NULL DEFAULT 0,
      cache_read_tokens INTEGER NOT NULL DEFAULT 0,
      cache_write_tokens INTEGER NOT NULL DEFAULT 0,
      est_cost_usd REAL NOT NULL DEFAULT 0,
      first_prompt TEXT,
      summary TEXT,
      summary_generated INTEGER NOT NULL DEFAULT 0,
      heuristic_title TEXT,
      category TEXT,
      keywords TEXT,
      git_branch TEXT,
      source_path TEXT NOT NULL
    );
    CREATE INDEX IF NOT EXISTS sessions_project_idx ON sessions(project_id);
    CREATE INDEX IF NOT EXISTS sessions_started_idx ON sessions(started_at);
    CREATE INDEX IF NOT EXISTS sessions_provider_idx ON sessions(provider);
    CREATE INDEX IF NOT EXISTS sessions_model_idx ON sessions(model);

    CREATE TABLE IF NOT EXISTS messages (
      id TEXT PRIMARY KEY,
      session_id TEXT NOT NULL,
      role TEXT NOT NULL,
      content TEXT NOT NULL,
      timestamp INTEGER NOT NULL,
      model TEXT
    );
    CREATE INDEX IF NOT EXISTS messages_session_idx ON messages(session_id);
    CREATE INDEX IF NOT EXISTS messages_timestamp_idx ON messages(timestamp);

    CREATE TABLE IF NOT EXISTS ingest_state (
      source_path TEXT PRIMARY KEY,
      mtime INTEGER NOT NULL,
      size INTEGER NOT NULL,
      session_id TEXT NOT NULL,
      ingested_at INTEGER NOT NULL
    );

    CREATE TABLE IF NOT EXISTS settings (
      key TEXT PRIMARY KEY,
      value TEXT NOT NULL
    );

    CREATE TABLE IF NOT EXISTS day_summaries (
      day TEXT PRIMARY KEY,
      summary TEXT NOT NULL,
      generated_at INTEGER NOT NULL
    );

    CREATE TABLE IF NOT EXISTS project_summaries (
      project_id TEXT PRIMARY KEY,
      summary TEXT NOT NULL,
      generated_at INTEGER NOT NULL
    );

    CREATE TABLE IF NOT EXISTS session_contexts (
      session_id TEXT PRIMARY KEY,
      context TEXT NOT NULL,
      generated_at INTEGER NOT NULL,
      model TEXT
    );

    CREATE TABLE IF NOT EXISTS quota_snapshots (
      provider TEXT PRIMARY KEY,
      observed_at INTEGER NOT NULL,
      plan_type TEXT,
      primary_pct REAL,
      primary_window_minutes INTEGER,
      primary_resets_at INTEGER,
      secondary_pct REAL,
      secondary_window_minutes INTEGER,
      secondary_resets_at INTEGER
    );

    CREATE TABLE IF NOT EXISTS claude_limit_events (
      id INTEGER PRIMARY KEY AUTOINCREMENT,
      session_id TEXT NOT NULL,
      observed_at INTEGER NOT NULL,
      reset_at INTEGER,
      kind TEXT NOT NULL,
      raw TEXT
    );
    CREATE INDEX IF NOT EXISTS claude_limit_events_observed_idx ON claude_limit_events(observed_at);
    CREATE INDEX IF NOT EXISTS claude_limit_events_session_idx ON claude_limit_events(session_id);
  `);let b=new Set(a.prepare("PRAGMA table_info(sessions)").all().map(a=>a.name));b.has("heuristic_title")||a.exec("ALTER TABLE sessions ADD COLUMN heuristic_title TEXT"),b.has("category")||a.exec("ALTER TABLE sessions ADD COLUMN category TEXT"),b.has("keywords")||a.exec("ALTER TABLE sessions ADD COLUMN keywords TEXT"),a.exec("CREATE INDEX IF NOT EXISTS sessions_category_idx ON sessions(category)"),b.has("categories")||(a.exec("ALTER TABLE sessions ADD COLUMN categories TEXT"),a.exec(`UPDATE sessions
             SET categories = json_array(category)
             WHERE category IS NOT NULL AND categories IS NULL`))}(v),u=(0,g.f)(v,{schema:d}))}function x(){return v||w(),v}},46145:(a,b,c)=>{function d(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}k`:a.toString()}function e(a){return a>=1e3?`$${a.toFixed(0)}`:`$${a.toFixed(2)}`}function f(a){let b=Math.floor((Date.now()-a)/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);if(d<30)return`${d}d ago`;let e=Math.floor(d/30);return`${e}mo ago`}function g(a){return new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function h(a){let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);if(c<60)return`${c}m`;let d=Math.floor(c/60);return`${d}h ${c%60}m`}function i(a){return new Date(a).toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function j(a){let b=new Date(a),c=b.getFullYear(),d=String(b.getMonth()+1).padStart(2,"0"),e=String(b.getDate()).padStart(2,"0");return`${c}-${d}-${e}`}c.d(b,{EL:()=>j,F0:()=>e,I_:()=>i,Kc:()=>f,ME:()=>g,c5:()=>h,yj:()=>d})},48211:(a,b,c)=>{c.d(b,{K:()=>g,W:()=>h});var d=c(48161),e=c(76760),f=c(73024);function g(){let a=process.env.AGENTGRAPHED_DATA_DIR||(0,e.join)((0,d.homedir)(),".agentgraphed");return(0,f.existsSync)(a)||(0,f.mkdirSync)(a,{recursive:!0}),a}function h(){return(0,e.join)(g(),"agentgraphed.sqlite")}},76846:(a,b,c)=>{let d;c.d(b,{QJ:()=>j,a3:()=>l,gW:()=>m});var e=c(73024),f=c(76760);c(73136);let g={input:3,output:15},h={"claude-opus-4-7":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-6":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-5":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4":{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},"claude-sonnet-4-6":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-sonnet-4-5":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-haiku-4-5":{input:1,output:5,cacheRead:.1,cacheWrite:1.25},"claude-3-5-sonnet":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"gpt-5.1":{input:1.25,output:10,cacheRead:.125},"gpt-5":{input:1.25,output:10,cacheRead:.125},"gpt-5-mini":{input:.25,output:2,cacheRead:.025},"gpt-4o":{input:2.5,output:10},"gpt-4o-mini":{input:.15,output:.6}},i=null,j=function(){let a=function(){if(void 0!==d)return d;try{let a=__dirname,b=(0,f.join)(a,"pricing-data","litellm.meta.json");d=(0,e.existsSync)(b)?JSON.parse((0,e.readFileSync)(b,"utf8")):null}catch{d=null}return d}();return a?.fetchedAt?a.fetchedAt.slice(0,10):"2026-06-05"}();function k(a){let b=a.input_cost_per_token,c=a.output_cost_per_token;return null==b||null==c?null:{input:1e6*b,output:1e6*c,cacheRead:null!=a.cache_read_input_token_cost?1e6*a.cache_read_input_token_cost:void 0,cacheWrite:null!=a.cache_creation_input_token_cost?1e6*a.cache_creation_input_token_cost:void 0}}function l(a){let b=function(a){if(!a)return g;let b=null!==i?i:i=function(){try{let a=__dirname;for(let b of[(0,f.join)(a,"pricing-data","litellm.json"),(0,f.join)(process.cwd(),"src","lib","pricing-data","litellm.json")])if((0,e.existsSync)(b))return JSON.parse((0,e.readFileSync)(b,"utf8"))}catch{}return{}}(),c=b[a];if(c){let a=k(c);if(a)return a}let d=a.replace(/-(\d{8})$/,"");if(d!==a&&b[d]){let a=k(b[d]);if(a)return a}if(h[a])return h[a];let j=Object.keys(h).find(b=>a.startsWith(b));if(j)return h[j];let l=Object.keys(b).find(b=>a.startsWith(b));if(l){let a=k(b[l]);if(a)return a}return g}(a.model),c=a.cacheReadTokens??0,d=a.cacheWriteTokens??0;return a.inputTokens*b.input/1e6+a.outputTokens*b.output/1e6+c*(b.cacheRead??b.input)/1e6+d*(b.cacheWrite??b.input)/1e6}function m(a){if(!a)return"Unknown";let b=a.toLowerCase(),c=b.match(/^claude-(?:(\d+(?:-\d+)?)-)?(opus|sonnet|haiku)-?(\d+)?/);if(c){let a=c[2].charAt(0).toUpperCase()+c[2].slice(1);if(c[1]){let b=c[1].replace("-",".");return`Claude ${a} ${b}`}return c[3]?`Claude ${a} ${c[3]}`:`Claude ${a}`}if(b.startsWith("gpt-4o"))return b.includes("mini")?"GPT-4o Mini":"GPT-4o";let d=b.match(/^gpt-(\d+(?:\.\d+)?)(?:-(mini|nano|turbo))?/);if(d){let a=`GPT-${d[1]}`;return d[2]?`${a} ${d[2].charAt(0).toUpperCase()+d[2].slice(1)}`:a}return a}},97064:(a,b,c)=>{function d(a){if(a.categories)try{let b=JSON.parse(a.categories);if(Array.isArray(b))return b.filter(a=>"string"==typeof a)}catch{}return a.category?[a.category]:[]}function e(a){if(a.summary)return a.summary.split("\n")[0].trim();if(a.heuristic_title)return a.heuristic_title;if(a.first_prompt){let b=(a.first_prompt.trim().split("\n").find(a=>a.trim().length>0)??"").replace(/\s+/g," ").trim();if(b.length<=100)return b;let c=b.lastIndexOf(" ",100);return(c>60?b.slice(0,c):b.slice(0,100))+"…"}return"(untitled session)"}c.d(b,{L:()=>d,x:()=>e})}};