import * as vscode from "vscode"; import { fetchSdkSummary } from "./cline"; const CHANNEL_NAME = "Cowriting (Cline SDK)"; export function activate(context: vscode.ExtensionContext): void { const output = vscode.window.createOutputChannel(CHANNEL_NAME); context.subscriptions.push(output); const command = vscode.commands.registerCommand( "cowriting.showClineSdkInfo", async () => { try { const summary = await fetchSdkSummary(); output.clear(); output.appendLine(`@cline/sdk version: ${summary.version}`); output.appendLine(`Builtin tools (${summary.tools.length}):`); for (const tool of summary.tools) { output.appendLine(` • ${tool.id} — ${tool.description}`); } output.show(true); await vscode.window.showInformationMessage( `Cline SDK ${summary.version} loaded — ${summary.tools.length} builtin tools. See the "${CHANNEL_NAME}" output channel.` ); } catch (err) { const message = err instanceof Error ? err.message : String(err); output.appendLine(`Failed to drive @cline/sdk: ${message}`); output.show(true); await vscode.window.showErrorMessage( `Cowriting: failed to load @cline/sdk — ${message}` ); } } ); context.subscriptions.push(command); } export function deactivate(): void { // Nothing to clean up beyond the disposables registered on the context. }