mirror of
https://github.com/cline/cline.git
synced 2026-09-24 23:20:16 +08:00
* fix: use vscode.env.openExternal for auth in remote environments Fixes #5109 The OAuth authentication flow was broken in VS Code Server and remote environments because the code used the npm 'open' package directly, which tries to launch a browser on the server itself (which has no display). This change routes browser URL opening through VS Code's native vscode.env.openExternal() API via the HostBridge pattern, which properly forwards URLs to the user's local machine in remote environments. Changes: - Added openExternal RPC to proto/host/env.proto - Created VS Code handler using vscode.env.openExternal() - Updated src/utils/env.ts to use HostProvider.env.openExternal() - Added openExternal to CLI CliEnvServiceClient (uses npm 'open') - Added openExternal to CLI ACPEnvServiceClient (uses npm 'open') Related issues: #5394, #2152, #7971 * chore: add changeset for vscode server auth fix * refactor: extract shared openUrlInBrowser utility for CLI
73 lines
2.7 KiB
Protocol Buffer
73 lines
2.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package host;
|
|
|
|
import "cline/common.proto";
|
|
|
|
option go_package = "github.com/cline/grpc-go/host";
|
|
option java_multiple_files = true;
|
|
option java_package = "bot.cline.host.proto";
|
|
|
|
// Provides methods for working with the user's environment.
|
|
service EnvService {
|
|
// Writes text to the system clipboard.
|
|
rpc clipboardWriteText(cline.StringRequest) returns (cline.Empty);
|
|
|
|
// Reads text from the system clipboard.
|
|
rpc clipboardReadText(cline.EmptyRequest) returns (cline.String);
|
|
|
|
// Returns the name and version of the host IDE or environment.
|
|
rpc getHostVersion(cline.EmptyRequest) returns (GetHostVersionResponse);
|
|
|
|
// Returns a URI that will redirect to the host environment.
|
|
// e.g. vscode://saoudrizwan.claude-dev, idea://, pycharm://, etc.
|
|
// If the host does not support URIs it should return empty.
|
|
rpc getIdeRedirectUri(cline.EmptyRequest) returns (cline.String);
|
|
|
|
// Returns the telemetry settings of the host environment. This may return UNSUPPORTED
|
|
// if the host does not specify telemetry settings for the plugin.
|
|
rpc getTelemetrySettings(cline.EmptyRequest) returns (GetTelemetrySettingsResponse);
|
|
|
|
// Returns events when the telemetry settings change.
|
|
rpc subscribeToTelemetrySettings(cline.EmptyRequest) returns (stream TelemetrySettingsEvent);
|
|
|
|
// Initiates a graceful shutdown of the host bridge service.
|
|
rpc shutdown(cline.EmptyRequest) returns (cline.Empty);
|
|
|
|
// Logs a debug message to the host environment's log/output console.
|
|
rpc debugLog(cline.StringRequest) returns (cline.Empty);
|
|
|
|
// Opens an external URL in the default browser.
|
|
// In remote environments (VS Code Server, SSH, etc.), this routes the URL
|
|
// to the user's local machine to open in their local browser.
|
|
rpc openExternal(cline.StringRequest) returns (cline.Empty);
|
|
}
|
|
|
|
message GetHostVersionResponse {
|
|
// The name of the host platform, e.g VSCode, IntelliJ Ultimate Edition, etc.
|
|
optional string platform = 1;
|
|
// The version of the host platform, e.g. 1.103.0 for VSCode, or 2025.1.1.1 for JetBrains IDEs.
|
|
optional string version = 2;
|
|
// The type of the cline host environment, e.g. 'VSCode Extension', 'Cline for JetBrains', 'CLI'
|
|
// This is different from the platform because there are many JetBrains IDEs, but they all use the same
|
|
// plugin.
|
|
optional string cline_type = 3;
|
|
// The version of the cline host environment, e.g. 33.2.10 for extension, or 1.0.6 for JetBrains.
|
|
optional string cline_version = 4;
|
|
}
|
|
|
|
enum Setting {
|
|
UNSUPPORTED = 0; // This host does not support this setting.
|
|
ENABLED = 1;
|
|
DISABLED = 2;
|
|
}
|
|
message GetTelemetrySettingsResponse {
|
|
Setting is_enabled = 1;
|
|
optional string error_level = 2;
|
|
}
|
|
|
|
message TelemetrySettingsEvent {
|
|
Setting is_enabled = 1;
|
|
optional string error_level = 2;
|
|
}
|