diff --git a/README.md b/README.md index c793185..d66275c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/vscode-extension/src/pluginCheck.ts b/vscode-extension/src/pluginCheck.ts index d82894f..afb6fb2 100644 --- a/vscode-extension/src/pluginCheck.ts +++ b/vscode-extension/src/pluginCheck.ts @@ -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', @@ -37,8 +39,40 @@ async function installPluginTo(dir: string): Promise { fs.writeFileSync(destPath, Buffer.from(await response.arrayBuffer())); } +async function findOpencode(): Promise { + try { + await new Promise((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 { if (context.globalState.get(SKIP_CHECK_KEY)) { return; } + + const opencodeAvailable = await findOpencode(); + if (!opencodeAvailable) { + if (context.globalState.get(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();