pi-provider-kimi-code 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -2
- package/package.json +1 -1
- package/src/constants.ts +7 -2
- package/src/device.ts +2 -2
package/index.ts
CHANGED
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
saveProjectKimiCodeConfig,
|
|
42
42
|
type KimiToolName,
|
|
43
43
|
} from "./src/config.ts";
|
|
44
|
-
import {
|
|
44
|
+
import { PROVIDER_ID, PROVIDER_VERSION, getBaseUrl, getKimiApiType } from "./src/constants.ts";
|
|
45
45
|
import { getCommonHeaders } from "./src/device.ts";
|
|
46
46
|
import {
|
|
47
47
|
type KimiOAuthCredentials,
|
|
@@ -463,7 +463,7 @@ function buildKimiMainTitle(config: KimiCodeConfig, cwd: string, extras: KimiOAu
|
|
|
463
463
|
const sources = loadKimiCodeConfigSources({ cwd, home: os.homedir() });
|
|
464
464
|
const modelName = extras.modelDisplay || "kimi-for-coding";
|
|
465
465
|
return [
|
|
466
|
-
`Kimi settings (provider v${
|
|
466
|
+
`Kimi settings (provider v${PROVIDER_VERSION})`,
|
|
467
467
|
"",
|
|
468
468
|
`Model: ${modelName}`,
|
|
469
469
|
`Protocol: ${config.protocol} (${sources.protocol})`,
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -41,8 +41,13 @@ export function getDefaultBaseUrl(protocol: KimiWireProtocol): string {
|
|
|
41
41
|
|
|
42
42
|
export const DEFAULT_BASE_URL = getDefaultBaseUrl(ENV_KIMI_CODE_PROTOCOL);
|
|
43
43
|
|
|
44
|
-
export const
|
|
45
|
-
|
|
44
|
+
export const PROVIDER_VERSION = "0.6.2";
|
|
45
|
+
|
|
46
|
+
// Upstream kimi-code CLI version — used in User-Agent and X-Msh-Version
|
|
47
|
+
// headers to match the official client's identity. Update this when
|
|
48
|
+
// syncing with https://github.com/anthropics/kimi-code.
|
|
49
|
+
export const KIMI_UPSTREAM_VERSION = "0.18.0";
|
|
50
|
+
export const KIMI_CODE_USER_AGENT = `kimi-code-cli/${KIMI_UPSTREAM_VERSION}`;
|
|
46
51
|
export const KIMI_PLATFORM = "kimi_code_cli";
|
|
47
52
|
|
|
48
53
|
export function getKimiCodeHome(): string {
|
package/src/device.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { dirname } from "node:path";
|
|
|
11
11
|
import {
|
|
12
12
|
DEVICE_ID_PATH,
|
|
13
13
|
KIMI_CODE_USER_AGENT,
|
|
14
|
-
|
|
14
|
+
KIMI_UPSTREAM_VERSION,
|
|
15
15
|
KIMI_PLATFORM,
|
|
16
16
|
} from "./constants.ts";
|
|
17
17
|
|
|
@@ -156,7 +156,7 @@ export function getCommonHeaders(): Record<string, string> {
|
|
|
156
156
|
const headers = {
|
|
157
157
|
"User-Agent": KIMI_CODE_USER_AGENT,
|
|
158
158
|
"X-Msh-Platform": KIMI_PLATFORM,
|
|
159
|
-
"X-Msh-Version":
|
|
159
|
+
"X-Msh-Version": KIMI_UPSTREAM_VERSION,
|
|
160
160
|
"X-Msh-Device-Name": os.hostname(),
|
|
161
161
|
"X-Msh-Device-Model": DEVICE_MODEL,
|
|
162
162
|
"X-Msh-Os-Version": getOsVersion(),
|