Skip to content
Merged
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
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ Tracybot is a tool that traces AI-generated code back to the prompts that create
- **Audit Trail** - Review AI interactions to verify, debug, or understand code origins
- **Team Sync** - Push traces to remote for team collaboration

## Architecture
## Supported Agents and Editors

Tracybot consists of three components that work together:
### Supported Agents
- **OpenCode CLI** — Install the [opencode-plugin](./opencode-plugin/README.md) to automatically record snapshots during AI interactions.
Requires OpenCode CLI to be installed - https://opencode.ai

- **[opencode-plugin](./opencode-plugin/README.md)** - Plugin for opencode CLI that records snapshots during AI interactions
- **[vscode-extension](./vscode-extension/README.md)** - VS Code extension to view AI blame information
- **[tracybot-tracking](./tracking/README.md)** - Git hooks and scripts for state tracking using hidden commits and synced git notes
### Supported Editors
- **VS Code** — Install the [vscode-extension](./vscode-extension/README.md) to view AI blame information.
Available on the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=TracyTeam.tracybot-extension).

More information, including the requirements that resulted in these architectural decisions, are on the [wiki](https://github.com/TracyTeam/tracybot/wiki/Architecture).

## Quick Start

Expand Down Expand Up @@ -71,6 +72,16 @@ You can install it either:

After OpenCode makes changes in an initialized repository, Tracybot records snapshots automatically. Click `AI Blame` in VS Code to inspect the prompt history behind the current file.

## Architecture

Tracybot consists of three components that work together:

- **[opencode-plugin](./opencode-plugin/README.md)** - Plugin for opencode CLI that records snapshots during AI interactions
- **[vscode-extension](./vscode-extension/README.md)** - VS Code extension to view AI blame information
- **[tracybot-tracking](./tracking/README.md)** - Git hooks and scripts for state tracking using hidden commits and synced git notes

More information, including the requirements that resulted in these architectural decisions, are on the [wiki](https://github.com/TracyTeam/tracybot/wiki/Architecture).

## Troubleshooting

### Common Issues
Expand Down
34 changes: 34 additions & 0 deletions vscode-extension/src/pluginCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import { homedir } from 'os';
import { spawn } from 'child_process';

const PLUGIN_FILENAME = 'tracybot-oc.js';
const PLUGIN_URL = 'https://github.com/TracyTeam/tracybot/releases/latest/download/tracybot-oc.js';
const SKIP_CHECK_KEY = 'tracybot.skipPluginCheck';
const SKIP_OPENCODE_MISSING_KEY = 'tracybot.skipOpencodeMissingCheck';

const Actions = {
InstallGlobally: 'Install Globally',
Expand Down Expand Up @@ -37,8 +39,40 @@ async function installPluginTo(dir: string): Promise<void> {
fs.writeFileSync(destPath, Buffer.from(await response.arrayBuffer()));
}

async function findOpencode(): Promise<boolean> {
try {
await new Promise<void>((resolve, reject) => {
const proc = spawn('opencode', ['--version'], { stdio: 'ignore' });
proc.on('close', code => (code === 0 ? resolve() : reject()));
proc.on('error', reject);
});
return true;
} catch {
return false;
}
}

export async function checkOpencode(context: vscode.ExtensionContext): Promise<void> {
if (context.globalState.get<boolean>(SKIP_CHECK_KEY)) { return; }

const opencodeAvailable = await findOpencode();
if (!opencodeAvailable) {
if (context.globalState.get<boolean>(SKIP_OPENCODE_MISSING_KEY)) { return; }

const action = await vscode.window.showInformationMessage(
'Tracybot AI change tracing requires a supported agent.',
'View Supported Agents',
'Don\'t Show Again'
);

if (action === 'View Supported Agents') {
vscode.env.openExternal(vscode.Uri.parse('https://github.com/TracyTeam/tracybot#supported-agents-and-editors'));
} else if (action === 'Don\'t Show Again') {
await context.globalState.update(SKIP_OPENCODE_MISSING_KEY, true);
}
return;
}

if (fs.existsSync(getGlobalPluginPath())) { return; }

const projectPath = getProjectPluginPath();
Expand Down
Loading