Files
openchamber/packages/vscode/webview/api/vscode.ts
T
Bohdan Triapitsyn 36793d00a4 fix: open external links in VS Code runtime
Route shared URL opening through VS Code host instead of webview window APIs
Add a VS Code runtime URL-open API and bridge handler using vscode.env.openExternal
Keep shared URL helper behavior unchanged for desktop and web
2026-03-20 19:22:43 +02:00

18 lines
584 B
TypeScript

import type { VSCodeAPI } from '@openchamber/ui/lib/api/types';
import { executeVSCodeCommand, openVSCodeExternalUrl } from './bridge';
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');
},
async openExternalUrl(url: string): Promise<void> {
await openVSCodeExternalUrl(url);
},
});