Skip to content

Commit 28ea03f

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/fix-openrouter-provider-routing-save-button
2 parents dfeb752 + 1d714c8 commit 28ea03f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1756
-107
lines changed

packages/types/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.43.0",
3+
"version": "1.44.0",
44
"description": "TypeScript type definitions for Roo Code.",
55
"publishConfig": {
66
"access": "public",

packages/types/src/cloud.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface CloudUserInfo {
1717
organizationName?: string
1818
organizationRole?: string
1919
organizationImageUrl?: string
20+
extensionBridgeEnabled?: boolean
2021
}
2122

2223
/**

packages/types/src/experiment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
66
* ExperimentId
77
*/
88

9-
export const experimentIds = ["powerSteering", "multiFileApplyDiff", "preventFocusDisruption"] as const
9+
export const experimentIds = ["powerSteering", "multiFileApplyDiff", "preventFocusDisruption", "assistantMessageParser"] as const
1010

1111
export const experimentIdsSchema = z.enum(experimentIds)
1212

@@ -20,6 +20,7 @@ export const experimentsSchema = z.object({
2020
powerSteering: z.boolean().optional(),
2121
multiFileApplyDiff: z.boolean().optional(),
2222
preventFocusDisruption: z.boolean().optional(),
23+
assistantMessageParser: z.boolean().optional(),
2324
})
2425

2526
export type Experiments = z.infer<typeof experimentsSchema>

packages/types/src/global-settings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export const globalSettingsSchema = z.object({
134134
mcpEnabled: z.boolean().optional(),
135135
enableMcpServerCreation: z.boolean().optional(),
136136

137+
remoteControlEnabled: z.boolean().optional(),
138+
137139
mode: z.string().optional(),
138140
modeApiConfigs: z.record(z.string(), z.string()).optional(),
139141
customModes: z.array(modeConfigSchema).optional(),
@@ -288,6 +290,8 @@ export const EVALS_SETTINGS: RooCodeSettings = {
288290

289291
mcpEnabled: false,
290292

293+
remoteControlEnabled: false,
294+
291295
mode: "code", // "architect",
292296

293297
customModes: [],

packages/types/src/provider-settings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const providerNames = [
3636
"huggingface",
3737
"cerebras",
3838
"sambanova",
39+
"zai",
3940
] as const
4041

4142
export const providerNamesSchema = z.enum(providerNames)
@@ -257,6 +258,11 @@ const sambaNovaSchema = apiModelIdProviderModelSchema.extend({
257258
sambaNovaApiKey: z.string().optional(),
258259
})
259260

261+
const zaiSchema = apiModelIdProviderModelSchema.extend({
262+
zaiApiKey: z.string().optional(),
263+
zaiApiLine: z.union([z.literal("china"), z.literal("international")]).optional(),
264+
})
265+
260266
const defaultSchema = z.object({
261267
apiProvider: z.undefined(),
262268
})
@@ -290,6 +296,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
290296
litellmSchema.merge(z.object({ apiProvider: z.literal("litellm") })),
291297
cerebrasSchema.merge(z.object({ apiProvider: z.literal("cerebras") })),
292298
sambaNovaSchema.merge(z.object({ apiProvider: z.literal("sambanova") })),
299+
zaiSchema.merge(z.object({ apiProvider: z.literal("zai") })),
293300
defaultSchema,
294301
])
295302

@@ -323,6 +330,7 @@ export const providerSettingsSchema = z.object({
323330
...litellmSchema.shape,
324331
...cerebrasSchema.shape,
325332
...sambaNovaSchema.shape,
333+
...zaiSchema.shape,
326334
...codebaseIndexProviderSchema.shape,
327335
})
328336

packages/types/src/providers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ export * from "./vertex.js"
2222
export * from "./vscode-llm.js"
2323
export * from "./xai.js"
2424
export * from "./doubao.js"
25+
export * from "./zai.js"
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import type { ModelInfo } from "../model.js"
2+
3+
// Z AI
4+
// https://docs.z.ai/guides/llm/glm-4.5
5+
// https://docs.z.ai/guides/overview/pricing
6+
7+
export type InternationalZAiModelId = keyof typeof internationalZAiModels
8+
export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.5"
9+
export const internationalZAiModels = {
10+
"glm-4.5": {
11+
maxTokens: 98_304,
12+
contextWindow: 131_072,
13+
supportsImages: false,
14+
supportsPromptCache: true,
15+
inputPrice: 0.6,
16+
outputPrice: 2.2,
17+
cacheWritesPrice: 0,
18+
cacheReadsPrice: 0.11,
19+
description:
20+
"GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.",
21+
},
22+
"glm-4.5-air": {
23+
maxTokens: 98_304,
24+
contextWindow: 131_072,
25+
supportsImages: false,
26+
supportsPromptCache: true,
27+
inputPrice: 0.2,
28+
outputPrice: 1.1,
29+
cacheWritesPrice: 0,
30+
cacheReadsPrice: 0.03,
31+
description:
32+
"GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
33+
},
34+
} as const satisfies Record<string, ModelInfo>
35+
36+
export type MainlandZAiModelId = keyof typeof mainlandZAiModels
37+
export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.5"
38+
export const mainlandZAiModels = {
39+
"glm-4.5": {
40+
maxTokens: 98_304,
41+
contextWindow: 131_072,
42+
supportsImages: false,
43+
supportsPromptCache: true,
44+
inputPrice: 0.29,
45+
outputPrice: 1.14,
46+
cacheWritesPrice: 0,
47+
cacheReadsPrice: 0.057,
48+
description:
49+
"GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.",
50+
tiers: [
51+
{
52+
contextWindow: 32_000,
53+
inputPrice: 0.21,
54+
outputPrice: 1.0,
55+
cacheReadsPrice: 0.043,
56+
},
57+
{
58+
contextWindow: 128_000,
59+
inputPrice: 0.29,
60+
outputPrice: 1.14,
61+
cacheReadsPrice: 0.057,
62+
},
63+
{
64+
contextWindow: Infinity,
65+
inputPrice: 0.29,
66+
outputPrice: 1.14,
67+
cacheReadsPrice: 0.057,
68+
},
69+
],
70+
},
71+
"glm-4.5-air": {
72+
maxTokens: 98_304,
73+
contextWindow: 131_072,
74+
supportsImages: false,
75+
supportsPromptCache: true,
76+
inputPrice: 0.1,
77+
outputPrice: 0.6,
78+
cacheWritesPrice: 0,
79+
cacheReadsPrice: 0.02,
80+
description:
81+
"GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
82+
tiers: [
83+
{
84+
contextWindow: 32_000,
85+
inputPrice: 0.07,
86+
outputPrice: 0.4,
87+
cacheReadsPrice: 0.014,
88+
},
89+
{
90+
contextWindow: 128_000,
91+
inputPrice: 0.1,
92+
outputPrice: 0.6,
93+
cacheReadsPrice: 0.02,
94+
},
95+
{
96+
contextWindow: Infinity,
97+
inputPrice: 0.1,
98+
outputPrice: 0.6,
99+
cacheReadsPrice: 0.02,
100+
},
101+
],
102+
},
103+
} as const satisfies Record<string, ModelInfo>
104+
105+
export const ZAI_DEFAULT_TEMPERATURE = 0

pnpm-lock.yaml

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
ClaudeCodeHandler,
3434
SambaNovaHandler,
3535
DoubaoHandler,
36+
ZAiHandler,
3637
} from "./providers"
3738

3839
export interface SingleCompletionHandler {
@@ -124,6 +125,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
124125
return new CerebrasHandler(options)
125126
case "sambanova":
126127
return new SambaNovaHandler(options)
128+
case "zai":
129+
return new ZAiHandler(options)
127130
default:
128131
apiProvider satisfies "gemini-cli" | undefined
129132
return new AnthropicHandler(options)

0 commit comments

Comments
 (0)