mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-29 10:43:47 +00:00
Add VSCodium storage discovery for VS Code-family providers (#233)
Copilot, Roo Code, and KiloCode now scan VSCodium and VS Code Insiders storage roots in addition to VS Code. Also updates Discord invite link.
This commit is contained in:
parent
82d6c7fa4d
commit
78b413bf7a
8 changed files with 130 additions and 29 deletions
|
|
@ -12,6 +12,9 @@
|
|||
using turn-level MCP/Skill call evidence and a shared-turn token estimate so
|
||||
one retry-heavy turn is not double-counted across multiple capabilities.
|
||||
Thanks @ozymandiashh. (#357)
|
||||
- **VSCodium storage discovery.** Copilot, Roo Code, and KiloCode now scan
|
||||
VSCodium and VS Code Insiders storage roots in addition to VS Code, so
|
||||
usage from VSCodium is included automatically. Thanks @ozymandiashh. (#233)
|
||||
- **Tooling breakdowns in dashboard and menubar.** New panels showing core
|
||||
tools, MCP servers, and shell command usage per session and across periods.
|
||||
- **File-aware retry detection with typed ToolCall.** One-shot rate now tracks
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<a href="https://www.npmjs.com/package/codeburn"><img src="https://img.shields.io/npm/dt/codeburn.svg" alt="total downloads" /></a>
|
||||
<a href="https://github.com/getagentseal/codeburn/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/codeburn.svg" alt="license" /></a>
|
||||
<a href="https://github.com/getagentseal/codeburn"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg" alt="node version" /></a>
|
||||
<a href="https://discord.gg/pJ2DMWvtAx"><img src="https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
|
||||
<a href="https://discord.gg/qehtMNXU5U"><img src="https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
|
||||
<a href="https://github.com/sponsors/iamtoruk"><img src="https://img.shields.io/badge/sponsor-♥-ea4aaa?logo=github" alt="Sponsor" /></a>
|
||||
</p>
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ The `--provider` flag filters any command to a single provider: `codeburn report
|
|||
|
||||
**Kiro** stores conversations as `.chat` JSON files. Token counts are estimated from content length. The underlying model is not exposed, so sessions are labeled `kiro-auto` and costed at Sonnet rates.
|
||||
|
||||
**GitHub Copilot** reads from both `~/.copilot/session-state/` (legacy CLI) and VS Code's `workspaceStorage/*/GitHub.copilot-chat/transcripts/`. The VS Code format has no explicit token counts; tokens are estimated from content length and the model is inferred from tool call ID prefixes.
|
||||
**GitHub Copilot** reads from both `~/.copilot/session-state/` (legacy CLI) and VS Code/VSCodium `workspaceStorage/*/GitHub.copilot-chat/transcripts/`. The editor transcript format has no explicit token counts; tokens are estimated from content length and the model is inferred from tool call ID prefixes.
|
||||
|
||||
**OpenClaw** reads JSONL agent logs from `~/.openclaw/agents/` and also checks legacy paths (`.clawdbot`, `.moltbot`, `.moldbot`).
|
||||
|
||||
|
|
@ -395,7 +395,7 @@ These are starting points, not verdicts. A 60% cache hit on a single experimenta
|
|||
|
||||
**OpenClaw** stores agent sessions as JSONL at `~/.openclaw/agents/*.jsonl`. Also checks legacy paths `.clawdbot`, `.moltbot`, `.moldbot`. Token usage comes from assistant message `usage` blocks; model from `modelId` or `message.model` fields.
|
||||
|
||||
**Cline / Roo Code / KiloCode** are Cline-family coding agents. CodeBurn reads `ui_messages.json` from each task directory, filtering `type: "say"` entries with `say: "api_req_started"` to extract token counts. Cline scans both VS Code's `globalStorage/saoudrizwan.claude-dev` and `~/.cline/data`.
|
||||
**Cline / Roo Code / KiloCode** are Cline-family coding agents. CodeBurn reads `ui_messages.json` from each task directory, filtering `type: "say"` entries with `say: "api_req_started"` to extract token counts. Cline scans both VS Code's `globalStorage/saoudrizwan.claude-dev` and `~/.cline/data`; Roo Code and KiloCode scan VS Code, VS Code Insiders, and VSCodium `globalStorage` roots.
|
||||
|
||||
**IBM Bob** stores IDE task history in `User/globalStorage/ibm.bob-code/tasks/<task-id>/` under the IBM Bob application data directory. CodeBurn reads `ui_messages.json` for API request token/cost records and `api_conversation_history.json` for the selected model, with support for both GA (`IBM Bob`) and preview (`Bob-IDE`) app data folders.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { existsSync } from 'fs'
|
||||
import { readdir, readFile, stat } from 'fs/promises'
|
||||
import { basename, dirname, join } from 'path'
|
||||
import { basename, dirname, join, posix, win32 } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
import { readSessionFile } from '../fs-utils.js'
|
||||
|
|
@ -137,7 +137,8 @@ function parseLegacyEvents(content: string, sessionId: string, seenKeys: Set<str
|
|||
}
|
||||
|
||||
if (event.type === 'user.message') {
|
||||
pendingUserMessage = event.data.content ?? ''
|
||||
const userEvent = event as Extract<LegacyCopilotEvent, { type: 'user.message' }>
|
||||
pendingUserMessage = userEvent.data.content ?? ''
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -359,25 +360,30 @@ function getCopilotSessionStateDir(override?: string): string {
|
|||
return override ?? join(homedir(), '.copilot', 'session-state')
|
||||
}
|
||||
|
||||
function getVSCodeWorkspaceStorageDirs(): string[] {
|
||||
if (process.platform === 'darwin') {
|
||||
export function getVSCodeWorkspaceStorageDirs(homeDir = homedir(), platform = process.platform): string[] {
|
||||
const pathJoin = platform === 'win32' ? win32.join : posix.join
|
||||
|
||||
if (platform === 'darwin') {
|
||||
return [
|
||||
join(homedir(), 'Library', 'Application Support', 'Code', 'User', 'workspaceStorage'),
|
||||
join(homedir(), 'Library', 'Application Support', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'Code', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
]
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
if (platform === 'win32') {
|
||||
return [
|
||||
join(homedir(), 'AppData', 'Roaming', 'Code', 'User', 'workspaceStorage'),
|
||||
join(homedir(), 'AppData', 'Roaming', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
]
|
||||
}
|
||||
|
||||
return [
|
||||
join(homedir(), '.config', 'Code', 'User', 'workspaceStorage'),
|
||||
join(homedir(), '.config', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
join(homedir(), '.vscode-server', 'data', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, '.config', 'Code', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, '.config', 'Code - Insiders', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, '.config', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
pathJoin(homeDir, '.vscode-server', 'data', 'User', 'workspaceStorage'),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Provider, SessionSource, SessionParser } from './types.js'
|
|||
|
||||
const EXTENSION_ID = 'kilocode.kilo-code'
|
||||
|
||||
export function createKiloCodeProvider(overrideDir?: string): Provider {
|
||||
export function createKiloCodeProvider(overrideDir?: string | string[]): Provider {
|
||||
return {
|
||||
name: 'kilo-code',
|
||||
displayName: 'KiloCode',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Provider, SessionSource, SessionParser } from './types.js'
|
|||
|
||||
const EXTENSION_ID = 'rooveterinaryinc.roo-cline'
|
||||
|
||||
export function createRooCodeProvider(overrideDir?: string): Provider {
|
||||
export function createRooCodeProvider(overrideDir?: string | string[]): Provider {
|
||||
return {
|
||||
name: 'roo-code',
|
||||
displayName: 'Roo Code',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { readdir, readFile, stat } from 'fs/promises'
|
||||
import { basename, join } from 'path'
|
||||
import { basename, join, posix, win32 } from 'path'
|
||||
import { homedir } from 'os'
|
||||
|
||||
import { calculateCost } from '../models.js'
|
||||
|
|
@ -12,19 +12,41 @@ type UiMessage = {
|
|||
ts?: number
|
||||
}
|
||||
|
||||
export function getVSCodeGlobalStoragePath(extensionId: string): string {
|
||||
if (process.platform === 'darwin') {
|
||||
return join(homedir(), 'Library', 'Application Support', 'Code', 'User', 'globalStorage', extensionId)
|
||||
export function getVSCodeGlobalStoragePaths(extensionId: string, homeDir = homedir(), platform = process.platform): string[] {
|
||||
const pathJoin = platform === 'win32' ? win32.join : posix.join
|
||||
|
||||
if (platform === 'darwin') {
|
||||
return [
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'Code - Insiders', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, 'Library', 'Application Support', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
]
|
||||
}
|
||||
if (process.platform === 'win32') {
|
||||
return join(homedir(), 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', extensionId)
|
||||
|
||||
if (platform === 'win32') {
|
||||
return [
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'Code - Insiders', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, 'AppData', 'Roaming', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
]
|
||||
}
|
||||
return join(homedir(), '.config', 'Code', 'User', 'globalStorage', extensionId)
|
||||
|
||||
return [
|
||||
pathJoin(homeDir, '.config', 'Code', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, '.config', 'Code - Insiders', 'User', 'globalStorage', extensionId),
|
||||
pathJoin(homeDir, '.config', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
]
|
||||
}
|
||||
|
||||
export async function discoverClineTasks(extensionId: string, providerName: string, displayName: string, overrideDir?: string): Promise<SessionSource[]> {
|
||||
const baseDir = overrideDir ?? getVSCodeGlobalStoragePath(extensionId)
|
||||
return discoverClineTasksInBaseDirs([baseDir], providerName, displayName)
|
||||
export function getVSCodeGlobalStoragePath(extensionId: string): string {
|
||||
return getVSCodeGlobalStoragePaths(extensionId)[0]!
|
||||
}
|
||||
|
||||
export async function discoverClineTasks(extensionId: string, providerName: string, displayName: string, overrideDir?: string | string[]): Promise<SessionSource[]> {
|
||||
const baseDirs = overrideDir
|
||||
? (Array.isArray(overrideDir) ? overrideDir : [overrideDir])
|
||||
: getVSCodeGlobalStoragePaths(extensionId)
|
||||
return discoverClineTasksInBaseDirs(baseDirs, providerName, displayName)
|
||||
}
|
||||
|
||||
export async function discoverClineTasksInBaseDirs(baseDirs: string[], providerName: string, displayName: string): Promise<SessionSource[]> {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
||||
import { mkdtemp, mkdir, writeFile, rm } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import { join, posix, win32 } from 'path'
|
||||
import { tmpdir } from 'os'
|
||||
|
||||
import { copilot, createCopilotProvider } from '../../src/providers/copilot.js'
|
||||
import { copilot, createCopilotProvider, getVSCodeWorkspaceStorageDirs } from '../../src/providers/copilot.js'
|
||||
import type { ParsedProviderCall } from '../../src/providers/types.js'
|
||||
|
||||
let tmpDir: string
|
||||
|
|
@ -433,6 +433,18 @@ describe('copilot provider - discoverSessions', () => {
|
|||
expect(sessions[0]!.project).toBe('myapp')
|
||||
expect(sessions[0]!.path).toContain('session-1.jsonl')
|
||||
})
|
||||
|
||||
it('includes VSCodium workspaceStorage paths on all supported platforms', () => {
|
||||
expect(getVSCodeWorkspaceStorageDirs('/Users/test', 'darwin')).toContain(
|
||||
posix.join('/Users/test', 'Library', 'Application Support', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
)
|
||||
expect(getVSCodeWorkspaceStorageDirs('C:\\Users\\test', 'win32')).toContain(
|
||||
win32.join('C:\\Users\\test', 'AppData', 'Roaming', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
)
|
||||
expect(getVSCodeWorkspaceStorageDirs('/home/test', 'linux')).toContain(
|
||||
posix.join('/home/test', '.config', 'VSCodium', 'User', 'workspaceStorage'),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('copilot provider - metadata', () => {
|
||||
|
|
|
|||
58
tests/providers/vscode-cline-parser.test.ts
Normal file
58
tests/providers/vscode-cline-parser.test.ts
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
||||
import { mkdtemp, mkdir, writeFile, rm } from 'fs/promises'
|
||||
import { join, posix, win32 } from 'path'
|
||||
import { tmpdir } from 'os'
|
||||
|
||||
import { discoverClineTasks, getVSCodeGlobalStoragePaths } from '../../src/providers/vscode-cline-parser.js'
|
||||
|
||||
let tmpDir: string
|
||||
|
||||
beforeEach(async () => {
|
||||
tmpDir = await mkdtemp(join(tmpdir(), 'vscode-cline-parser-test-'))
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
await rm(tmpDir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
async function writeTask(baseDir: string, taskId: string): Promise<void> {
|
||||
const taskDir = join(baseDir, 'tasks', taskId)
|
||||
await mkdir(taskDir, { recursive: true })
|
||||
await writeFile(join(taskDir, 'ui_messages.json'), '[]')
|
||||
}
|
||||
|
||||
describe('VS Code Cline-family storage discovery', () => {
|
||||
it('includes VSCodium globalStorage paths on all supported platforms', () => {
|
||||
const extensionId = 'example.extension'
|
||||
|
||||
expect(getVSCodeGlobalStoragePaths(extensionId, '/Users/test', 'darwin')).toContain(
|
||||
posix.join('/Users/test', 'Library', 'Application Support', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
)
|
||||
expect(getVSCodeGlobalStoragePaths(extensionId, 'C:\\Users\\test', 'win32')).toContain(
|
||||
win32.join('C:\\Users\\test', 'AppData', 'Roaming', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
)
|
||||
expect(getVSCodeGlobalStoragePaths(extensionId, '/home/test', 'linux')).toContain(
|
||||
posix.join('/home/test', '.config', 'VSCodium', 'User', 'globalStorage', extensionId),
|
||||
)
|
||||
})
|
||||
|
||||
it('discovers tasks across multiple VS Code-compatible storage roots', async () => {
|
||||
const codeRoot = join(tmpDir, 'Code', 'User', 'globalStorage', 'example.extension')
|
||||
const codiumRoot = join(tmpDir, 'VSCodium', 'User', 'globalStorage', 'example.extension')
|
||||
await writeTask(codeRoot, 'task-code')
|
||||
await writeTask(codiumRoot, 'task-codium')
|
||||
|
||||
const sessions = await discoverClineTasks(
|
||||
'example.extension',
|
||||
'example-provider',
|
||||
'Example Provider',
|
||||
[codeRoot, codiumRoot],
|
||||
)
|
||||
|
||||
expect(sessions).toHaveLength(2)
|
||||
expect(sessions.map(s => s.path).sort()).toEqual([
|
||||
join(codeRoot, 'tasks', 'task-code'),
|
||||
join(codiumRoot, 'tasks', 'task-codium'),
|
||||
].sort())
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue