Attachment pickers now share an allowlist for supported file types Local attachments are normalized to consistent MIME types before upload VS Code file picker now respects extension filters and larger files are allowed
30 lines
969 B
TypeScript
30 lines
969 B
TypeScript
import type { VSCodeAPI } from '@openchamber/ui/lib/api/types';
|
|
import { executeVSCodeCommand, openVSCodeExternalUrl, sendBridgeMessage } 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);
|
|
},
|
|
|
|
async pickFiles(options): Promise<unknown> {
|
|
return sendBridgeMessage('api:files/pick', options);
|
|
},
|
|
|
|
async saveImage(payload: unknown): Promise<unknown> {
|
|
return sendBridgeMessage('api:files/save-image', payload);
|
|
},
|
|
|
|
async saveMarkdown(payload: unknown): Promise<unknown> {
|
|
return sendBridgeMessage('api:files/save-markdown', payload);
|
|
},
|
|
});
|