Skip to content

desktop/src-tauri/crates/core/src/adapters/cline/common.rs

Comment 1, line 1

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:1

//! Legacy Cline UI usage mapping from fixed getApiMetrics.ts dcf8c3c, A03.

Comment 2, line 2

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:2

//! SDK records have separate parsing/mapping; native SDK acceptance does not verify this UI format.

Comment 3, line 3

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:3

//!

Comment 4, line 4

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:4

//! Source: apps/vscode/src/shared/getApiMetrics.ts.

Comment 5, line 5

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:5

//! - text JSON tokensIn/tokensOut/cacheWrites/cacheReads are individually optional;

Comment 6, line 6

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:6

//! upstream checks typeof === "number", without replacing absent values with zero.

Comment 7, line 7

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:7

//! - Four buckets are exclusive: getLastApiReqTotalTokens calculates

Comment 8, line 8

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:8

//! tokensIn + tokensOut + cacheWrites + cacheReads.

Comment 9, line 9

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:9

//! Therefore input_total = tokensIn + cacheWrites + cacheReads (derived),

Comment 10, line 10

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:10

//! and total_tokens sums all four buckets (derived).

Comment 11, line 11

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:11

//!

Comment 12, line 12

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:12

//! Shared MappedUsage/finish remain in cross-agent usage_map.rs.

Comment 13, line 17

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:17

/// Four optional exclusive usage buckets in Cline say-message text JSON; missing remains unknown.

Comment 14, line 27

desktop/src-tauri/crates/core/src/adapters/cline/common.rs:27

/// Whether all four usage fields are absent.