ccgauge 1.1.4 → 1.1.6
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/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +27 -27
- package/.next/standalone/.next/app-path-routes-manifest.json +7 -7
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/scan/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/models/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page.js +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +7 -7
- package/.next/standalone/.next/server/chunks/716.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/node_modules/next/node_modules/postcss/package.json +0 -0
- package/.next/standalone/package.json +1 -1
- package/CHANGELOG.md +66 -0
- package/bin/cli.mjs +0 -0
- package/dist/mcp/server.mjs +6 -6
- package/dist/report/index.mjs +4 -4
- package/package.json +22 -24
- /package/.next/standalone/.next/static/{pccRwHEkTSz4g-0VPmlVK → T5Enhm7piIOmShjmQ31T5}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{pccRwHEkTSz4g-0VPmlVK → T5Enhm7piIOmShjmQ31T5}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=716,exports.ids=[716],exports.modules={31519:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e,V:()=>d});let d={"claude-opus-4-8":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-7":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-5":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-sonnet-4-6":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-4-5":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-haiku-3-5":{input:.8,output:4,cacheCreation5m:1,cacheCreation1h:1.6,cacheRead:.08},"claude-opus-4-1":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-sonnet-4":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-3-7":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-3":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03}},e={opus:d["claude-opus-4-8"],sonnet:d["claude-sonnet-4-6"],haiku:d["claude-haiku-4-5"]}},60704:(a,b,c)=>{"use strict";c.d(b,{jt:()=>z,Gr:()=>A,Fw:()=>F,sO:()=>B,rl:()=>D,R0:()=>C});var d=c(73024),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(80481),j=c.n(i);async function k(a){let b=(0,d.createReadStream)(a,{encoding:"utf8"}),c=j().createInterface({input:b,crlfDelay:1/0}),e=[],f=[],g=[];for await(let b of c){let c;if(b.trim()){try{c=JSON.parse(b)}catch{continue}if(c&&"object"==typeof c){if(c.uuid&&g.push([c.uuid,c.parentUuid??null]),"assistant"===c.type){let b=function(a,b){let c=a.message;if(!c)return null;let d=c.usage;if(!d)return null;let e=c.model??"";if(!e||"<synthetic>"===e)return null;let f=c.id??a.uuid??"";if(!f&&!a.requestId)return null;let g=d.cache_creation,h=Array.isArray(c.content)?c.content:[],i=[],j=!1,k="";for(let a of h)"tool_use"===a.type&&"string"==typeof a.name?i.push(a.name):"thinking"===a.type?j=!0:"text"!==a.type||"string"!=typeof a.text||k||(k=a.text.slice(0,200));return{type:"assistant",source:"claude",uuid:a.uuid??f,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",requestId:a.requestId??"",cwd:a.cwd??"",gitBranch:a.gitBranch,version:a.version,model:e,messageId:f,usage:{input_tokens:Number(d.input_tokens)||0,output_tokens:Number(d.output_tokens)||0,cache_creation_input_tokens:Number(d.cache_creation_input_tokens)||0,cache_read_input_tokens:Number(d.cache_read_input_tokens)||0,cache_creation_5m:Number(g?.ephemeral_5m_input_tokens)||0,cache_creation_1h:Number(g?.ephemeral_1h_input_tokens)||0},toolNames:i,hasThinking:j,textPreview:k,filePath:b,isSidechain:!0===a.isSidechain||void 0}}(c,a);b&&e.push(b)}else if("user"===c.type){let b=function(a,b){if(!a.uuid)return null;let c=a.message,d="";if(c){let a=c.content;if("string"==typeof a)d=a.slice(0,200);else if(Array.isArray(a)){for(let b of a)if("text"===b.type&&"string"==typeof b.text){d=b.text.slice(0,200);break}}}let e=!0===a.isSidechain,f=e||!!d&&function(a){let b=a.trimStart();return!!(b.startsWith("Base directory for this skill:")||b.startsWith("<system-reminder>")||b.startsWith("Caveat: The messages below were generated by"))}(d);return{type:"user",source:"claude",uuid:a.uuid,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",cwd:a.cwd??"",textPreview:d,isSynthetic:f,isSidechain:!!e||void 0,filePath:b}}(c,a);b&&f.push(b)}}}}return{assistant:e,user:f,parentLinks:g}}var l=c(31519);function m(a,b){if(!b)return{input:0,output:0,cacheCreation5m:0,cacheCreation1h:0,cacheRead:0,total:0,saved:0};let c=a.input_tokens/1e6*b.input,d=a.output_tokens/1e6*b.output,e=a.cache_creation_5m/1e6*b.cacheCreation5m,f=a.cache_creation_1h/1e6*b.cacheCreation1h;e+f===0&&a.cache_creation_input_tokens>0&&(e=a.cache_creation_input_tokens/1e6*b.cacheCreation5m);let g=a.cache_read_input_tokens/1e6*b.cacheRead,h=c+d+e+f+g;return{input:c,output:d,cacheCreation5m:e,cacheCreation1h:f,cacheRead:g,total:h,saved:a.cache_read_input_tokens/1e6*(b.input-b.cacheRead)}}function n(a){return a.replace(/\b\w/g,a=>a.toUpperCase())}let o=/-\d{8}$/,p=/^(vertex_ai|bedrock|anthropic)\//;async function q(a){try{let b=await d.promises.stat(a);return new Date(b.mtimeMs).toISOString()}catch{return new Date().toISOString()}}function r(a){return"string"==typeof a?a:""}function s(a){let b=Number(a);return Number.isFinite(b)?b:0}function t(a){let b=a.message;if("string"==typeof b)return b;let c=a.content;if("string"==typeof c)return c;if(Array.isArray(c))for(let a of c){let b=a?.type;if(("input_text"===b||"output_text"===b||"text"===b)&&"string"==typeof a.text)return a.text}return""}async function u(a){let b,c=(0,d.createReadStream)(a,{encoding:"utf8"}),e=j().createInterface({input:c,crlfDelay:1/0}),f=[],g=[],h=[],i="",k="",l=0,m=0,n=null,o=await q(a),p={turnId:null,cwd:"",model:"gpt-unknown",userUuid:null,toolNames:[],hasThinking:!1,pendingTextPreview:""};for await(let c of e){let d;if(!c.trim())continue;try{d=JSON.parse(c)}catch{continue}if(!d||"object"!=typeof d||!d.type)continue;let e=d.payload??{},j=r(d.timestamp),q=j||o;if(j&&(o=j),"session_meta"===d.type){i=r(e.id),k=r(e.cwd),b=r(e.cli_version)||void 0;let a=r(e.timestamp);a&&(o=a),p.cwd||(p.cwd=k);continue}if("turn_context"===d.type){p.turnId=r(e.turn_id)||p.turnId,p.cwd=r(e.cwd)||k;let a=r(e.model);a&&(p.model=a);let b=r(e.effort);b&&(p.effort=b),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview="";continue}if("event_msg"===d.type){let c=r(e.type);if("user_message"===c){let b=t(e);if(!b)continue;let c=`${i}::u${l++}`;g.push({type:"user",source:"codex",uuid:c,parentUuid:null,timestamp:q,sessionId:i,cwd:p.cwd||k,textPreview:b.slice(0,200),filePath:a}),h.push([c,null]),p.userUuid=c;continue}if("agent_message"===c){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200));continue}if("agent_reasoning"===c){p.hasThinking=!0;continue}if("token_count"===c){let c,d,g,j,l=e.info;if(!l)continue;let o=l.total_token_usage,r=l.last_token_usage,t=o?{input:s(o.input_tokens),cached:s(o.cached_input_tokens),output:s(o.output_tokens),reasoning:s(o.reasoning_output_tokens)}:null;if(t){if(null===n?(c=t.input,d=t.cached,g=t.output,j=t.reasoning):(c=Math.max(0,t.input-n.input),d=Math.max(0,t.cached-n.cached),g=Math.max(0,t.output-n.output),j=Math.max(0,t.reasoning-n.reasoning)),0===c&&0===d&&0===g&&0===j)continue;n=null===n?{...t}:{input:Math.max(n.input,t.input),cached:Math.max(n.cached,t.cached),output:Math.max(n.output,t.output),reasoning:Math.max(n.reasoning,t.reasoning)}}else{if(!r||(c=s(r.input_tokens),d=s(r.cached_input_tokens),g=s(r.output_tokens),j=s(r.reasoning_output_tokens),0===c&&0===d&&0===g&&0===j))continue;n=null===n?{input:c,cached:d,output:g,reasoning:j}:{input:n.input+c,cached:n.cached+d,output:n.output+g,reasoning:n.reasoning+j}}let u=`${i}::a${m++}`,v=p.turnId?`${p.turnId}::a${m}`:`${i}::a${m}`;f.push({type:"assistant",source:"codex",uuid:u,parentUuid:p.userUuid,timestamp:q,sessionId:i,requestId:v,cwd:p.cwd||k,version:b,model:p.model||"gpt-unknown",messageId:v,usage:{input_tokens:Math.max(0,c-d),output_tokens:g+j,cache_creation_input_tokens:0,cache_read_input_tokens:d,cache_creation_5m:0,cache_creation_1h:0,reasoning_tokens:j},toolNames:[...p.toolNames],hasThinking:p.hasThinking,textPreview:p.pendingTextPreview,filePath:a,effort:p.effort}),h.push([u,p.userUuid]),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview=""}continue}if("response_item"===d.type){let a=r(e.type);if("function_call"===a||"custom_tool_call"===a){let a=r(e.name);a&&p.toolNames.push(a);continue}if("reasoning"===a){p.hasThinking=!0;continue}if("message"===a&&"assistant"===r(e.role)){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200))}continue}}return{assistant:f,user:g,parentLinks:h}}var v=c(71310);let w={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"},x={id:"codex",displayName:{en:"Codex",zh:"Codex"},shortLabel:"X",color:{fg:"#047857",bg:"#d1fae5"},logoSrc:"/codex-logo.webp",parserVersion:"codex-v5-last-total-prev",capabilities:{hasCacheCreation:!1,hasReasoningTokens:!0,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".codex","sessions"),f().join(a,".codex","archived_sessions")];return process.env.CCGAUGE_CODEX_DIR&&b.push(process.env.CCGAUGE_CODEX_DIR),process.env.CODEX_HOME&&(b.push(f().join(process.env.CODEX_HOME,"sessions")),b.push(f().join(process.env.CODEX_HOME,"archived_sessions"))),Array.from(new Set(b))},shouldSkipDir:()=>!1,parseFile:u,resolvePricing:v.E7,shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/^openai\//,"");return b.toLowerCase().startsWith("gpt-")?"GPT-"+b.slice(4).split("-").map(a=>w[a.toLowerCase()]??a).join(" "):b.toLowerCase().startsWith("o")?b.toUpperCase():b.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())},costFromUsage:m,costFootnoteKey:"cost.footnote.codex"},y={claude:{id:"claude",displayName:{en:"Claude",zh:"Claude"},shortLabel:"C",color:{fg:"#b45309",bg:"#fef3c7"},logoSrc:"/claude-logo.webp",parserVersion:"claude-v4-sidechain-merge",capabilities:{hasCacheCreation:!0,hasReasoningTokens:!1,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".claude","projects"),f().join(a,".config","claude","projects")];return process.env.CCGAUGE_CONFIG_DIR&&b.push(f().join(process.env.CCGAUGE_CONFIG_DIR,"projects")),process.env.CLAUDE_CONFIG_DIR&&b.push(f().join(process.env.CLAUDE_CONFIG_DIR,"projects")),Array.from(new Set(b))},shouldSkipDir:a=>"tool-results"===a||"memory"===a,parseFile:async a=>await k(a),resolvePricing:function(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(l.V[a])return{pricing:l.V[a],matchType:"exact",matchedKey:a};let b=a.replace(o,"");if(l.V[b])return{pricing:l.V[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(p,"");if(l.V[c])return{pricing:l.V[c],matchType:"prefix-stripped",matchedKey:c};for(let b of["opus","sonnet","haiku"])if(a.toLowerCase().includes(b))return{pricing:l.Q[b],matchType:"family-fallback",matchedKey:`claude-${b}-(latest)`};return{pricing:null,matchType:"none",matchedKey:null}},shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/-(\d{8})$/,"").replace(/^(vertex_ai|bedrock|anthropic)\//,""),c=(b=b.replace(/^claude-/,"")).split("-");if(c.length>=2){let a=c[0],b=c.slice(1).join(".");return n(a)+" "+b}return n(b.replace(/-/g," "))},costFromUsage:m,costFootnoteKey:null},codex:x},z=["claude","codex"],A="claude";function B(a){return y[a]}function C(){return z.map(a=>y[a])}function D(a){return"string"==typeof a&&("claude"===a||"codex"===a)}async function E(a){try{return(await d.promises.stat(a)).isDirectory()}catch{return!1}}async function F(){let a=[];for(let b of C())for(let c of b.getDirs())if(await E(c)){a.push(b.id);break}return a}},71310:(a,b,c)=>{"use strict";c.d(b,{E7:()=>h,_G:()=>d});let d={"gpt-5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1":{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1-mini":{input:.4,output:1.6,cacheRead:.1,cacheCreation5m:0,cacheCreation1h:0},o3:{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"o4-mini":{input:1.1,output:4.4,cacheRead:.275,cacheCreation5m:0,cacheCreation1h:0}},e={gpt:d["gpt-5"],o:d.o3},f=/-\d{8}$/,g=/^(openai)\//;function h(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(d[a])return{pricing:d[a],matchType:"exact",matchedKey:a};let b=a.replace(f,"");if(d[b])return{pricing:d[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(g,"");if(d[c])return{pricing:d[c],matchType:"prefix-stripped",matchedKey:c};let h=a.toLowerCase();return h.startsWith("gpt-")||"gpt"===h?{pricing:e.gpt,matchType:"family-fallback",matchedKey:"gpt-(latest)"}:/^o\d/.test(h)?{pricing:e.o,matchType:"family-fallback",matchedKey:"o-(latest)"}:{pricing:null,matchType:"none",matchedKey:null}}},78335:()=>{},96487:()=>{}};
|
|
1
|
+
exports.id=716,exports.ids=[716],exports.modules={31519:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e,V:()=>d});let d={"claude-fable-5":{input:10,output:50,cacheCreation5m:12.5,cacheCreation1h:20,cacheRead:1},"claude-opus-4-8":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-7":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-5":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-sonnet-4-6":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-4-5":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-haiku-3-5":{input:.8,output:4,cacheCreation5m:1,cacheCreation1h:1.6,cacheRead:.08},"claude-opus-4-1":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-sonnet-4":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-3-7":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-3":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03}},e={fable:d["claude-fable-5"],opus:d["claude-opus-4-8"],sonnet:d["claude-sonnet-4-6"],haiku:d["claude-haiku-4-5"]}},60704:(a,b,c)=>{"use strict";c.d(b,{jt:()=>z,Gr:()=>A,Fw:()=>F,sO:()=>B,rl:()=>D,R0:()=>C});var d=c(73024),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(80481),j=c.n(i);async function k(a){let b=(0,d.createReadStream)(a,{encoding:"utf8"}),c=j().createInterface({input:b,crlfDelay:1/0}),e=[],f=[],g=[];for await(let b of c){let c;if(b.trim()){try{c=JSON.parse(b)}catch{continue}if(c&&"object"==typeof c){if(c.uuid&&g.push([c.uuid,c.parentUuid??null]),"assistant"===c.type){let b=function(a,b){let c=a.message;if(!c)return null;let d=c.usage;if(!d)return null;let e=c.model??"";if(!e||"<synthetic>"===e)return null;let f=c.id??a.uuid??"";if(!f&&!a.requestId)return null;let g=d.cache_creation,h=Array.isArray(c.content)?c.content:[],i=[],j=!1,k="";for(let a of h)"tool_use"===a.type&&"string"==typeof a.name?i.push(a.name):"thinking"===a.type?j=!0:"text"!==a.type||"string"!=typeof a.text||k||(k=a.text.slice(0,200));return{type:"assistant",source:"claude",uuid:a.uuid??f,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",requestId:a.requestId??"",cwd:a.cwd??"",gitBranch:a.gitBranch,version:a.version,model:e,messageId:f,usage:{input_tokens:Number(d.input_tokens)||0,output_tokens:Number(d.output_tokens)||0,cache_creation_input_tokens:Number(d.cache_creation_input_tokens)||0,cache_read_input_tokens:Number(d.cache_read_input_tokens)||0,cache_creation_5m:Number(g?.ephemeral_5m_input_tokens)||0,cache_creation_1h:Number(g?.ephemeral_1h_input_tokens)||0},toolNames:i,hasThinking:j,textPreview:k,filePath:b,isSidechain:!0===a.isSidechain||void 0}}(c,a);b&&e.push(b)}else if("user"===c.type){let b=function(a,b){if(!a.uuid)return null;let c=a.message,d="";if(c){let a=c.content;if("string"==typeof a)d=a.slice(0,200);else if(Array.isArray(a)){for(let b of a)if("text"===b.type&&"string"==typeof b.text){d=b.text.slice(0,200);break}}}let e=!0===a.isSidechain,f=e||!!d&&function(a){let b=a.trimStart();return!!(b.startsWith("Base directory for this skill:")||b.startsWith("<system-reminder>")||b.startsWith("Caveat: The messages below were generated by")||b.startsWith("<task-notification>"))}(d);return{type:"user",source:"claude",uuid:a.uuid,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",cwd:a.cwd??"",textPreview:d,isSynthetic:f,isSidechain:!!e||void 0,filePath:b}}(c,a);b&&f.push(b)}}}}return{assistant:e,user:f,parentLinks:g}}var l=c(31519);function m(a,b){if(!b)return{input:0,output:0,cacheCreation5m:0,cacheCreation1h:0,cacheRead:0,total:0,saved:0};let c=a.input_tokens/1e6*b.input,d=a.output_tokens/1e6*b.output,e=a.cache_creation_5m/1e6*b.cacheCreation5m,f=a.cache_creation_1h/1e6*b.cacheCreation1h;e+f===0&&a.cache_creation_input_tokens>0&&(e=a.cache_creation_input_tokens/1e6*b.cacheCreation5m);let g=a.cache_read_input_tokens/1e6*b.cacheRead,h=c+d+e+f+g;return{input:c,output:d,cacheCreation5m:e,cacheCreation1h:f,cacheRead:g,total:h,saved:a.cache_read_input_tokens/1e6*(b.input-b.cacheRead)}}function n(a){return a.replace(/\b\w/g,a=>a.toUpperCase())}let o=/-\d{8}$/,p=/^(vertex_ai|bedrock|anthropic)\//;async function q(a){try{let b=await d.promises.stat(a);return new Date(b.mtimeMs).toISOString()}catch{return new Date().toISOString()}}function r(a){return"string"==typeof a?a:""}function s(a){let b=Number(a);return Number.isFinite(b)?b:0}function t(a){let b=a.message;if("string"==typeof b)return b;let c=a.content;if("string"==typeof c)return c;if(Array.isArray(c))for(let a of c){let b=a?.type;if(("input_text"===b||"output_text"===b||"text"===b)&&"string"==typeof a.text)return a.text}return""}async function u(a){let b,c=(0,d.createReadStream)(a,{encoding:"utf8"}),e=j().createInterface({input:c,crlfDelay:1/0}),f=[],g=[],h=[],i="",k="",l=0,m=0,n=null,o=await q(a),p={turnId:null,cwd:"",model:"gpt-unknown",userUuid:null,toolNames:[],hasThinking:!1,pendingTextPreview:""};for await(let c of e){let d;if(!c.trim())continue;try{d=JSON.parse(c)}catch{continue}if(!d||"object"!=typeof d||!d.type)continue;let e=d.payload??{},j=r(d.timestamp),q=j||o;if(j&&(o=j),"session_meta"===d.type){i=r(e.id),k=r(e.cwd),b=r(e.cli_version)||void 0;let a=r(e.timestamp);a&&(o=a),p.cwd||(p.cwd=k);continue}if("turn_context"===d.type){p.turnId=r(e.turn_id)||p.turnId,p.cwd=r(e.cwd)||k;let a=r(e.model);a&&(p.model=a);let b=r(e.effort);b&&(p.effort=b),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview="";continue}if("event_msg"===d.type){let c=r(e.type);if("user_message"===c){let b=t(e);if(!b)continue;let c=`${i}::u${l++}`;g.push({type:"user",source:"codex",uuid:c,parentUuid:null,timestamp:q,sessionId:i,cwd:p.cwd||k,textPreview:b.slice(0,200),filePath:a}),h.push([c,null]),p.userUuid=c;continue}if("agent_message"===c){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200));continue}if("agent_reasoning"===c){p.hasThinking=!0;continue}if("token_count"===c){let c,d,g,j,l=e.info;if(!l)continue;let o=l.total_token_usage,r=l.last_token_usage,t=o?{input:s(o.input_tokens),cached:s(o.cached_input_tokens),output:s(o.output_tokens),reasoning:s(o.reasoning_output_tokens)}:null;if(t){if(null===n?(c=t.input,d=t.cached,g=t.output,j=t.reasoning):(c=Math.max(0,t.input-n.input),d=Math.max(0,t.cached-n.cached),g=Math.max(0,t.output-n.output),j=Math.max(0,t.reasoning-n.reasoning)),0===c&&0===d&&0===g&&0===j)continue;n=null===n?{...t}:{input:Math.max(n.input,t.input),cached:Math.max(n.cached,t.cached),output:Math.max(n.output,t.output),reasoning:Math.max(n.reasoning,t.reasoning)}}else{if(!r||(c=s(r.input_tokens),d=s(r.cached_input_tokens),g=s(r.output_tokens),j=s(r.reasoning_output_tokens),0===c&&0===d&&0===g&&0===j))continue;n=null===n?{input:c,cached:d,output:g,reasoning:j}:{input:n.input+c,cached:n.cached+d,output:n.output+g,reasoning:n.reasoning+j}}let u=`${i}::a${m++}`,v=p.turnId?`${p.turnId}::a${m}`:`${i}::a${m}`;f.push({type:"assistant",source:"codex",uuid:u,parentUuid:p.userUuid,timestamp:q,sessionId:i,requestId:v,cwd:p.cwd||k,version:b,model:p.model||"gpt-unknown",messageId:v,usage:{input_tokens:Math.max(0,c-d),output_tokens:g+j,cache_creation_input_tokens:0,cache_read_input_tokens:d,cache_creation_5m:0,cache_creation_1h:0,reasoning_tokens:j},toolNames:[...p.toolNames],hasThinking:p.hasThinking,textPreview:p.pendingTextPreview,filePath:a,effort:p.effort}),h.push([u,p.userUuid]),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview=""}continue}if("response_item"===d.type){let a=r(e.type);if("function_call"===a||"custom_tool_call"===a){let a=r(e.name);a&&p.toolNames.push(a);continue}if("reasoning"===a){p.hasThinking=!0;continue}if("message"===a&&"assistant"===r(e.role)){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200))}continue}}return{assistant:f,user:g,parentLinks:h}}var v=c(71310);let w={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"},x={id:"codex",displayName:{en:"Codex",zh:"Codex"},shortLabel:"X",color:{fg:"#047857",bg:"#d1fae5"},logoSrc:"/codex-logo.webp",parserVersion:"codex-v5-last-total-prev",capabilities:{hasCacheCreation:!1,hasReasoningTokens:!0,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".codex","sessions"),f().join(a,".codex","archived_sessions")];return process.env.CCGAUGE_CODEX_DIR&&b.push(process.env.CCGAUGE_CODEX_DIR),process.env.CODEX_HOME&&(b.push(f().join(process.env.CODEX_HOME,"sessions")),b.push(f().join(process.env.CODEX_HOME,"archived_sessions"))),Array.from(new Set(b))},shouldSkipDir:()=>!1,parseFile:u,resolvePricing:v.E7,shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/^openai\//,"");return b.toLowerCase().startsWith("gpt-")?"GPT-"+b.slice(4).split("-").map(a=>w[a.toLowerCase()]??a).join(" "):b.toLowerCase().startsWith("o")?b.toUpperCase():b.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())},costFromUsage:m,costFootnoteKey:"cost.footnote.codex"},y={claude:{id:"claude",displayName:{en:"Claude",zh:"Claude"},shortLabel:"C",color:{fg:"#b45309",bg:"#fef3c7"},logoSrc:"/claude-logo.webp",parserVersion:"claude-v5-task-notification-synthetic",capabilities:{hasCacheCreation:!0,hasReasoningTokens:!1,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".claude","projects"),f().join(a,".config","claude","projects")];return process.env.CCGAUGE_CONFIG_DIR&&b.push(f().join(process.env.CCGAUGE_CONFIG_DIR,"projects")),process.env.CLAUDE_CONFIG_DIR&&b.push(f().join(process.env.CLAUDE_CONFIG_DIR,"projects")),Array.from(new Set(b))},shouldSkipDir:a=>"tool-results"===a||"memory"===a,parseFile:async a=>await k(a),resolvePricing:function(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(l.V[a])return{pricing:l.V[a],matchType:"exact",matchedKey:a};let b=a.replace(o,"");if(l.V[b])return{pricing:l.V[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(p,"");if(l.V[c])return{pricing:l.V[c],matchType:"prefix-stripped",matchedKey:c};for(let b of["fable","opus","sonnet","haiku"])if(a.toLowerCase().includes(b))return{pricing:l.Q[b],matchType:"family-fallback",matchedKey:`claude-${b}-(latest)`};return{pricing:null,matchType:"none",matchedKey:null}},shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/-(\d{8})$/,"").replace(/^(vertex_ai|bedrock|anthropic)\//,""),c=(b=b.replace(/^claude-/,"")).split("-");if(c.length>=2){let a=c[0],b=c.slice(1).join(".");return n(a)+" "+b}return n(b.replace(/-/g," "))},costFromUsage:m,costFootnoteKey:null},codex:x},z=["claude","codex"],A="claude";function B(a){return y[a]}function C(){return z.map(a=>y[a])}function D(a){return"string"==typeof a&&("claude"===a||"codex"===a)}async function E(a){try{return(await d.promises.stat(a)).isDirectory()}catch{return!1}}async function F(){let a=[];for(let b of C())for(let c of b.getDirs())if(await E(c)){a.push(b.id);break}return a}},71310:(a,b,c)=>{"use strict";c.d(b,{E7:()=>h,_G:()=>d});let d={"gpt-5.5":{input:5,output:30,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4":{input:2.5,output:15,cacheRead:.25,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4-mini":{input:.75,output:4.5,cacheRead:.075,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4-nano":{input:.2,output:1.25,cacheRead:.02,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.3-codex":{input:1.75,output:14,cacheRead:.175,cacheCreation5m:0,cacheCreation1h:0},"gpt-5":{input:2.5,output:15,cacheRead:.25,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-mini":{input:.75,output:4.5,cacheRead:.075,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-nano":{input:.2,output:1.25,cacheRead:.02,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-codex":{input:1.75,output:14,cacheRead:.175,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1":{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1-mini":{input:.4,output:1.6,cacheRead:.1,cacheCreation5m:0,cacheCreation1h:0},o3:{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"o4-mini":{input:1.1,output:4.4,cacheRead:.275,cacheCreation5m:0,cacheCreation1h:0}},e={gpt:d["gpt-5.5"],o:d.o3},f=/-\d{8}$/,g=/^(openai)\//;function h(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(d[a])return{pricing:d[a],matchType:"exact",matchedKey:a};let b=a.replace(f,"");if(d[b])return{pricing:d[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(g,"");if(d[c])return{pricing:d[c],matchType:"prefix-stripped",matchedKey:c};let h=a.toLowerCase();return h.startsWith("gpt-")||"gpt"===h?{pricing:e.gpt,matchType:"family-fallback",matchedKey:"gpt-(latest)"}:/^o\d/.test(h)?{pricing:e.o,matchType:"family-fallback",matchedKey:"o-(latest)"}:{pricing:null,matchType:"none",matchedKey:null}}},78335:()=>{},96487:()=>{}};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"functions": {
|
|
4
|
-
"/api/scan": {},
|
|
5
|
-
"/api/blocks": {},
|
|
6
4
|
"/api/pricing": {},
|
|
5
|
+
"/api/usage": {},
|
|
7
6
|
"/api/projects": {},
|
|
7
|
+
"/api/scan": {},
|
|
8
8
|
"/api/sessions": {},
|
|
9
|
-
"/api/
|
|
9
|
+
"/api/blocks": {},
|
|
10
10
|
"/api/export/usage": {}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"wasm": [],
|
|
18
18
|
"assets": [],
|
|
19
19
|
"env": {
|
|
20
|
-
"__NEXT_BUILD_ID": "
|
|
21
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
22
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
23
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
24
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
20
|
+
"__NEXT_BUILD_ID": "T5Enhm7piIOmShjmQ31T5",
|
|
21
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "HmtH/8dEC5dii+5oj21wiLpfxCp+8iAEENi64164oAA=",
|
|
22
|
+
"__NEXT_PREVIEW_MODE_ID": "55df647abce96f391cdb1476cfb2e688",
|
|
23
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "bd4ae66ae63f81628131722b239d8d44aed5d0d8b1f291651ff0945619147462",
|
|
24
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "67f9e4005475073051aaaa4bf76406b16aa5f06e011e9c70da108218fccfa6d2"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-73dfee69c0ddc58e.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-2cb79280eaf22774.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-73dfee69c0ddc58e.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-2cb79280eaf22774.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/T5Enhm7piIOmShjmQ31T5/_buildManifest.js" defer=""></script><script src="/_next/static/T5Enhm7piIOmShjmQ31T5/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"T5Enhm7piIOmShjmQ31T5","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"HmtH/8dEC5dii+5oj21wiLpfxCp+8iAEENi64164oAA="}
|
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,72 @@ All notable changes to **ccgauge** are documented here.
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
6
6
|
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.6] — 2026-06-17
|
|
9
|
+
|
|
10
|
+
Brings GPT pricing back in line with [OpenAI's official rates](https://openai.com/api/pricing/)
|
|
11
|
+
and trims the settings page model table to the variants people actually run today.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **GPT-5 family prices were wrong across the board.** Every gpt-5\* entry was
|
|
16
|
+
carrying the old launch-window numbers (`$1.25 / $10` per 1 M tokens),
|
|
17
|
+
which under-reported cost on every Codex CLI session run since the
|
|
18
|
+
rate change. Updated to current official rates:
|
|
19
|
+
`gpt-5.5` $5 / $30 (cached $0.50), `gpt-5.4` $2.50 / $15 (cached $0.25),
|
|
20
|
+
and `gpt-5.3-codex` $1.75 / $14 (cached $0.175). The bare-name
|
|
21
|
+
Codex CLI aliases (`gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-codex`)
|
|
22
|
+
are mapped to the matching `gpt-5.4` tier so existing transcripts cost
|
|
23
|
+
out correctly without manual remapping.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **`gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.3-codex`, `gpt-5-codex`** as
|
|
28
|
+
first-class pricing entries, so Codex CLI runs on those exact ids get
|
|
29
|
+
an `exact` match instead of falling through to family-fallback.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **Settings → Pricing table trimmed to the models in active use.**
|
|
34
|
+
Codex now shows `gpt-5*` only; the legacy `gpt-4.1`, `o3`, `o4-mini`
|
|
35
|
+
rows are hidden (their prices are still in the underlying table, so
|
|
36
|
+
any historical session involving them still costs out accurately).
|
|
37
|
+
Claude shows only `haiku-4-5`, `sonnet-4-6`, `opus-4-6` and newer,
|
|
38
|
+
plus the `fable-5` family — older snapshots are kept in the data for
|
|
39
|
+
the same backward-compat reason but no longer clutter the UI.
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
|
|
43
|
+
- **`gpt-5.5-mini` and `gpt-5.5-nano` pricing rows.** These ids never
|
|
44
|
+
shipped on the OpenAI pricing page; they were placeholder rows from
|
|
45
|
+
the initial 5.5 announcement and would have masked real usage of the
|
|
46
|
+
`gpt-5.4-mini` / `gpt-5.4-nano` ids that do exist.
|
|
47
|
+
|
|
48
|
+
## [1.1.5] — 2026-06-11
|
|
49
|
+
|
|
50
|
+
Adds pricing support for Claude Fable 5 and fixes a turn-grouping regression
|
|
51
|
+
where background-task completions appeared as dozens of standalone rows on the
|
|
52
|
+
usage page instead of folding into the turn that spawned them.
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- **Claude Fable 5 pricing.** Input $10 / output $50 per 1 M tokens, with
|
|
57
|
+
cache-write multipliers (5 min: ×1.25 → $12.50, 1 h: ×2 → $20) and cache
|
|
58
|
+
read at $1 per 1 M tokens. `fable` is now a recognized family-fallback key,
|
|
59
|
+
so future `claude-fable-*` variants resolve automatically without a code
|
|
60
|
+
change.
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
|
|
64
|
+
- **`<task-notification>` completions split into dozens of standalone rows.**
|
|
65
|
+
When a turn used the Workflow / ultracode tool to fan out background tasks,
|
|
66
|
+
each completion notification arrived as a harness-injected `user` message
|
|
67
|
+
and was incorrectly treated as a new turn root — producing one row per
|
|
68
|
+
background-task result instead of folding all the work back into the
|
|
69
|
+
spawning turn. `isSyntheticUserText` now classifies `<task-notification>`
|
|
70
|
+
messages as synthetic; a `parserVersion` bump (`claude-v5-task-notification-synthetic`)
|
|
71
|
+
invalidates the persisted index cache so existing transcripts are re-parsed
|
|
72
|
+
on first load.
|
|
73
|
+
|
|
8
74
|
## [1.1.4] — 2026-06-07
|
|
9
75
|
|
|
10
76
|
A maintenance follow-up to 1.1.3 — hardens the build's smoke gate and adds
|
package/bin/cli.mjs
CHANGED
|
File without changes
|