Files
openchamber/packages/vscode/webview/api/vscode.ts
T

18 lines
584 B
TypeScript
Raw Normal View History

2026-01-06 21:31:04 +02:00
import type { VSCodeAPI } from '@openchamber/ui/lib/api/types';
2026-03-20 19:22:43 +02:00
import { executeVSCodeCommand, openVSCodeExternalUrl } from './bridge';
2026-01-03 22:11:16 +01:00
export const createVSCodeActionsAPI = (): VSCodeAPI => ({
async executeCommand(command: string, ...args: unknown[]): Promise<unknown> {
const result = await executeVSCodeCommand(command, args);
return result.result;
},
async openAgentManager(): Promise<void> {
await executeVSCodeCommand('openchamber.openAgentManager');
},
2026-03-20 19:22:43 +02:00
async openExternalUrl(url: string): Promise<void> {
await openVSCodeExternalUrl(url);
},
2026-01-03 22:11:16 +01:00
});