Files
hapi/shared/src/usage.ts
T
KorenKritaandGitHub 256ad98ece fix: normalize cache token usage semantics (#1390)
Normalize usage input at parse time, mark inclusive producers, rebuild derived usage indexes, and preserve valid primary usage when cache partitions are malformed.

Fixes #1389
2026-08-06 18:50:49 +08:00

11 lines
386 B
TypeScript

/**
* Protocol marker for token_count payloads whose input token total already
* includes cache reads/writes. Consumers must not add cache tokens again.
*/
export const INCLUSIVE_INPUT_TOKEN_USAGE_MARKER = {
usageSchema: 'hapi.usage.v1',
inputTokenSemantics: 'includes-cache'
} as const
export type InclusiveInputTokenUsageMarker = typeof INCLUSIVE_INPUT_TOKEN_USAGE_MARKER