1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Cursor adapter — STUB, intentionally deferred (CLAUDE.md §11 v0.4).
//!
//! Schema VERIFIED against real local data 2026-06-16 (Windows, `%APPDATA%`):
//! - Chat lives in the **`cursorDiskKV`** table of `state.vscdb` (NOT `ItemTable`,
//! which only holds UI/workbench keys). Cross-workspace conversations are in
//! `User/globalStorage/state.vscdb`; per-workspace ones under
//! `User/workspaceStorage/<hash>/state.vscdb`.
//! - Keys: `composerData:<composerId>` = one conversation
//! (`modelConfig.modelName`, `contextTokensUsed`/`contextTokenLimit`,
//! `fullConversationHeadersOnly` ordering); `bubbleId:<composerId>:<bubbleId>`
//! = one message (`type`, `requestId`, `toolFormerData`, `toolResults`, and a
//! `tokenCount: { inputTokens, outputTokens }`).
//!
//! WHY DEFERRED (not a difficulty — a payoff problem): on real data the per-message
//! `tokenCount` is **~99% zeroed** (3 of 275 bubbles non-zero in a real
//! globalStorage db) and `modelConfig.modelName` is frequently the literal
//! `"default"` (unresolvable to a price). So Cursor cannot deliver skiagram's core
//! "correct accounting" wedge — it would be a structural-only adapter (sessions /
//! models / context-window fill) like the Copilot one. Implementing it also pulls
//! in `rusqlite` with the bundled C SQLite (a compiled dep on a project that prizes
//! a lean static binary, §12). The cost/benefit doesn't clear the bar yet; revisit
//! if Cursor starts recording real per-request usage. Open READ-ONLY when built.
use crateAdapter;
use crate;
;