diff --git a/.changeset/add-glm-4-7-model.md b/.changeset/add-glm-4-7-model.md new file mode 100644 index 00000000000..1682d6b1fd1 --- /dev/null +++ b/.changeset/add-glm-4-7-model.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +Add GLM-4.7 model support to Z.ai provider diff --git a/cli/package.json b/cli/package.json index 236fe721a26..5b83f83afd8 100644 --- a/cli/package.json +++ b/cli/package.json @@ -94,6 +94,7 @@ "monaco-vscode-textmate-theme-converter": "^0.1.7", "node-cache": "^5.1.2", "node-ipc": "npm:catrielmuller-node-ipc@12.0.1", + "node-machine-id": "^1.1.12", "ollama": "^0.5.17", "openai": "^5.12.2", "os-name": "^6.0.0", diff --git a/cli/src/host/VSCode.ts b/cli/src/host/VSCode.ts index 5f0bd8f7a9e..34e07590e42 100644 --- a/cli/src/host/VSCode.ts +++ b/cli/src/host/VSCode.ts @@ -3,6 +3,7 @@ import * as path from "path" import { logs } from "../services/logs.js" import { KiloCodePaths } from "../utils/paths.js" import { Package } from "../constants/package.js" +import { machineIdSync } from "node-machine-id" // Identity information for VSCode environment export interface IdentityInfo { @@ -2321,7 +2322,7 @@ export function createVSCodeAPIMock(extensionRootPath: string, workspacePath: st appName: `wrapper|cli|cli|${Package.version}`, appRoot: import.meta.dirname, language: "en", - machineId: identity?.machineId || "cli-machine-id", + machineId: identity?.machineId || machineIdSync(), sessionId: identity?.sessionId || "cli-session-id", remoteName: undefined, shell: process.env.SHELL || "/bin/bash", diff --git a/cli/src/services/telemetry/identity.ts b/cli/src/services/telemetry/identity.ts index 148f607e928..e7f41228d87 100644 --- a/cli/src/services/telemetry/identity.ts +++ b/cli/src/services/telemetry/identity.ts @@ -6,10 +6,10 @@ import * as fs from "fs-extra" import * as path from "path" import * as crypto from "crypto" -import * as os from "os" import { KiloCodePaths } from "../../utils/paths.js" import { logs } from "../logs.js" import { getAppUrl } from "@roo-code/types" +import { machineIdSync } from "node-machine-id" /** * User identity structure @@ -219,14 +219,7 @@ export class IdentityManager { */ private getMachineId(): string { try { - // Use hostname + platform + architecture as machine identifier - const hostname = os.hostname() - const platform = os.platform() - const arch = os.arch() - const combined = `${hostname}-${platform}-${arch}` - - // Hash the combined string for privacy - return crypto.createHash("sha256").update(combined).digest("hex").substring(0, 16) + return machineIdSync() } catch (error) { logs.warn("Failed to get machine ID", "IdentityManager", { error }) return "unknown" diff --git a/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostManager.kt b/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostManager.kt index 2dd5054419a..bc0fc99dc52 100644 --- a/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostManager.kt +++ b/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostManager.kt @@ -9,6 +9,7 @@ import ai.kilocode.jetbrains.editor.EditorAndDocManager import ai.kilocode.jetbrains.ipc.NodeSocket import ai.kilocode.jetbrains.ipc.PersistentProtocol import ai.kilocode.jetbrains.ipc.proxy.ResponsiveState +import ai.kilocode.jetbrains.util.MachineIdUtil import ai.kilocode.jetbrains.util.PluginConstants import ai.kilocode.jetbrains.util.PluginResourceUtil import ai.kilocode.jetbrains.util.URI @@ -269,7 +270,7 @@ class ExtensionHostManager : Disposable { ), "telemetryInfo" to mapOf( "sessionId" to "intellij-session", - "machineId" to "intellij-machine", + "machineId" to MachineIdUtil.getMachineId(), "sqmId" to "", "devDeviceId" to "", "firstSessionDate" to java.time.Instant.now().toString(), diff --git a/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/util/MachineIdUtil.kt b/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/util/MachineIdUtil.kt new file mode 100644 index 00000000000..11bd59959cb --- /dev/null +++ b/jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/util/MachineIdUtil.kt @@ -0,0 +1,193 @@ +package ai.kilocode.jetbrains.util + +import com.intellij.openapi.diagnostic.Logger +import java.io.File +import java.security.MessageDigest + +/** + * Utility class for generating a unique machine identifier. + * This implementation mirrors the behavior of the node-machine-id npm package + * to ensure consistency across CLI and JetBrains plugin. + * + * The machine ID is generated from platform-specific sources: + * - Windows: MachineGuid from the Windows registry + * - macOS: IOPlatformUUID from IOKit + * - Linux: /var/lib/dbus/machine-id or /etc/machine-id + * + * The raw ID is hashed using SHA-256 to match the format produced by node-machine-id. + */ +object MachineIdUtil { + private val LOG = Logger.getInstance(MachineIdUtil::class.java) + private var cachedMachineId: String? = null + + /** + * Get the machine ID, generating it if not already cached. + * Returns a SHA-256 hash of the platform-specific machine identifier. + */ + fun getMachineId(): String { + cachedMachineId?.let { return it } + + val rawId = getRawMachineId() + val hashedId = hashMachineId(rawId) + cachedMachineId = hashedId + LOG.info("Generated machine ID: ${hashedId.take(8)}...") + return hashedId + } + + /** + * Get the raw (unhashed) machine ID for the current platform. + */ + private fun getRawMachineId(): String { + return when { + isWindows() -> getWindowsMachineId() + isMacOS() -> getMacOSMachineId() + isLinux() -> getLinuxMachineId() + else -> getFallbackMachineId() + } + } + + private fun isWindows(): Boolean = + System.getProperty("os.name").lowercase().contains("windows") + + private fun isMacOS(): Boolean = + System.getProperty("os.name").lowercase().contains("mac") + + private fun isLinux(): Boolean = + System.getProperty("os.name").lowercase().contains("linux") + + /** + * Get machine ID on Windows by reading the MachineGuid from the registry. + */ + private fun getWindowsMachineId(): String { + return try { + val process = ProcessBuilder( + "reg", "query", + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography", + "/v", "MachineGuid" + ).start() + + val output = process.inputStream.bufferedReader().readText() + val exitCode = process.waitFor() + + if (exitCode != 0) { + LOG.warn("Registry query failed with exit code: $exitCode") + return getFallbackMachineId() + } + + // Parse the registry output to extract the GUID + // Output format: " MachineGuid REG_SZ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + val regex = Regex("MachineGuid\\s+REG_SZ\\s+([\\w-]+)") + val match = regex.find(output) + + if (match != null) { + match.groupValues[1] + } else { + LOG.warn("Could not parse MachineGuid from registry output") + getFallbackMachineId() + } + } catch (e: Exception) { + LOG.warn("Failed to get Windows machine ID", e) + getFallbackMachineId() + } + } + + /** + * Get machine ID on macOS by reading the IOPlatformUUID from IOKit. + */ + private fun getMacOSMachineId(): String { + return try { + val process = ProcessBuilder( + "ioreg", "-rd1", "-c", "IOPlatformExpertDevice" + ).start() + + val output = process.inputStream.bufferedReader().readText() + val exitCode = process.waitFor() + + if (exitCode != 0) { + LOG.warn("ioreg command failed with exit code: $exitCode") + return getFallbackMachineId() + } + + // Parse the output to extract IOPlatformUUID + // Output format: "IOPlatformUUID" = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + val regex = Regex("\"IOPlatformUUID\"\\s*=\\s*\"([^\"]+)\"") + val match = regex.find(output) + + if (match != null) { + match.groupValues[1] + } else { + LOG.warn("Could not parse IOPlatformUUID from ioreg output") + getFallbackMachineId() + } + } catch (e: Exception) { + LOG.warn("Failed to get macOS machine ID", e) + getFallbackMachineId() + } + } + + /** + * Get machine ID on Linux by reading from standard machine-id files. + */ + private fun getLinuxMachineId(): String { + return try { + // Try /var/lib/dbus/machine-id first (D-Bus machine ID) + val dbusFile = File("/var/lib/dbus/machine-id") + if (dbusFile.exists() && dbusFile.canRead()) { + val id = dbusFile.readText().trim() + if (id.isNotEmpty()) { + return id + } + } + + // Fall back to /etc/machine-id (systemd machine ID) + val etcFile = File("/etc/machine-id") + if (etcFile.exists() && etcFile.canRead()) { + val id = etcFile.readText().trim() + if (id.isNotEmpty()) { + return id + } + } + + LOG.warn("No machine-id file found on Linux") + getFallbackMachineId() + } catch (e: Exception) { + LOG.warn("Failed to get Linux machine ID", e) + getFallbackMachineId() + } + } + + /** + * Generate a fallback machine ID based on available system properties. + * This is used when platform-specific methods fail. + */ + private fun getFallbackMachineId(): String { + // Generate a fallback based on available system properties + val props = listOf( + System.getProperty("user.name", "unknown"), + System.getProperty("os.name", "unknown"), + System.getProperty("os.arch", "unknown"), + System.getProperty("user.home", "unknown"), + System.getProperty("java.home", "unknown") + ).joinToString("-") + + LOG.info("Using fallback machine ID generation") + return props + } + + /** + * Hash the raw machine ID using SHA-256. + * This matches the format produced by node-machine-id. + */ + private fun hashMachineId(rawId: String): String { + val digest = MessageDigest.getInstance("SHA-256") + val hashBytes = digest.digest(rawId.toByteArray(Charsets.UTF_8)) + return hashBytes.joinToString("") { "%02x".format(it) } + } + + /** + * Clear the cached machine ID (useful for testing). + */ + internal fun clearCache() { + cachedMachineId = null + } +} diff --git a/jetbrains/plugin/src/test/kotlin/ai/kilocode/jetbrains/util/MachineIdUtilTest.kt b/jetbrains/plugin/src/test/kotlin/ai/kilocode/jetbrains/util/MachineIdUtilTest.kt new file mode 100644 index 00000000000..f28b88fbef5 --- /dev/null +++ b/jetbrains/plugin/src/test/kotlin/ai/kilocode/jetbrains/util/MachineIdUtilTest.kt @@ -0,0 +1,94 @@ +package ai.kilocode.jetbrains.util + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test + +class MachineIdUtilTest { + + @Before + fun setUp() { + // Clear the cache before each test to ensure fresh generation + MachineIdUtil.clearCache() + } + + @Test + fun `test getMachineId returns non-null value`() { + val machineId = MachineIdUtil.getMachineId() + assertNotNull("Machine ID should not be null", machineId) + } + + @Test + fun `test getMachineId returns non-empty value`() { + val machineId = MachineIdUtil.getMachineId() + assertTrue("Machine ID should not be empty", machineId.isNotEmpty()) + } + + @Test + fun `test getMachineId returns SHA-256 hash format`() { + val machineId = MachineIdUtil.getMachineId() + // SHA-256 produces a 64-character hex string + assertEquals("Machine ID should be 64 characters (SHA-256 hex)", 64, machineId.length) + // Should only contain hex characters + assertTrue( + "Machine ID should only contain hex characters", + machineId.all { it in '0'..'9' || it in 'a'..'f' } + ) + } + + @Test + fun `test getMachineId returns consistent value`() { + val machineId1 = MachineIdUtil.getMachineId() + val machineId2 = MachineIdUtil.getMachineId() + assertEquals("Machine ID should be consistent across calls", machineId1, machineId2) + } + + @Test + fun `test getMachineId caching works`() { + // First call generates the ID + val machineId1 = MachineIdUtil.getMachineId() + + // Second call should return cached value + val machineId2 = MachineIdUtil.getMachineId() + + assertEquals("Cached machine ID should match original", machineId1, machineId2) + } + + @Test + fun `test clearCache allows regeneration`() { + // Get initial machine ID + val machineId1 = MachineIdUtil.getMachineId() + + // Clear cache + MachineIdUtil.clearCache() + + // Get machine ID again - should regenerate (but will be same value since same machine) + val machineId2 = MachineIdUtil.getMachineId() + + // On the same machine, the regenerated ID should be the same + assertEquals("Regenerated machine ID should match on same machine", machineId1, machineId2) + } + + @Test + fun `test getMachineId does not contain intellij-machine placeholder`() { + val machineId = MachineIdUtil.getMachineId() + assertNotEquals( + "Machine ID should not be the old placeholder value", + "intellij-machine", + machineId + ) + } + + @Test + fun `test getMachineId is lowercase hex`() { + val machineId = MachineIdUtil.getMachineId() + assertEquals( + "Machine ID should be lowercase", + machineId.lowercase(), + machineId + ) + } +} diff --git a/packages/cloud/src/bridge/__tests__/ExtensionChannel.test.ts b/packages/cloud/src/bridge/__tests__/ExtensionChannel.test.ts index 0f539d0942b..04e15488088 100644 --- a/packages/cloud/src/bridge/__tests__/ExtensionChannel.test.ts +++ b/packages/cloud/src/bridge/__tests__/ExtensionChannel.test.ts @@ -32,6 +32,7 @@ describe("ExtensionChannel", () => { wrapperTitle: null, wrapperCode: null, wrapperVersion: null, + machineId: null, // kilocode_change end hostname: "test-host", } diff --git a/packages/cloud/src/bridge/__tests__/TaskChannel.test.ts b/packages/cloud/src/bridge/__tests__/TaskChannel.test.ts index fb83f5365fd..6119b4fe028 100644 --- a/packages/cloud/src/bridge/__tests__/TaskChannel.test.ts +++ b/packages/cloud/src/bridge/__tests__/TaskChannel.test.ts @@ -35,6 +35,7 @@ describe("TaskChannel", () => { wrapperTitle: null, wrapperCode: null, wrapperVersion: null, + machineId: null, // kilocode_change end hostname: "test-host", } diff --git a/packages/types/src/providers/zai.ts b/packages/types/src/providers/zai.ts index 1d5d19261f3..6b4825cc3e9 100644 --- a/packages/types/src/providers/zai.ts +++ b/packages/types/src/providers/zai.ts @@ -5,11 +5,12 @@ import { ZaiApiLine } from "../provider-settings.js" // https://docs.z.ai/guides/llm/glm-4-32b-0414-128k // https://docs.z.ai/guides/llm/glm-4.5 // https://docs.z.ai/guides/llm/glm-4.6 +// https://docs.z.ai/guides/llm/glm-4.7 // https://docs.z.ai/guides/overview/pricing // https://bigmodel.cn/pricing export type InternationalZAiModelId = keyof typeof internationalZAiModels -export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.6" +export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.7" export const internationalZAiModels = { "glm-4.5": { maxTokens: 98_304, @@ -17,6 +18,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.6, outputPrice: 2.2, cacheWritesPrice: 0, @@ -30,6 +32,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.2, outputPrice: 1.1, cacheWritesPrice: 0, @@ -43,6 +46,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 2.2, outputPrice: 8.9, cacheWritesPrice: 0, @@ -56,6 +60,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 1.1, outputPrice: 4.5, cacheWritesPrice: 0, @@ -68,6 +73,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0, outputPrice: 0, cacheWritesPrice: 0, @@ -80,6 +86,7 @@ export const internationalZAiModels = { supportsImages: true, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.6, outputPrice: 1.8, cacheWritesPrice: 0, @@ -93,6 +100,7 @@ export const internationalZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.6, outputPrice: 2.2, cacheWritesPrice: 0, @@ -107,6 +115,7 @@ export const internationalZAiModels = { supportsImages: true, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.3, outputPrice: 0.9, cacheWritesPrice: 0, @@ -120,6 +129,7 @@ export const internationalZAiModels = { supportsImages: true, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0, outputPrice: 0, cacheWritesPrice: 0, @@ -128,12 +138,27 @@ export const internationalZAiModels = { "GLM-4.6V-Flash is a free, high-speed multimodal model with visual reasoning capabilities, excellent for reasoning, coding, and agentic tasks.", }, // kilocode_change end + "glm-4.7": { + maxTokens: 98_304, + contextWindow: 200_000, + supportsImages: false, + supportsPromptCache: true, + supportsNativeTools: true, + defaultToolProtocol: "native", + inputPrice: 0.6, + outputPrice: 2.2, + cacheWritesPrice: 0, + cacheReadsPrice: 0.11, + description: + "GLM-4.7 is Zhipu's latest model with enhanced capabilities for reasoning, coding, and agent tasks, building upon the GLM-4.6 foundation with improved performance.", + }, "glm-4-32b-0414-128k": { maxTokens: 98_304, contextWindow: 131_072, supportsImages: false, supportsPromptCache: false, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.1, outputPrice: 0.1, cacheWritesPrice: 0, @@ -143,7 +168,7 @@ export const internationalZAiModels = { } as const satisfies Record export type MainlandZAiModelId = keyof typeof mainlandZAiModels -export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.6" +export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.7" export const mainlandZAiModels = { "glm-4.5": { maxTokens: 98_304, @@ -151,6 +176,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.29, outputPrice: 1.14, cacheWritesPrice: 0, @@ -164,6 +190,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.1, outputPrice: 0.6, cacheWritesPrice: 0, @@ -177,6 +204,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.29, outputPrice: 1.14, cacheWritesPrice: 0, @@ -190,6 +218,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.1, outputPrice: 0.6, cacheWritesPrice: 0, @@ -202,6 +231,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0, outputPrice: 0, cacheWritesPrice: 0, @@ -214,6 +244,7 @@ export const mainlandZAiModels = { supportsImages: true, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.29, outputPrice: 0.93, cacheWritesPrice: 0, @@ -227,6 +258,7 @@ export const mainlandZAiModels = { supportsImages: false, supportsPromptCache: true, supportsNativeTools: true, + defaultToolProtocol: "native", inputPrice: 0.29, outputPrice: 1.14, cacheWritesPrice: 0, @@ -234,6 +266,20 @@ export const mainlandZAiModels = { description: "GLM-4.6 is Zhipu's newest model with an extended context window of up to 200k tokens, providing enhanced capabilities for processing longer documents and conversations.", }, + "glm-4.7": { + maxTokens: 98_304, + contextWindow: 204_800, + supportsImages: false, + supportsPromptCache: true, + supportsNativeTools: true, + defaultToolProtocol: "native", + inputPrice: 0.29, + outputPrice: 1.14, + cacheWritesPrice: 0, + cacheReadsPrice: 0.057, + description: + "GLM-4.7 is Zhipu's latest model with enhanced capabilities for reasoning, coding, and agent tasks, building upon the GLM-4.6 foundation with improved performance.", + }, } as const satisfies Record export const ZAI_DEFAULT_TEMPERATURE = 0.6 diff --git a/packages/types/src/telemetry.ts b/packages/types/src/telemetry.ts index b40e9789f05..c021a3d5ff2 100644 --- a/packages/types/src/telemetry.ts +++ b/packages/types/src/telemetry.ts @@ -126,11 +126,14 @@ export const staticAppPropertiesSchema = z.object({ vscodeVersion: z.string(), platform: z.string(), editorName: z.string(), - wrapped: z.boolean(), // kilocode_change - wrapper: z.string().nullable(), // kilocode_change - wrapperTitle: z.string().nullable(), // kilocode_change - wrapperCode: z.string().nullable(), // kilocode_change - wrapperVersion: z.string().nullable(), // kilocode_change + // kilocode_change start + wrapped: z.boolean(), + wrapper: z.string().nullable(), + wrapperTitle: z.string().nullable(), + wrapperCode: z.string().nullable(), + wrapperVersion: z.string().nullable(), + machineId: z.string().nullable(), + // kilocode_change end hostname: z.string().optional(), }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c724d31f1a0..0984ecd367b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -775,6 +775,9 @@ importers: node-ipc: specifier: npm:catrielmuller-node-ipc@12.0.1 version: catrielmuller-node-ipc@12.0.1 + node-machine-id: + specifier: ^1.1.12 + version: 1.1.12 ollama: specifier: ^0.5.17 version: 0.5.17 @@ -1823,6 +1826,9 @@ importers: node-ipc: specifier: ^12.0.0 version: 12.0.0 + node-machine-id: + specifier: ^1.1.12 + version: 1.1.12 ollama: specifier: ^0.5.17 version: 0.5.17 @@ -4973,6 +4979,7 @@ packages: '@lancedb/lancedb@0.21.3': resolution: {integrity: sha512-hfzp498BfcCJ730fV1YGGoXVxRgE+W1n0D0KwanKlbt8bBPSQ6E6Tf8mPXc8rKdAXIRR3o5mTzMG3z3Fda+m3Q==} engines: {node: '>= 18'} + cpu: [x64, arm64] os: [darwin, linux, win32] peerDependencies: apache-arrow: '>=15.0.0 <=18.1.0' @@ -15152,6 +15159,9 @@ packages: resolution: {integrity: sha512-QHJ2gAJiqA3cM7cQiRjLsfCOBRB0TwQ6axYD4FSllQWipEbP6i7Se1dP8EzPKk5J1nCe27W69eqPmCoKyQ61Vg==} engines: {node: '>=14'} + node-machine-id@1.1.12: + resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} + node-preload@0.2.1: resolution: {integrity: sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==} engines: {node: '>=8'} @@ -36487,6 +36497,8 @@ snapshots: js-queue: 2.0.2 strong-type: 1.1.0 + node-machine-id@1.1.12: {} + node-preload@0.2.1: dependencies: process-on-spawn: 1.1.0 diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 3640411b129..4a6e208d4bc 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -3285,12 +3285,15 @@ ${prompt} appVersion: packageJSON?.version ?? Package.version, vscodeVersion: vscode.version, platform: isWsl ? "wsl" /* kilocode_change */ : process.platform, - editorName: kiloCodeWrapperTitle ? kiloCodeWrapperTitle : vscode.env.appName, // kilocode_change - wrapped: kiloCodeWrapped, // kilocode_change - wrapper: kiloCodeWrapper, // kilocode_change - wrapperCode: kiloCodeWrapperCode, // kilocode_change - wrapperVersion: kiloCodeWrapperVersion, // kilocode_change - wrapperTitle: kiloCodeWrapperTitle, // kilocode_change + // kilocode_change start + editorName: kiloCodeWrapperTitle ? kiloCodeWrapperTitle : vscode.env.appName, + wrapped: kiloCodeWrapped, + wrapper: kiloCodeWrapper, + wrapperCode: kiloCodeWrapperCode, + wrapperVersion: kiloCodeWrapperVersion, + wrapperTitle: kiloCodeWrapperTitle, + machineId: vscode.env.machineId, + // kilocode_change end } } diff --git a/src/package.json b/src/package.json index 7e1bc3fd595..139f4463ab9 100644 --- a/src/package.json +++ b/src/package.json @@ -719,6 +719,7 @@ "monaco-vscode-textmate-theme-converter": "^0.1.7", "node-cache": "^5.1.2", "node-ipc": "^12.0.0", + "node-machine-id": "^1.1.12", "ollama": "^0.5.17", "openai": "^5.12.2", "os-name": "^6.0.0",