@ccusage/codex 17.1.3 → 17.1.5
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/dist/index.js +104 -75
- package/dist/{prompt-B7JRxMsC.js → prompt-CRRaPhnO.js} +19 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -219,8 +219,7 @@ async function createCommandContext({ args, values, positionals, rest, argv: arg
|
|
|
219
219
|
translate
|
|
220
220
|
}));
|
|
221
221
|
const defaultCommandResource = Object.entries(args).map(([key, arg]) => {
|
|
222
|
-
|
|
223
|
-
return [key, description$1];
|
|
222
|
+
return [key, arg.description || ""];
|
|
224
223
|
}).reduce((res, [key, value]) => {
|
|
225
224
|
res[resolveArgKey(key)] = value;
|
|
226
225
|
return res;
|
|
@@ -744,8 +743,7 @@ function parse$2(token, option, schema) {
|
|
|
744
743
|
}
|
|
745
744
|
}
|
|
746
745
|
function createRequireError(option, schema) {
|
|
747
|
-
|
|
748
|
-
return new ArgResolveError(message, option, "required", schema);
|
|
746
|
+
return new ArgResolveError(schema.type === "positional" ? `Positional argument '${option}' is required` : `Optional argument '--${option}' ${schema.short ? `or '-${schema.short}' ` : ""}is required`, option, "required", schema);
|
|
749
747
|
}
|
|
750
748
|
var ArgResolveError = class extends Error {
|
|
751
749
|
name;
|
|
@@ -897,7 +895,7 @@ async function executeCommand(cmd, ctx, name$1) {
|
|
|
897
895
|
await resolved.run(ctx);
|
|
898
896
|
}
|
|
899
897
|
var name = "@ccusage/codex";
|
|
900
|
-
var version = "17.1.
|
|
898
|
+
var version = "17.1.5";
|
|
901
899
|
var description = "Usage analysis tool for OpenAI Codex sessions";
|
|
902
900
|
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
903
901
|
let messages = [];
|
|
@@ -990,8 +988,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
990
988
|
break;
|
|
991
989
|
case "center": {
|
|
992
990
|
let right = Math.ceil(padlen / 2);
|
|
993
|
-
|
|
994
|
-
str = repeat(pad$1, left) + str + repeat(pad$1, right);
|
|
991
|
+
str = repeat(pad$1, padlen - right) + str + repeat(pad$1, right);
|
|
995
992
|
break;
|
|
996
993
|
}
|
|
997
994
|
default:
|
|
@@ -1369,8 +1366,7 @@ var require_supports_colors = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
1369
1366
|
return min;
|
|
1370
1367
|
}
|
|
1371
1368
|
function getSupportLevel(stream) {
|
|
1372
|
-
|
|
1373
|
-
return translateLevel(level$1);
|
|
1369
|
+
return translateLevel(supportsColor(stream));
|
|
1374
1370
|
}
|
|
1375
1371
|
module.exports = {
|
|
1376
1372
|
supportsColor: getSupportLevel,
|
|
@@ -2181,13 +2177,12 @@ var require_layout_manager = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
2181
2177
|
let yMin1 = cell1.y;
|
|
2182
2178
|
let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
|
|
2183
2179
|
let yMin2 = cell2.y;
|
|
2184
|
-
let
|
|
2185
|
-
let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
|
|
2180
|
+
let yConflict = !(yMin1 > cell2.y - 1 + (cell2.rowSpan || 1) || yMin2 > yMax1);
|
|
2186
2181
|
let xMin1 = cell1.x;
|
|
2187
2182
|
let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
|
|
2188
2183
|
let xMin2 = cell2.x;
|
|
2189
|
-
let
|
|
2190
|
-
return yConflict &&
|
|
2184
|
+
let xConflict = !(xMin1 > cell2.x - 1 + (cell2.colSpan || 1) || xMin2 > xMax1);
|
|
2185
|
+
return yConflict && xConflict;
|
|
2191
2186
|
}
|
|
2192
2187
|
function conflictExists(rows, x, y$2) {
|
|
2193
2188
|
let i_max = Math.min(rows.length - 1, y$2);
|
|
@@ -2768,11 +2763,10 @@ var unpackObjectSorter = function(sortByObj) {
|
|
|
2768
2763
|
var sortBy = asc || desc;
|
|
2769
2764
|
throwInvalidConfigErrorIfTrue(!sortBy, "Expected `asc` or `desc` property");
|
|
2770
2765
|
throwInvalidConfigErrorIfTrue(asc && desc, "Ambiguous object with `asc` and `desc` config properties");
|
|
2771
|
-
var comparer = sortByObj.comparer && castComparer(sortByObj.comparer);
|
|
2772
2766
|
return {
|
|
2773
2767
|
order,
|
|
2774
2768
|
sortBy,
|
|
2775
|
-
comparer
|
|
2769
|
+
comparer: sortByObj.comparer && castComparer(sortByObj.comparer)
|
|
2776
2770
|
};
|
|
2777
2771
|
};
|
|
2778
2772
|
var multiPropertySorterProvider = function(defaultComparer$1) {
|
|
@@ -3282,8 +3276,7 @@ function normalizePath(path$1, options) {
|
|
|
3282
3276
|
if (resolvePaths) path$1 = resolve(path$1);
|
|
3283
3277
|
if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
|
|
3284
3278
|
if (path$1 === ".") return "";
|
|
3285
|
-
|
|
3286
|
-
return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
|
|
3279
|
+
return convertSlashes(path$1[path$1.length - 1] !== pathSeparator ? path$1 + pathSeparator : path$1, pathSeparator);
|
|
3287
3280
|
}
|
|
3288
3281
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
3289
3282
|
return directoryPath + filename;
|
|
@@ -3762,12 +3755,6 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3762
3755
|
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
3763
3756
|
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
3764
3757
|
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
3765
|
-
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
3766
|
-
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
3767
|
-
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
3768
|
-
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
3769
|
-
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
3770
|
-
const STAR = `${QMARK}*?`;
|
|
3771
3758
|
const POSIX_CHARS = {
|
|
3772
3759
|
DOT_LITERAL,
|
|
3773
3760
|
PLUS_LITERAL,
|
|
@@ -3777,12 +3764,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3777
3764
|
QMARK,
|
|
3778
3765
|
END_ANCHOR,
|
|
3779
3766
|
DOTS_SLASH,
|
|
3780
|
-
NO_DOT
|
|
3781
|
-
NO_DOTS
|
|
3782
|
-
NO_DOT_SLASH,
|
|
3783
|
-
NO_DOTS_SLASH
|
|
3784
|
-
QMARK_NO_DOT
|
|
3785
|
-
STAR
|
|
3767
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
3768
|
+
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
3769
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
3770
|
+
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
3771
|
+
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
3772
|
+
STAR: `${QMARK}*?`,
|
|
3786
3773
|
START_ANCHOR,
|
|
3787
3774
|
SEP: "/"
|
|
3788
3775
|
};
|
|
@@ -3943,9 +3930,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3943
3930
|
return output;
|
|
3944
3931
|
};
|
|
3945
3932
|
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
3946
|
-
|
|
3947
|
-
const append = options.contains ? "" : "$";
|
|
3948
|
-
let output = `${prepend}(?:${input})${append}`;
|
|
3933
|
+
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
3949
3934
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
3950
3935
|
return output;
|
|
3951
3936
|
};
|
|
@@ -4259,13 +4244,13 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4259
4244
|
const capture = opts.capture ? "" : "?:";
|
|
4260
4245
|
const PLATFORM_CHARS = constants$1.globChars(opts.windows);
|
|
4261
4246
|
const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
|
|
4262
|
-
const { DOT_LITERAL: DOT_LITERAL$1, PLUS_LITERAL: PLUS_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT
|
|
4247
|
+
const { DOT_LITERAL: DOT_LITERAL$1, PLUS_LITERAL: PLUS_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK: QMARK$1, QMARK_NO_DOT, STAR, START_ANCHOR: START_ANCHOR$1 } = PLATFORM_CHARS;
|
|
4263
4248
|
const globstar = (opts$1) => {
|
|
4264
4249
|
return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
|
|
4265
4250
|
};
|
|
4266
|
-
const nodot = opts.dot ? "" : NO_DOT
|
|
4267
|
-
const qmarkNoDot = opts.dot ? QMARK$1 : QMARK_NO_DOT
|
|
4268
|
-
let star = opts.bash === true ? globstar(opts) : STAR
|
|
4251
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
4252
|
+
const qmarkNoDot = opts.dot ? QMARK$1 : QMARK_NO_DOT;
|
|
4253
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
4269
4254
|
if (opts.capture) star = `(${star})`;
|
|
4270
4255
|
if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
|
|
4271
4256
|
const state = {
|
|
@@ -4462,8 +4447,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4462
4447
|
if (inner.includes(":")) {
|
|
4463
4448
|
const idx = prev.value.lastIndexOf("[");
|
|
4464
4449
|
const pre = prev.value.slice(0, idx);
|
|
4465
|
-
const
|
|
4466
|
-
const posix$1 = POSIX_REGEX_SOURCE[rest$1];
|
|
4450
|
+
const posix$1 = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
4467
4451
|
if (posix$1) {
|
|
4468
4452
|
prev.value = pre + posix$1;
|
|
4469
4453
|
state.backtrack = true;
|
|
@@ -4699,7 +4683,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4699
4683
|
push({
|
|
4700
4684
|
type: "qmark",
|
|
4701
4685
|
value,
|
|
4702
|
-
output: QMARK_NO_DOT
|
|
4686
|
+
output: QMARK_NO_DOT
|
|
4703
4687
|
});
|
|
4704
4688
|
continue;
|
|
4705
4689
|
}
|
|
@@ -4903,11 +4887,11 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4903
4887
|
}
|
|
4904
4888
|
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
4905
4889
|
if (prev.type === "dot") {
|
|
4906
|
-
state.output += NO_DOT_SLASH
|
|
4907
|
-
prev.output += NO_DOT_SLASH
|
|
4890
|
+
state.output += NO_DOT_SLASH;
|
|
4891
|
+
prev.output += NO_DOT_SLASH;
|
|
4908
4892
|
} else if (opts.dot === true) {
|
|
4909
|
-
state.output += NO_DOTS_SLASH
|
|
4910
|
-
prev.output += NO_DOTS_SLASH
|
|
4893
|
+
state.output += NO_DOTS_SLASH;
|
|
4894
|
+
prev.output += NO_DOTS_SLASH;
|
|
4911
4895
|
} else {
|
|
4912
4896
|
state.output += nodot;
|
|
4913
4897
|
prev.output += nodot;
|
|
@@ -4954,15 +4938,15 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4954
4938
|
const len = input.length;
|
|
4955
4939
|
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
4956
4940
|
input = REPLACEMENTS[input] || input;
|
|
4957
|
-
const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT
|
|
4958
|
-
const nodot = opts.dot ? NO_DOTS
|
|
4959
|
-
const slashDot = opts.dot ? NO_DOTS_SLASH
|
|
4941
|
+
const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR: START_ANCHOR$1 } = constants$1.globChars(opts.windows);
|
|
4942
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
4943
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
4960
4944
|
const capture = opts.capture ? "" : "?:";
|
|
4961
4945
|
const state = {
|
|
4962
4946
|
negated: false,
|
|
4963
4947
|
prefix: ""
|
|
4964
4948
|
};
|
|
4965
|
-
let star = opts.bash === true ? ".*?" : STAR
|
|
4949
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
4966
4950
|
if (opts.capture) star = `(${star})`;
|
|
4967
4951
|
const globstar = (opts$1) => {
|
|
4968
4952
|
if (opts$1.noglobstar === true) return star;
|
|
@@ -4987,8 +4971,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4987
4971
|
}
|
|
4988
4972
|
}
|
|
4989
4973
|
};
|
|
4990
|
-
|
|
4991
|
-
let source = create$1(output);
|
|
4974
|
+
let source = create$1(utils$2.removePrefix(input, state));
|
|
4992
4975
|
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL$1}?`;
|
|
4993
4976
|
return source;
|
|
4994
4977
|
};
|
|
@@ -5400,8 +5383,7 @@ async function glob(patternsOrOptions, options) {
|
|
|
5400
5383
|
if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
5401
5384
|
const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
|
|
5402
5385
|
const opts = isModern ? options : patternsOrOptions;
|
|
5403
|
-
const
|
|
5404
|
-
const [crawler, relative$1] = getCrawler(patterns, opts);
|
|
5386
|
+
const [crawler, relative$1] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
|
|
5405
5387
|
if (!relative$1) return crawler.withPromise();
|
|
5406
5388
|
return formatPaths(await crawler.withPromise(), relative$1);
|
|
5407
5389
|
}
|
|
@@ -6052,11 +6034,10 @@ ${indent}`);
|
|
|
6052
6034
|
return causedPrefix + message + "\n" + stack + causedError;
|
|
6053
6035
|
}
|
|
6054
6036
|
formatArgs(args, opts) {
|
|
6055
|
-
|
|
6037
|
+
return formatWithOptions(opts, ...args.map((arg) => {
|
|
6056
6038
|
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
6057
6039
|
return arg;
|
|
6058
|
-
});
|
|
6059
|
-
return formatWithOptions(opts, ..._args);
|
|
6040
|
+
}));
|
|
6060
6041
|
}
|
|
6061
6042
|
formatDate(date, opts) {
|
|
6062
6043
|
return opts.date ? date.toLocaleTimeString() : "";
|
|
@@ -6078,11 +6059,10 @@ ${indent}`);
|
|
|
6078
6059
|
]);
|
|
6079
6060
|
}
|
|
6080
6061
|
log(logObj, ctx) {
|
|
6081
|
-
|
|
6062
|
+
return writeStream(this.formatLogObj(logObj, {
|
|
6082
6063
|
columns: ctx.options.stdout.columns || 0,
|
|
6083
6064
|
...ctx.options.formatOptions
|
|
6084
|
-
});
|
|
6085
|
-
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
6065
|
+
}) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
6086
6066
|
}
|
|
6087
6067
|
};
|
|
6088
6068
|
const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
|
|
@@ -6276,8 +6256,7 @@ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta
|
|
|
6276
6256
|
return i()[s$1] ?? r[s$1];
|
|
6277
6257
|
},
|
|
6278
6258
|
has(e, s$1) {
|
|
6279
|
-
|
|
6280
|
-
return s$1 in E || s$1 in r;
|
|
6259
|
+
return s$1 in i() || s$1 in r;
|
|
6281
6260
|
},
|
|
6282
6261
|
set(e, s$1, E) {
|
|
6283
6262
|
const B = i(true);
|
|
@@ -6574,7 +6553,7 @@ function createConsola$1(options = {}) {
|
|
|
6574
6553
|
defaults: { level: level$1 },
|
|
6575
6554
|
stdout: process.stdout,
|
|
6576
6555
|
stderr: process.stderr,
|
|
6577
|
-
prompt: (...args) => import("./prompt-
|
|
6556
|
+
prompt: (...args) => import("./prompt-CRRaPhnO.js").then((m$1) => m$1.prompt(...args)),
|
|
6578
6557
|
reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
6579
6558
|
...options
|
|
6580
6559
|
});
|
|
@@ -6761,8 +6740,7 @@ async function loadTokenUsageEvents(options = {}) {
|
|
|
6761
6740
|
const delta = convertToDelta(raw);
|
|
6762
6741
|
if (delta.inputTokens === 0 && delta.cachedInputTokens === 0 && delta.outputTokens === 0 && delta.reasoningOutputTokens === 0) continue;
|
|
6763
6742
|
const payloadRecordResult = /* @__PURE__ */ safeParse(recordSchema, payload ?? void 0);
|
|
6764
|
-
const
|
|
6765
|
-
const extractedModel = extractModel(extractionSource);
|
|
6743
|
+
const extractedModel = extractModel(payloadRecordResult.success ? Object.assign({}, payloadRecordResult.output, { info: info$1 }) : { info: info$1 });
|
|
6766
6744
|
let isFallbackModel = false;
|
|
6767
6745
|
if (extractedModel != null) {
|
|
6768
6746
|
currentModel = extractedModel;
|
|
@@ -7037,6 +7015,13 @@ const PREFETCHED_CODEX_PRICING = {
|
|
|
7037
7015
|
"max_input_tokens": 272e3,
|
|
7038
7016
|
"max_output_tokens": 128e3
|
|
7039
7017
|
},
|
|
7018
|
+
"azure/gpt-5-pro": {
|
|
7019
|
+
"input_cost_per_token": 15e-6,
|
|
7020
|
+
"output_cost_per_token": 12e-5,
|
|
7021
|
+
"max_tokens": 4e5,
|
|
7022
|
+
"max_input_tokens": 272e3,
|
|
7023
|
+
"max_output_tokens": 128e3
|
|
7024
|
+
},
|
|
7040
7025
|
"gpt-5": {
|
|
7041
7026
|
"input_cost_per_token": 125e-8,
|
|
7042
7027
|
"output_cost_per_token": 1e-5,
|
|
@@ -7045,14 +7030,15 @@ const PREFETCHED_CODEX_PRICING = {
|
|
|
7045
7030
|
"max_input_tokens": 272e3,
|
|
7046
7031
|
"max_output_tokens": 128e3
|
|
7047
7032
|
},
|
|
7048
|
-
"gpt-5
|
|
7049
|
-
"input_cost_per_token":
|
|
7050
|
-
"output_cost_per_token":
|
|
7051
|
-
"
|
|
7052
|
-
"
|
|
7053
|
-
"
|
|
7033
|
+
"gpt-5.1": {
|
|
7034
|
+
"input_cost_per_token": 125e-8,
|
|
7035
|
+
"output_cost_per_token": 1e-5,
|
|
7036
|
+
"cache_read_input_token_cost": 125e-9,
|
|
7037
|
+
"max_tokens": 128e3,
|
|
7038
|
+
"max_input_tokens": 272e3,
|
|
7039
|
+
"max_output_tokens": 128e3
|
|
7054
7040
|
},
|
|
7055
|
-
"gpt-5-
|
|
7041
|
+
"gpt-5.1-2025-11-13": {
|
|
7056
7042
|
"input_cost_per_token": 125e-8,
|
|
7057
7043
|
"output_cost_per_token": 1e-5,
|
|
7058
7044
|
"cache_read_input_token_cost": 125e-9,
|
|
@@ -7060,6 +7046,28 @@ const PREFETCHED_CODEX_PRICING = {
|
|
|
7060
7046
|
"max_input_tokens": 272e3,
|
|
7061
7047
|
"max_output_tokens": 128e3
|
|
7062
7048
|
},
|
|
7049
|
+
"gpt-5.1-chat-latest": {
|
|
7050
|
+
"input_cost_per_token": 125e-8,
|
|
7051
|
+
"output_cost_per_token": 1e-5,
|
|
7052
|
+
"cache_read_input_token_cost": 125e-9,
|
|
7053
|
+
"max_tokens": 16384,
|
|
7054
|
+
"max_input_tokens": 128e3,
|
|
7055
|
+
"max_output_tokens": 16384
|
|
7056
|
+
},
|
|
7057
|
+
"gpt-5-pro": {
|
|
7058
|
+
"input_cost_per_token": 15e-6,
|
|
7059
|
+
"output_cost_per_token": 12e-5,
|
|
7060
|
+
"max_tokens": 272e3,
|
|
7061
|
+
"max_input_tokens": 4e5,
|
|
7062
|
+
"max_output_tokens": 272e3
|
|
7063
|
+
},
|
|
7064
|
+
"gpt-5-pro-2025-10-06": {
|
|
7065
|
+
"input_cost_per_token": 15e-6,
|
|
7066
|
+
"output_cost_per_token": 12e-5,
|
|
7067
|
+
"max_tokens": 272e3,
|
|
7068
|
+
"max_input_tokens": 4e5,
|
|
7069
|
+
"max_output_tokens": 272e3
|
|
7070
|
+
},
|
|
7063
7071
|
"gpt-5-2025-08-07": {
|
|
7064
7072
|
"input_cost_per_token": 125e-8,
|
|
7065
7073
|
"output_cost_per_token": 1e-5,
|
|
@@ -7084,6 +7092,30 @@ const PREFETCHED_CODEX_PRICING = {
|
|
|
7084
7092
|
"max_input_tokens": 128e3,
|
|
7085
7093
|
"max_output_tokens": 16384
|
|
7086
7094
|
},
|
|
7095
|
+
"gpt-5-codex": {
|
|
7096
|
+
"input_cost_per_token": 125e-8,
|
|
7097
|
+
"output_cost_per_token": 1e-5,
|
|
7098
|
+
"cache_read_input_token_cost": 125e-9,
|
|
7099
|
+
"max_tokens": 128e3,
|
|
7100
|
+
"max_input_tokens": 272e3,
|
|
7101
|
+
"max_output_tokens": 128e3
|
|
7102
|
+
},
|
|
7103
|
+
"gpt-5.1-codex": {
|
|
7104
|
+
"input_cost_per_token": 125e-8,
|
|
7105
|
+
"output_cost_per_token": 1e-5,
|
|
7106
|
+
"cache_read_input_token_cost": 125e-9,
|
|
7107
|
+
"max_tokens": 128e3,
|
|
7108
|
+
"max_input_tokens": 272e3,
|
|
7109
|
+
"max_output_tokens": 128e3
|
|
7110
|
+
},
|
|
7111
|
+
"gpt-5.1-codex-mini": {
|
|
7112
|
+
"input_cost_per_token": 25e-8,
|
|
7113
|
+
"output_cost_per_token": 2e-6,
|
|
7114
|
+
"cache_read_input_token_cost": 25e-9,
|
|
7115
|
+
"max_tokens": 128e3,
|
|
7116
|
+
"max_input_tokens": 272e3,
|
|
7117
|
+
"max_output_tokens": 128e3
|
|
7118
|
+
},
|
|
7087
7119
|
"gpt-5-mini": {
|
|
7088
7120
|
"input_cost_per_token": 25e-8,
|
|
7089
7121
|
"output_cost_per_token": 2e-6,
|
|
@@ -7367,8 +7399,7 @@ async function buildMonthlyReport(events, options) {
|
|
|
7367
7399
|
for (const event of events) {
|
|
7368
7400
|
const modelName = event.model?.trim();
|
|
7369
7401
|
if (modelName == null || modelName === "") continue;
|
|
7370
|
-
|
|
7371
|
-
if (!isWithinRange(dateKey, since, until)) continue;
|
|
7402
|
+
if (!isWithinRange(toDateKey(event.timestamp, timezone), since, until)) continue;
|
|
7372
7403
|
const monthKey = toMonthKey(event.timestamp, timezone);
|
|
7373
7404
|
const summary = summaries.get(monthKey) ?? createSummary$1(monthKey, event.timestamp);
|
|
7374
7405
|
if (!summaries.has(monthKey)) summaries.set(monthKey, summary);
|
|
@@ -7593,8 +7624,7 @@ async function buildSessionReport(events, options) {
|
|
|
7593
7624
|
if (rawModelName == null) continue;
|
|
7594
7625
|
const modelName = rawModelName.trim();
|
|
7595
7626
|
if (modelName === "") continue;
|
|
7596
|
-
|
|
7597
|
-
if (!isWithinRange(dateKey, since, until)) continue;
|
|
7627
|
+
if (!isWithinRange(toDateKey(event.timestamp, timezone), since, until)) continue;
|
|
7598
7628
|
const summary = summaries.get(sessionId) ?? createSummary(sessionId, event.timestamp);
|
|
7599
7629
|
if (!summaries.has(sessionId)) summaries.set(sessionId, summary);
|
|
7600
7630
|
addUsage(summary, event);
|
|
@@ -7773,8 +7803,7 @@ const sessionCommand = define({
|
|
|
7773
7803
|
totalsForDisplay.cacheReadTokens += split.cacheReadTokens;
|
|
7774
7804
|
totalsForDisplay.totalTokens += row.totalTokens;
|
|
7775
7805
|
totalsForDisplay.costUSD += row.costUSD;
|
|
7776
|
-
const
|
|
7777
|
-
const displayDate = formatDisplayDate(dateKey, ctx.values.locale, ctx.values.timezone);
|
|
7806
|
+
const displayDate = formatDisplayDate(toDateKey(row.lastActivity, ctx.values.timezone), ctx.values.locale, ctx.values.timezone);
|
|
7778
7807
|
const directoryDisplay = row.directory === "" ? "-" : row.directory;
|
|
7779
7808
|
const sessionFile = row.sessionFile;
|
|
7780
7809
|
const shortSession = sessionFile.length > 8 ? `…${sessionFile.slice(-8)}` : sessionFile;
|
|
@@ -37,28 +37,26 @@ function requireSrc() {
|
|
|
37
37
|
save: `${ESC}7`,
|
|
38
38
|
restore: `${ESC}8`
|
|
39
39
|
};
|
|
40
|
-
const scroll = {
|
|
41
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
42
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
43
|
-
};
|
|
44
|
-
const erase = {
|
|
45
|
-
screen: `${CSI}2J`,
|
|
46
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
47
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
48
|
-
line: `${CSI}2K`,
|
|
49
|
-
lineEnd: `${CSI}K`,
|
|
50
|
-
lineStart: `${CSI}1K`,
|
|
51
|
-
lines(count) {
|
|
52
|
-
let clear = "";
|
|
53
|
-
for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
54
|
-
if (count) clear += cursor.left;
|
|
55
|
-
return clear;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
40
|
src = {
|
|
59
41
|
cursor,
|
|
60
|
-
scroll
|
|
61
|
-
|
|
42
|
+
scroll: {
|
|
43
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
44
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
45
|
+
},
|
|
46
|
+
erase: {
|
|
47
|
+
screen: `${CSI}2J`,
|
|
48
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
49
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
50
|
+
line: `${CSI}2K`,
|
|
51
|
+
lineEnd: `${CSI}K`,
|
|
52
|
+
lineStart: `${CSI}1K`,
|
|
53
|
+
lines(count) {
|
|
54
|
+
let clear = "";
|
|
55
|
+
for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
56
|
+
if (count) clear += cursor.left;
|
|
57
|
+
return clear;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
62
60
|
beep
|
|
63
61
|
};
|
|
64
62
|
return src;
|
|
@@ -842,4 +840,4 @@ async function prompt(message, opts = {}) {
|
|
|
842
840
|
}).then(handleCancel);
|
|
843
841
|
throw new Error(`Unknown prompt type: ${opts.type}`);
|
|
844
842
|
}
|
|
845
|
-
export { prompt };
|
|
843
|
+
export { kCancel, prompt };
|