This commit is contained in:
2026-07-06 00:01:34 +07:00
parent 2729408ef3
commit e7470e955e
108 changed files with 4131 additions and 529 deletions

View File

@@ -39,7 +39,16 @@ const USAGE_EXTRACTORS = {
},
kiro(raw) {
const input = n(raw.inputTokens), output = n(raw.outputTokens);
return { promptTokens: input, completionTokens: output, totalTokens: input + output };
// ponytail: Amazon Q (Kiro upstream) does not expose cache fields today,
// but pass through any cache_read/cache_creation/cached_tokens if the
// event shape grows them later so cost tracking keeps working without
// a second pass.
const cached = n(raw.cache_read_input_tokens) || n(raw.cachedTokens) || n(raw.cached_tokens);
const cacheCreation = n(raw.cache_creation_input_tokens);
const out = { promptTokens: input, completionTokens: output, totalTokens: input + output };
if (cached > 0) out.cachedTokens = cached;
if (cacheCreation > 0) out.cacheCreationTokens = cacheCreation;
return out;
},
ollama(raw) {
const input = n(raw.prompt_eval_count), output = n(raw.eval_count);