/** * A Claude Code member's context occupancy, read off its stream-json events. * * Claude Code states no occupancy of its own: the closest reading is what * the LAST top-level request sent — its `input_tokens` plus the cached * prefix (`cache_read_input_tokens` + `cache_creation_input_tokens`), which * together are the whole prompt the model saw. A subagent's (Task) messages * carry `parent_tool_use_id` and their own context, so they never count. * The window comes from the `result` event's `modelUsage[model].contextWindow` * for the model that request ran on. * @module @khorsheed/dsh-local-agent-claude-code — context reading */ /** One round's occupancy, once the stream reported it. */ export interface ClaudeContextReading { readonly usedTokens: number; readonly contextWindow?: number; } type Json = Record; /** Folds one round's events into its last occupancy reading. */ export declare class ClaudeContextTracker { private used; private model; private window; /** Feed one stream-json event (any type; only `assistant` and `result` count). */ observe(event: Json): void; /** The round's reading; undefined when no top-level request reported usage. */ reading(): ClaudeContextReading | undefined; } export {}; //# sourceMappingURL=context-reading.d.ts.map