Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ Adapter behavior:
- Token usage prefers `last_token_usage`; when only `total_token_usage` exists, the adapter diffs against the previous cumulative totals
- Models are carried forward from the latest `turn_context`; if none is available, the session still ingests but leaves `_model` unset

### Kimi CLI

Reads from `${KIMI_SHARE_DIR:-~/.kimi}`:
- `kimi.json` — maps working directories to session hashes via `work_dirs[].path`
- `config.toml` — optional `default_model` fallback for assistant messages
- `sessions/<md5(cwd)>/<session-id>/context*.jsonl` — authoritative transcript chunks
- `sessions/<md5(cwd)>/<session-id>/wire.jsonl` — timestamps and per-assistant token usage

Adapter behavior:
- Session folders are discovered by enumerating `sessions/*/*`
- Project folders are resolved by MD5 hashing each `kimi.json` work-dir path and matching it to the session hash
- Transcript chunks include `context_sub_N.jsonl`, `context_N.jsonl`, and `context.jsonl`, ordered oldest-to-newest with archived chunks first
- `_checkpoint` and `_usage` transcript records are skipped as visible messages
- Assistant `tool_calls` become visible `[tool-call: ...]` transcript lines and populate `_toolCalls` analytics
- Tool messages are condensed from text blocks in tool results and linked back to the originating tool name when possible
- Token usage comes from `wire.jsonl` `StatusUpdate` events and is only attached when the number of status updates matches the number of assistant turns
- Historical model attribution is approximate: when no session-level model is stored, assistant messages fall back to `config.toml` `default_model`

### VS Code / VS Code Insiders

Reads from `~/Library/Application Support/{Code,Code - Insiders}/User/`:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<p align="center">
<strong>Your Cursor, Windsurf, Claude Code sessions — analyzed, unified, tracked.</strong><br>
<sub>One command to turn scattered AI conversations from <b>14 editors</b> into a unified analytics dashboard.<br>Sessions, costs, models, tools — finally in one place. 100% local.</sub>
<sub>One command to turn scattered AI conversations from <b>15 editors</b> into a unified analytics dashboard.<br>Sessions, costs, models, tools — finally in one place. 100% local.</sub>
</p>

<p align="center">
<a href="https://www.npmjs.com/package/agentlytics"><img src="https://img.shields.io/npm/v/agentlytics?color=6366f1&label=npm" alt="npm"></a>
<a href="#supported-editors"><img src="https://img.shields.io/badge/editors-14-818cf8" alt="editors"></a>
<a href="#supported-editors"><img src="https://img.shields.io/badge/editors-15-818cf8" alt="editors"></a>
<a href="#license"><img src="https://img.shields.io/badge/license-MIT-green" alt="license"></a>
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A520.19%20%7C%20%E2%89%A522.12-brightgreen" alt="node"></a>
</p>
Expand Down Expand Up @@ -94,6 +94,7 @@ npx agentlytics --collect
| **OpenCode** | ✅ | ✅ | ✅ | ✅ |
| **Codex** | ✅ | ✅ | ✅ | ✅ |
| **Gemini CLI** | ✅ | ✅ | ✅ | ✅ |
| **Kimi CLI** | ✅ | ✅ | ⚠️ | ✅ |
| **Copilot CLI** | ✅ | ✅ | ✅ | ✅ |
| **Cursor Agent** | ✅ | ❌ | ❌ | ❌ |
| **Command Code** | ✅ | ✅ | ❌ | ❌ |
Expand Down
43 changes: 41 additions & 2 deletions editors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,50 @@ const zed = require('./zed');
const opencode = require('./opencode');
const codex = require('./codex');
const gemini = require('./gemini');
const kimi = require('./kimi');
const copilot = require('./copilot');
const cursorAgent = require('./cursor-agent');
const commandcode = require('./commandcode');

const editors = [cursor, windsurf, claude, vscode, zed, opencode, codex, gemini, copilot, cursorAgent, commandcode];
const EDITOR_COLORS = {
'cursor': '#f59e0b',
'windsurf': '#06b6d4',
'windsurf-next': '#22d3ee',
'antigravity': '#a78bfa',
'claude-code': '#f97316',
'claude': '#f97316',
'vscode': '#3b82f6',
'vscode-insiders': '#60a5fa',
'zed': '#10b981',
'opencode': '#ec4899',
'codex': '#0f766e',
'gemini-cli': '#4285f4',
'kimi-cli': '#84cc16',
'copilot-cli': '#8957e5',
'cursor-agent': '#f59e0b',
'commandcode': '#e11d48',
};

const EDITOR_LABELS = {
'cursor': 'Cursor',
'windsurf': 'Windsurf',
'windsurf-next': 'Windsurf Next',
'antigravity': 'Antigravity',
'claude-code': 'Claude Code',
'claude': 'Claude Code',
'vscode': 'VS Code',
'vscode-insiders': 'VS Code Insiders',
'zed': 'Zed',
'opencode': 'OpenCode',
'codex': 'Codex',
'gemini-cli': 'Gemini CLI',
'kimi-cli': 'Kimi CLI',
'copilot-cli': 'Copilot CLI',
'cursor-agent': 'Cursor Agent',
'commandcode': 'Command Code',
};

const editors = [cursor, windsurf, claude, vscode, zed, opencode, codex, gemini, kimi, copilot, cursorAgent, commandcode];

/**
* Get all chats from all editor adapters, sorted by most recent first.
Expand Down Expand Up @@ -52,4 +91,4 @@ function resetCaches() {
}
}

module.exports = { getAllChats, getMessages, editors, resetCaches };
module.exports = { getAllChats, getMessages, editors, resetCaches, EDITOR_LABELS, EDITOR_COLORS };
Loading