mirror of
https://github.com/cline/cline.git
synced 2026-10-29 17:42:34 +08:00
Move use of vscode.version to the host bridge (#5635)
This commit is contained in:
@@ -16,4 +16,13 @@ service EnvService {
|
||||
|
||||
// Returns a stable machine identifier for telemetry distinctId purposes.
|
||||
rpc getMachineId(cline.EmptyRequest) returns (cline.String);
|
||||
|
||||
rpc getHostVersion(cline.EmptyRequest) returns (GetHostVersionResponse);
|
||||
}
|
||||
|
||||
message GetHostVersionResponse {
|
||||
// The name of the host platform, e.g VSCode
|
||||
optional string platform = 1;
|
||||
// The version of the host platform, e.g. 1.103.0
|
||||
optional string version = 2;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ import { AutoApprove } from "./tools/autoApprove"
|
||||
import { showNotificationForApprovalIfAutoApprovalEnabled } from "./utils"
|
||||
import { Mode } from "@shared/storage/types"
|
||||
import { continuationPrompt } from "../prompts/contextManagement"
|
||||
import { HostProvider } from "@/hosts/host-provider"
|
||||
|
||||
export class ToolExecutor {
|
||||
private autoApprover: AutoApprove
|
||||
@@ -1897,7 +1898,8 @@ export class ToolExecutor {
|
||||
const operatingSystem = os.platform() + " " + os.release()
|
||||
const clineVersion =
|
||||
vscode.extensions.getExtension("saoudrizwan.claude-dev")?.packageJSON.version || "Unknown"
|
||||
const systemInfo = `VSCode: ${vscode.version}, Node.js: ${process.version}, Architecture: ${os.arch()}`
|
||||
const host = await HostProvider.env.getHostVersion({})
|
||||
const systemInfo = `${host.platform}: ${host.version}, Node.js: ${process.version}, Architecture: ${os.arch()}`
|
||||
const currentMode = this.mode
|
||||
const apiConfig = this.cacheService.getApiConfiguration()
|
||||
const apiProvider = currentMode === "plan" ? apiConfig.planModeApiProvider : apiConfig.actModeApiProvider
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { GetHostVersionResponse } from "@/shared/proto/index.host"
|
||||
import { EmptyRequest, String } from "@shared/proto/cline/common"
|
||||
import * as vscode from "vscode"
|
||||
|
||||
export async function getHostVersion(_: EmptyRequest): Promise<GetHostVersionResponse> {
|
||||
return { platform: "VSCode", version: vscode.version }
|
||||
}
|
||||
Reference in New Issue
Block a user