* Add ui.getWebviewHtml to the protobus This will return the HTML content for external clients. * Add getUri to ExternalWebviewProvider Change getUri to return URIs for files in an appropriate format for the external web view. Use URI from npm module in ExternalWebviewProvider. Use a default value for the cline dir, ~/.cline Turn off gRPC debugging * Include node modules used as assets in the standalone package. * Throw an error if trying to recreate webview panel in standalone app.
17 lines
657 B
TypeScript
17 lines
657 B
TypeScript
import type { Controller } from "../index"
|
|
import { EmptyRequest, Empty, String } from "@shared/proto/common"
|
|
import * as hostProviders from "@hosts/host-providers"
|
|
import { WebviewProviderType } from "@/shared/webview/types"
|
|
|
|
/**
|
|
* Initialize webview when it launches
|
|
* @param controller The controller instance
|
|
* @param request The empty request
|
|
* @returns Empty response
|
|
*/
|
|
export async function getWebviewHtml(_controller: Controller, _: EmptyRequest): Promise<String> {
|
|
const webviewProvider = hostProviders.createWebviewProvider(WebviewProviderType.SIDEBAR)
|
|
|
|
return Promise.resolve(String.create({ value: webviewProvider.getHtmlContent() }))
|
|
}
|