From 4e9c3771f058da6d0de2e1c384f85e22c7bcb1d6 Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Mon, 10 Aug 2026 02:53:05 -0700 Subject: [PATCH] feat(menubar): OpenClaude provider tab, change-guard watch root, docs index rows --- README.md | 1 + docs/providers/README.md | 1 + mac/Sources/CodeBurnMenubar/AppStore.swift | 2 ++ mac/Sources/CodeBurnMenubar/Data/UsageDataChangeGuard.swift | 2 ++ mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift | 1 + 5 files changed, 7 insertions(+) diff --git a/README.md b/README.md index e6c88f1a..24af85ae 100644 --- a/README.md +++ b/README.md @@ -667,6 +667,7 @@ These are starting points, not verdicts. A 60% cache hit on a single experimenta | **Kiro** | `.chat` JSON files | Token counts are estimated from content length. The model is not exposed, so sessions are labeled `kiro-auto` and costed at Sonnet rates. | | **Mistral Vibe** | `~/.vibe/logs/session/` (or `$VIBE_HOME/logs/session/`); each folder has `meta.json` + `messages.jsonl` | Reads cumulative prompt/completion totals and model pricing from `meta.json`, then the first user prompt and tool calls from `messages.jsonl`. Emits one record per session (source data is cumulative, not per turn); subagent sessions under `agents/` are counted separately. | | **OpenClaw** | `~/.openclaw/agents/*.jsonl` (legacy `.clawdbot`, `.moltbot`, `.moldbot`) | Token usage comes from assistant message `usage` blocks; the model from `modelId` or `message.model`. | +| **OpenClaude** | `~/.openclaude/projects//*.jsonl` (or `$CODEBURN_OPENCLAUDE_DIR/projects/`) | Claude Code fork routed to any LLM backend; transcripts are Claude-Code schema. Only usage-bearing assistant lines become calls; no cost field exists, so every call is priced from the shared tables and flagged estimated. Sidechain (subagent) lines are counted as real spend. | | **Warp** | `~/Library/Group Containers/2BBY89MBSN.dev.warp/Library/Application Support/dev.warp.Warp-Stable/warp.sqlite` (Preview fallback) | Reads `agent_conversations`, `ai_queries`, and `blocks`, emitting one call per finalized exchange. Exchange token share is estimated from prompt-size weighting normalized to conversation totals; `run_command` blocks attach to the nearest preceding exchange by timestamp. | | **Zed** | SQLite `~/Library/Application Support/Zed/threads/threads.db` (Linux `~/.local/share/zed/threads/`) | One row per agent thread; the blob is zstd-compressed JSON with per-request token usage (input, output, cache read, cache write) and the thread's model. Threads are topped up to the exact cumulative counter so totals match the store. Needs Node 22.15+ for built-in zstd. | | **Forge** | SQLite `~/.forge/.forge.db` | Queries `conversations` read-only and parses `context.messages`. Assistant usage entries provide prompt, completion, and cached counts; CodeBurn subtracts cached from prompt for input pricing, emits one call per assistant message, and extracts tool calls plus shell commands. | diff --git a/docs/providers/README.md b/docs/providers/README.md index 3aae178a..971ae2b4 100644 --- a/docs/providers/README.md +++ b/docs/providers/README.md @@ -28,6 +28,7 @@ For the architectural picture, see `../architecture.md`. | [LingTai TUI](lingtai-tui.md) | JSONL | `src/providers/lingtai-tui.ts` | `tests/providers/lingtai-tui.test.ts` | | [Mistral Vibe](mistral-vibe.md) | JSON / JSONL | `src/providers/mistral-vibe.ts` | `tests/providers/mistral-vibe.test.ts` | | [OpenClaw](openclaw.md) | JSONL | `src/providers/openclaw.ts` | `tests/providers/openclaw.test.ts` | +| [OpenClaude](openclaude.md) | JSONL | `src/providers/openclaude.ts` | `tests/providers/openclaude.test.ts` | | [Pi](pi.md) | JSONL | `src/providers/pi.ts` | `tests/providers/pi.test.ts` | | [OMP](omp.md) | JSONL | `src/providers/pi.ts` | `tests/providers/omp.test.ts` | | [Qwen](qwen.md) | JSONL | `src/providers/qwen.ts` | none | diff --git a/mac/Sources/CodeBurnMenubar/AppStore.swift b/mac/Sources/CodeBurnMenubar/AppStore.swift index 10f886b8..005a7531 100644 --- a/mac/Sources/CodeBurnMenubar/AppStore.swift +++ b/mac/Sources/CodeBurnMenubar/AppStore.swift @@ -1600,6 +1600,7 @@ enum ProviderFilter: String, CaseIterable, Identifiable { case lingtaiTui = "LingTai TUI" case kiloCode = "KiloCode" case openclaw = "OpenClaw" + case openclaude = "OpenClaude" case opencode = "OpenCode" case pi = "Pi" case qwen = "Qwen" @@ -1654,6 +1655,7 @@ enum ProviderFilter: String, CaseIterable, Identifiable { case .kimiCode: "kimicode" case .lingtaiTui: "lingtai-tui" case .openclaw: "openclaw" + case .openclaude: "openclaude" case .opencode: "opencode" case .pi: "pi" case .qwen: "qwen" diff --git a/mac/Sources/CodeBurnMenubar/Data/UsageDataChangeGuard.swift b/mac/Sources/CodeBurnMenubar/Data/UsageDataChangeGuard.swift index dd865a95..d2a48c36 100644 --- a/mac/Sources/CodeBurnMenubar/Data/UsageDataChangeGuard.swift +++ b/mac/Sources/CodeBurnMenubar/Data/UsageDataChangeGuard.swift @@ -99,6 +99,8 @@ enum UsageDataChangeGuard { for name in [".openclaw", ".clawdbot", ".moltbot", ".moldbot"] { add(path(homeDirectory, name, "agents"), scanFirstLevelDirectories: false) } + let openClaudeRoot = expand(environment["CODEBURN_OPENCLAUDE_DIR"] ?? path(homeDirectory, ".openclaude"), homeDirectory: homeDirectory) + add(path(openClaudeRoot, "projects"), scanFirstLevelDirectories: true) add(path(applicationSupport, "Open Design"), scanFirstLevelDirectories: false) add(path(homeDirectory, ".pi", "agent", "sessions"), scanFirstLevelDirectories: false) add(path(homeDirectory, ".omp", "agent", "sessions"), scanFirstLevelDirectories: false) diff --git a/mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift b/mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift index 40deb714..38a943cb 100644 --- a/mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift +++ b/mac/Sources/CodeBurnMenubar/Views/AgentTabStrip.swift @@ -497,6 +497,7 @@ extension ProviderFilter { case .kimiCode: return Color(red: 0xA3/255.0, green: 0xE6/255.0, blue: 0x35/255.0) case .lingtaiTui: return Color(red: 0x22/255.0, green: 0xA7/255.0, blue: 0xA0/255.0) case .openclaw: return Color(red: 0xDA/255.0, green: 0x70/255.0, blue: 0x56/255.0) + case .openclaude: return Color(red: 0xC2/255.0, green: 0x41/255.0, blue: 0x6B/255.0) case .opencode: return Color(red: 0x5B/255.0, green: 0x83/255.0, blue: 0x5B/255.0) case .pi: return Color(red: 0xB2/255.0, green: 0x6B/255.0, blue: 0x3D/255.0) case .qwen: return Color(red: 0x61/255.0, green: 0x5E/255.0, blue: 0xEB/255.0)