codeep 2.12.0 → 2.13.1
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/README.md +9 -1
- package/dist/acp/server.d.ts +41 -0
- package/dist/acp/server.js +36 -155
- package/dist/acp/serverHandlers.d.ts +88 -0
- package/dist/acp/serverHandlers.js +237 -0
- package/dist/acp/session.d.ts +9 -0
- package/dist/acp/session.js +6 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/providers.d.ts +10 -0
- package/dist/config/providers.js +225 -2
- package/dist/renderer/App.js +6 -119
- package/dist/renderer/commands/registry.d.ts +92 -0
- package/dist/renderer/commands/registry.js +488 -0
- package/dist/renderer/components/Help.d.ts +12 -3
- package/dist/renderer/components/Help.js +14 -176
- package/dist/renderer/components/Settings.d.ts +5 -1
- package/dist/renderer/components/Settings.js +23 -5
- package/dist/utils/agentChat.js +5 -2
- package/dist/utils/gitHookInstaller.js +1 -1
- package/dist/utils/tokenTracker.js +37 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -10
package/dist/acp/session.d.ts
CHANGED
|
@@ -26,4 +26,13 @@ export interface AgentSessionOptions {
|
|
|
26
26
|
* Falls back to a minimal synthetic context if scanning fails.
|
|
27
27
|
*/
|
|
28
28
|
export declare function buildProjectContext(workspaceRoot: string): ProjectContext;
|
|
29
|
+
export declare function toolCallMeta(toolName: string, params: Record<string, string>, workspaceRoot: string): {
|
|
30
|
+
kind: string;
|
|
31
|
+
title: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function buildRawOutput(toolName: string, params: Record<string, string>, toolResult: {
|
|
34
|
+
success: boolean;
|
|
35
|
+
output: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
}): string | undefined;
|
|
29
38
|
export declare function runAgentSession(opts: AgentSessionOptions): Promise<void>;
|
package/dist/acp/session.js
CHANGED
|
@@ -24,7 +24,10 @@ export function buildProjectContext(workspaceRoot) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
// Maps internal tool names to ACP tool_call kind values and human titles.
|
|
27
|
-
|
|
27
|
+
// Exported (not just module-private) so it can be unit-tested in isolation —
|
|
28
|
+
// testing it through runAgentSession would require mocking the entire agent
|
|
29
|
+
// loop, which would defeat the point of covering this mapping.
|
|
30
|
+
export function toolCallMeta(toolName, params, workspaceRoot) {
|
|
28
31
|
const file = params.path ?? params.file ?? '';
|
|
29
32
|
// Use full path for edit tools (Zed renders it as a clickable file link)
|
|
30
33
|
const absFile = file
|
|
@@ -51,7 +54,8 @@ function toolCallMeta(toolName, params, workspaceRoot) {
|
|
|
51
54
|
// Builds rawOutput content to display inside tool call cards.
|
|
52
55
|
// For write/edit operations, returns the code content or diff.
|
|
53
56
|
// For command execution, returns the command output.
|
|
54
|
-
|
|
57
|
+
// Exported for direct unit testing (see session.test.ts).
|
|
58
|
+
export function buildRawOutput(toolName, params, toolResult) {
|
|
55
59
|
// Always surface error details when a tool fails
|
|
56
60
|
if (!toolResult.success && toolResult.error) {
|
|
57
61
|
return `Error: ${toolResult.error}`;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ interface ProviderApiKey {
|
|
|
14
14
|
providerId: string;
|
|
15
15
|
apiKey: string;
|
|
16
16
|
}
|
|
17
|
-
type AgentMode = 'on' | 'manual';
|
|
18
|
-
interface ConfigSchema {
|
|
17
|
+
type AgentMode = 'on' | 'manual' | 'off';
|
|
18
|
+
export interface ConfigSchema {
|
|
19
19
|
apiKey: string;
|
|
20
20
|
provider: string;
|
|
21
21
|
model: string;
|
|
@@ -26,6 +26,10 @@ export interface ProviderConfig {
|
|
|
26
26
|
maxOutputTokens?: number;
|
|
27
27
|
useMaxCompletionTokens?: boolean;
|
|
28
28
|
requiresDefaultTemperature?: boolean;
|
|
29
|
+
/** Provider's OpenAI-compatible endpoint rejects `tools` together with
|
|
30
|
+
* `stream: true` (Alibaba/Qwen DashScope). When true, agent turns that send
|
|
31
|
+
* tools are issued non-streamed (we buffer the full response). */
|
|
32
|
+
noStreamWithTools?: boolean;
|
|
29
33
|
envKey?: string;
|
|
30
34
|
subscribeUrl?: string;
|
|
31
35
|
noApiKey?: boolean;
|
|
@@ -68,6 +72,12 @@ export declare function usesMaxCompletionTokens(providerId: string): boolean;
|
|
|
68
72
|
* (e.g. OpenAI GPT-5+ only accepts the default of 1).
|
|
69
73
|
*/
|
|
70
74
|
export declare function requiresDefaultTemperature(providerId: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Returns true if the provider's OpenAI-compatible endpoint rejects `tools`
|
|
77
|
+
* together with `stream: true` (Alibaba/Qwen) — callers must issue tool-bearing
|
|
78
|
+
* agent turns non-streamed.
|
|
79
|
+
*/
|
|
80
|
+
export declare function providerNoStreamWithTools(providerId: string): boolean;
|
|
71
81
|
export declare function modelRejectsSamplingParams(model: string): boolean;
|
|
72
82
|
/**
|
|
73
83
|
* Returns the effective max output tokens for a provider, capped by the provider's limit.
|
package/dist/config/providers.js
CHANGED
|
@@ -203,6 +203,196 @@ export const PROVIDERS = {
|
|
|
203
203
|
groupLabel: 'DeepSeek',
|
|
204
204
|
hint: 'Pay-per-use via DeepSeek API key (platform.deepseek.com).',
|
|
205
205
|
},
|
|
206
|
+
// ── Kimi (Moonshot AI) ────────────────────────────────────────────
|
|
207
|
+
// Subscription (Kimi Code) mirrors the Z.AI GLM-Coding-Plan shape: a
|
|
208
|
+
// dedicated coding base URL + a separate key, model id ALWAYS
|
|
209
|
+
// `kimi-for-coding` (a backend alias). OpenAI-compatible is the
|
|
210
|
+
// battle-tested path so we don't expose the Anthropic surface here.
|
|
211
|
+
'kimi': {
|
|
212
|
+
name: 'Kimi (Moonshot) — Coding Plan',
|
|
213
|
+
description: 'Kimi Code subscription',
|
|
214
|
+
protocols: {
|
|
215
|
+
openai: { baseUrl: 'https://api.kimi.com/coding/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
216
|
+
},
|
|
217
|
+
models: [
|
|
218
|
+
{ id: 'kimi-for-coding', name: 'Kimi Code', description: 'Subscription alias — auto-maps to the latest Kimi coding model (K2.7 Code)' },
|
|
219
|
+
],
|
|
220
|
+
defaultModel: 'kimi-for-coding',
|
|
221
|
+
defaultProtocol: 'openai',
|
|
222
|
+
maxOutputTokens: 32_768,
|
|
223
|
+
envKey: 'KIMI_CODE_API_KEY',
|
|
224
|
+
subscribeUrl: 'https://www.kimi.com/code',
|
|
225
|
+
groupLabel: 'Kimi — Subscription (Kimi Code)',
|
|
226
|
+
hint: 'Uses your Kimi Code subscription — no per-token charges. Key from kimi.com/code/console.',
|
|
227
|
+
},
|
|
228
|
+
'kimi-api': {
|
|
229
|
+
name: 'Kimi (Moonshot) API (pay-per-use)',
|
|
230
|
+
description: 'Moonshot AI Kimi models via API key',
|
|
231
|
+
protocols: {
|
|
232
|
+
openai: { baseUrl: 'https://api.moonshot.ai/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
233
|
+
},
|
|
234
|
+
models: [
|
|
235
|
+
{ id: 'kimi-k2.7-code', name: 'Kimi K2.7 Code', description: 'Flagship agentic coding model (256K context)' },
|
|
236
|
+
{ id: 'kimi-k2.7-code-highspeed', name: 'Kimi K2.7 Code (High-Speed)', description: 'Throughput-tuned K2.7 Code for latency-sensitive loops' },
|
|
237
|
+
{ id: 'kimi-k2.6', name: 'Kimi K2.6', description: 'Previous-gen multimodal reasoning model' },
|
|
238
|
+
{ id: 'kimi-k2.5', name: 'Kimi K2.5', description: 'Older general-purpose model (cheaper)' },
|
|
239
|
+
],
|
|
240
|
+
defaultModel: 'kimi-k2.7-code',
|
|
241
|
+
defaultProtocol: 'openai',
|
|
242
|
+
maxOutputTokens: 32_768,
|
|
243
|
+
envKey: 'MOONSHOT_API_KEY',
|
|
244
|
+
subscribeUrl: 'https://platform.kimi.ai/console/api-keys',
|
|
245
|
+
groupLabel: 'Kimi — API (pay-per-use)',
|
|
246
|
+
hint: 'Pay-per-use via Moonshot API key (platform.kimi.ai).',
|
|
247
|
+
},
|
|
248
|
+
'kimi-cn': {
|
|
249
|
+
name: 'Kimi China (Moonshot)',
|
|
250
|
+
description: 'Moonshot AI Kimi models (China)',
|
|
251
|
+
protocols: {
|
|
252
|
+
openai: { baseUrl: 'https://api.moonshot.cn/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
253
|
+
},
|
|
254
|
+
models: [
|
|
255
|
+
{ id: 'kimi-k2.7-code', name: 'Kimi K2.7 Code', description: 'Flagship agentic coding model (256K context)' },
|
|
256
|
+
{ id: 'kimi-k2.7-code-highspeed', name: 'Kimi K2.7 Code (High-Speed)', description: 'Throughput-tuned K2.7 Code' },
|
|
257
|
+
{ id: 'kimi-k2.6', name: 'Kimi K2.6', description: 'Previous-gen multimodal reasoning model' },
|
|
258
|
+
{ id: 'kimi-k2.5', name: 'Kimi K2.5', description: 'Older general-purpose model' },
|
|
259
|
+
],
|
|
260
|
+
defaultModel: 'kimi-k2.7-code',
|
|
261
|
+
defaultProtocol: 'openai',
|
|
262
|
+
maxOutputTokens: 32_768,
|
|
263
|
+
envKey: 'MOONSHOT_CN_API_KEY',
|
|
264
|
+
subscribeUrl: 'https://platform.moonshot.cn/console/api-keys',
|
|
265
|
+
groupLabel: 'Kimi China — API (pay-per-use)',
|
|
266
|
+
hint: 'Pay-per-use via Moonshot China API key (platform.moonshot.cn).',
|
|
267
|
+
},
|
|
268
|
+
// ── Grok (xAI) ────────────────────────────────────────────────────
|
|
269
|
+
// Pay-per-use today (console.x.ai key). The SuperGrok / X Premium+
|
|
270
|
+
// subscription is OAuth-based — added separately. Reasoning models
|
|
271
|
+
// require max_completion_tokens (like GPT-5), so useMaxCompletionTokens.
|
|
272
|
+
'grok': {
|
|
273
|
+
name: 'Grok (xAI)',
|
|
274
|
+
description: 'xAI Grok models',
|
|
275
|
+
protocols: {
|
|
276
|
+
openai: { baseUrl: 'https://api.x.ai/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
277
|
+
},
|
|
278
|
+
models: [
|
|
279
|
+
{ id: 'grok-build-0.1', name: 'Grok Build 0.1', description: 'Agentic coding model — fast, 256K context' },
|
|
280
|
+
{ id: 'grok-4.3', name: 'Grok 4.3', description: 'Flagship — highest quality, 1M context' },
|
|
281
|
+
{ id: 'grok-code-fast-1', name: 'Grok Code Fast 1', description: 'Low-cost speed-first coder (alias of Build 0.1)' },
|
|
282
|
+
{ id: 'grok-4-fast-reasoning', name: 'Grok 4 Fast (reasoning)', description: 'Cheap reasoning model, very large context' },
|
|
283
|
+
],
|
|
284
|
+
defaultModel: 'grok-build-0.1',
|
|
285
|
+
defaultProtocol: 'openai',
|
|
286
|
+
useMaxCompletionTokens: true, // reasoning models reject max_tokens
|
|
287
|
+
envKey: 'XAI_API_KEY',
|
|
288
|
+
subscribeUrl: 'https://console.x.ai',
|
|
289
|
+
groupLabel: 'xAI Grok',
|
|
290
|
+
hint: 'Pay-per-use via xAI API key (console.x.ai).',
|
|
291
|
+
},
|
|
292
|
+
// ── Qwen (Alibaba Model Studio / DashScope) ───────────────────────
|
|
293
|
+
// Coding Plan subscription = dedicated base URL + sk-sp- key (mirrors
|
|
294
|
+
// Z.AI). Qwen's OpenAI-compatible surface CANNOT combine tools with
|
|
295
|
+
// streaming, so all Qwen entries set noStreamWithTools.
|
|
296
|
+
'qwen': {
|
|
297
|
+
name: 'Qwen (Alibaba) — Coding Plan',
|
|
298
|
+
description: 'Qwen Coding Plan subscription',
|
|
299
|
+
protocols: {
|
|
300
|
+
openai: { baseUrl: 'https://coding-intl.dashscope.aliyuncs.com/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
301
|
+
},
|
|
302
|
+
models: [
|
|
303
|
+
{ id: 'qwen3-coder-plus', name: 'Qwen3-Coder Plus', description: 'Flagship coding model — best quality' },
|
|
304
|
+
{ id: 'qwen3-coder-next', name: 'Qwen3-Coder Next', description: 'Balanced quality/speed/cost' },
|
|
305
|
+
{ id: 'qwen3-max', name: 'Qwen3-Max', description: 'Flagship general model (code + reasoning)' },
|
|
306
|
+
],
|
|
307
|
+
defaultModel: 'qwen3-coder-plus',
|
|
308
|
+
defaultProtocol: 'openai',
|
|
309
|
+
maxOutputTokens: 65_536,
|
|
310
|
+
noStreamWithTools: true,
|
|
311
|
+
envKey: 'BAILIAN_CODING_PLAN_API_KEY',
|
|
312
|
+
subscribeUrl: 'https://www.alibabacloud.com/help/en/model-studio/qwen-code-coding-plan',
|
|
313
|
+
groupLabel: 'Qwen — Subscription (Coding Plan)',
|
|
314
|
+
hint: 'Uses your Qwen Coding Plan — no per-token charges. sk-sp-… key from Model Studio. Interactive coding use only.',
|
|
315
|
+
},
|
|
316
|
+
'qwen-api': {
|
|
317
|
+
name: 'Qwen (Alibaba) API (pay-per-use)',
|
|
318
|
+
description: 'Alibaba Model Studio Qwen models via API key',
|
|
319
|
+
protocols: {
|
|
320
|
+
openai: { baseUrl: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
321
|
+
},
|
|
322
|
+
models: [
|
|
323
|
+
{ id: 'qwen3-coder-plus', name: 'Qwen3-Coder Plus', description: 'Flagship coding model (256K, up to 1M)' },
|
|
324
|
+
{ id: 'qwen3-coder-next', name: 'Qwen3-Coder Next', description: 'Balanced quality/speed/cost' },
|
|
325
|
+
{ id: 'qwen3-coder-flash', name: 'Qwen3-Coder Flash', description: 'Fast/cheap coder' },
|
|
326
|
+
{ id: 'qwen3-max', name: 'Qwen3-Max', description: 'Flagship general model' },
|
|
327
|
+
],
|
|
328
|
+
defaultModel: 'qwen3-coder-plus',
|
|
329
|
+
defaultProtocol: 'openai',
|
|
330
|
+
maxOutputTokens: 65_536,
|
|
331
|
+
noStreamWithTools: true,
|
|
332
|
+
envKey: 'DASHSCOPE_API_KEY',
|
|
333
|
+
subscribeUrl: 'https://modelstudio.console.alibabacloud.com/',
|
|
334
|
+
groupLabel: 'Qwen — API (pay-per-use)',
|
|
335
|
+
hint: 'Pay-per-use via Alibaba Model Studio key (DASHSCOPE_API_KEY).',
|
|
336
|
+
},
|
|
337
|
+
'qwen-cn': {
|
|
338
|
+
name: 'Qwen China — Coding Plan',
|
|
339
|
+
description: 'Qwen Coding Plan subscription (China)',
|
|
340
|
+
protocols: {
|
|
341
|
+
openai: { baseUrl: 'https://coding.dashscope.aliyuncs.com/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
342
|
+
},
|
|
343
|
+
models: [
|
|
344
|
+
{ id: 'qwen3-coder-plus', name: 'Qwen3-Coder Plus', description: 'Flagship coding model — best quality' },
|
|
345
|
+
{ id: 'qwen3-coder-next', name: 'Qwen3-Coder Next', description: 'Balanced quality/speed/cost' },
|
|
346
|
+
{ id: 'qwen3-max', name: 'Qwen3-Max', description: 'Flagship general model' },
|
|
347
|
+
],
|
|
348
|
+
defaultModel: 'qwen3-coder-plus',
|
|
349
|
+
defaultProtocol: 'openai',
|
|
350
|
+
maxOutputTokens: 65_536,
|
|
351
|
+
noStreamWithTools: true,
|
|
352
|
+
envKey: 'BAILIAN_CODING_PLAN_CN_API_KEY',
|
|
353
|
+
subscribeUrl: 'https://bailian.console.aliyun.com/',
|
|
354
|
+
groupLabel: 'Qwen China — Subscription (Coding Plan)',
|
|
355
|
+
hint: 'Uses your Qwen Coding Plan (China). sk-sp-… key from Bailian.',
|
|
356
|
+
},
|
|
357
|
+
'qwen-cn-api': {
|
|
358
|
+
name: 'Qwen China API (pay-per-use)',
|
|
359
|
+
description: 'Alibaba Model Studio Qwen models via API key (China)',
|
|
360
|
+
protocols: {
|
|
361
|
+
openai: { baseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
362
|
+
},
|
|
363
|
+
models: [
|
|
364
|
+
{ id: 'qwen3-coder-plus', name: 'Qwen3-Coder Plus', description: 'Flagship coding model' },
|
|
365
|
+
{ id: 'qwen3-coder-next', name: 'Qwen3-Coder Next', description: 'Balanced quality/speed/cost' },
|
|
366
|
+
{ id: 'qwen3-coder-flash', name: 'Qwen3-Coder Flash', description: 'Fast/cheap coder' },
|
|
367
|
+
{ id: 'qwen3-max', name: 'Qwen3-Max', description: 'Flagship general model' },
|
|
368
|
+
],
|
|
369
|
+
defaultModel: 'qwen3-coder-plus',
|
|
370
|
+
defaultProtocol: 'openai',
|
|
371
|
+
maxOutputTokens: 65_536,
|
|
372
|
+
noStreamWithTools: true,
|
|
373
|
+
envKey: 'DASHSCOPE_CN_API_KEY',
|
|
374
|
+
subscribeUrl: 'https://bailian.console.aliyun.com/',
|
|
375
|
+
groupLabel: 'Qwen China — API (pay-per-use)',
|
|
376
|
+
hint: 'Pay-per-use via Alibaba Model Studio China key.',
|
|
377
|
+
},
|
|
378
|
+
'modelscope': {
|
|
379
|
+
name: 'ModelScope (free Qwen)',
|
|
380
|
+
description: 'Free Qwen3-Coder inference via ModelScope',
|
|
381
|
+
protocols: {
|
|
382
|
+
openai: { baseUrl: 'https://api-inference.modelscope.cn/v1', authHeader: 'Bearer', supportsNativeTools: true },
|
|
383
|
+
},
|
|
384
|
+
models: [
|
|
385
|
+
{ id: 'Qwen/Qwen3-Coder-480B-A35B-Instruct', name: 'Qwen3-Coder 480B', description: 'Open MoE coder — free tier (~2000 req/day)' },
|
|
386
|
+
],
|
|
387
|
+
defaultModel: 'Qwen/Qwen3-Coder-480B-A35B-Instruct',
|
|
388
|
+
defaultProtocol: 'openai',
|
|
389
|
+
maxOutputTokens: 65_536,
|
|
390
|
+
noStreamWithTools: true,
|
|
391
|
+
envKey: 'MODELSCOPE_API_KEY',
|
|
392
|
+
subscribeUrl: 'https://modelscope.cn/my/myaccesstoken',
|
|
393
|
+
groupLabel: 'ModelScope — Free (Qwen)',
|
|
394
|
+
hint: 'Free tier (~2000 req/day) via ModelScope token (modelscope.cn). Needs a bound Aliyun account.',
|
|
395
|
+
},
|
|
206
396
|
'openai': {
|
|
207
397
|
name: 'OpenAI',
|
|
208
398
|
description: 'GPT and o-series models',
|
|
@@ -361,14 +551,24 @@ const DISPLAY_ORDER = [
|
|
|
361
551
|
'openrouter', // 100+ models, one key — surfaced high on purpose for 2.0.0.
|
|
362
552
|
'z.ai',
|
|
363
553
|
'z.ai-api',
|
|
554
|
+
'kimi',
|
|
555
|
+
'kimi-api',
|
|
556
|
+
'qwen',
|
|
557
|
+
'qwen-api',
|
|
558
|
+
'grok',
|
|
364
559
|
'deepseek',
|
|
365
560
|
'google',
|
|
366
561
|
'minimax',
|
|
367
562
|
'minimax-api',
|
|
563
|
+
'modelscope',
|
|
368
564
|
'ollama',
|
|
369
565
|
'custom',
|
|
566
|
+
// Regional + parameter-variant entries trail.
|
|
370
567
|
'z.ai-cn',
|
|
371
568
|
'z.ai-cn-api',
|
|
569
|
+
'kimi-cn',
|
|
570
|
+
'qwen-cn',
|
|
571
|
+
'qwen-cn-api',
|
|
372
572
|
'minimax-cn',
|
|
373
573
|
];
|
|
374
574
|
export function getProviderList() {
|
|
@@ -441,14 +641,26 @@ export function usesMaxCompletionTokens(providerId) {
|
|
|
441
641
|
export function requiresDefaultTemperature(providerId) {
|
|
442
642
|
return PROVIDERS[providerId]?.requiresDefaultTemperature ?? false;
|
|
443
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* Returns true if the provider's OpenAI-compatible endpoint rejects `tools`
|
|
646
|
+
* together with `stream: true` (Alibaba/Qwen) — callers must issue tool-bearing
|
|
647
|
+
* agent turns non-streamed.
|
|
648
|
+
*/
|
|
649
|
+
export function providerNoStreamWithTools(providerId) {
|
|
650
|
+
return PROVIDERS[providerId]?.noStreamWithTools ?? false;
|
|
651
|
+
}
|
|
444
652
|
/**
|
|
445
653
|
* Models that reject sampling parameters (temperature/top_p/top_k) with a 400.
|
|
446
654
|
* Anthropic removed them on Fable 5 and Opus 4.7+; older Claude models still
|
|
447
655
|
* accept them, so this must be a MODEL-level check, not a provider-level one
|
|
448
656
|
* (requiresDefaultTemperature can't express it). Omitting the field is always
|
|
449
|
-
* safe — the API treats omission as default.
|
|
657
|
+
* safe — the API treats omission as default. Kimi K2.x code/thinking models
|
|
658
|
+
* fix temperature internally and 400 on any custom value, so they're here too.
|
|
450
659
|
*/
|
|
451
|
-
const SAMPLING_PARAMS_REJECTED = [
|
|
660
|
+
const SAMPLING_PARAMS_REJECTED = [
|
|
661
|
+
'claude-fable-5', 'claude-opus-4-8', 'claude-opus-4-7',
|
|
662
|
+
'kimi-k2.7-code', 'kimi-for-coding',
|
|
663
|
+
];
|
|
452
664
|
export function modelRejectsSamplingParams(model) {
|
|
453
665
|
return SAMPLING_PARAMS_REJECTED.some(id => model === id || model.startsWith(`${id}-`));
|
|
454
666
|
}
|
|
@@ -508,6 +720,12 @@ export function modelSupportsReasoningEffort(providerId, model) {
|
|
|
508
720
|
// GLM-5.2 added graded High/Max effort. glm-5-turbo is a plain thinking
|
|
509
721
|
// toggle (no graded levels) so it stays out.
|
|
510
722
|
return idMatches(id, 'glm-5-2');
|
|
723
|
+
case 'grok':
|
|
724
|
+
// Grok reasoning models accept reasoning_effort (none/low/medium/high).
|
|
725
|
+
// Explicit *-non-reasoning variants don't think → excluded.
|
|
726
|
+
return id.startsWith('grok') && !id.includes('non-reasoning');
|
|
727
|
+
// Kimi (thinking on/off, not graded) and Qwen coders (non-thinking) have
|
|
728
|
+
// no graded knob → fall through to default false.
|
|
511
729
|
case 'openrouter':
|
|
512
730
|
// OpenRouter normalizes a unified `reasoning` field and silently ignores
|
|
513
731
|
// it for non-reasoning models, so the control is always safe to expose.
|
|
@@ -547,6 +765,9 @@ export function reasoningParamsFor(providerId, model, tier) {
|
|
|
547
765
|
case 'z.ai-cn-api':
|
|
548
766
|
// Graded thinking depth: high (default) or max. Lower tiers collapse to high.
|
|
549
767
|
return { reasoning_effort: tier === 'max' ? 'max' : 'high' };
|
|
768
|
+
case 'grok':
|
|
769
|
+
// none/low/medium/high — no "max"; map our Max → high (the ceiling).
|
|
770
|
+
return { reasoning_effort: tier === 'max' ? 'high' : tier };
|
|
550
771
|
case 'openrouter':
|
|
551
772
|
// Unified reasoning object; no "max" effort → cap at high.
|
|
552
773
|
return { reasoning: { effort: tier === 'max' ? 'high' : tier } };
|
|
@@ -580,6 +801,8 @@ export function availableReasoningTiers(providerId, model) {
|
|
|
580
801
|
case 'z.ai-cn':
|
|
581
802
|
case 'z.ai-cn-api':
|
|
582
803
|
return ['auto', 'high', 'max'];
|
|
804
|
+
case 'grok':
|
|
805
|
+
return ['auto', 'low', 'medium', 'high'];
|
|
583
806
|
case 'openrouter':
|
|
584
807
|
return ['auto', 'low', 'medium', 'high'];
|
|
585
808
|
default:
|
package/dist/renderer/App.js
CHANGED
|
@@ -23,125 +23,12 @@ const LOGO_LINES = [
|
|
|
23
23
|
' ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ',
|
|
24
24
|
];
|
|
25
25
|
const LOGO_HEIGHT = LOGO_LINES.length;
|
|
26
|
-
// Command
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'update': 'Check updates',
|
|
33
|
-
'clear': 'Clear chat',
|
|
34
|
-
'exit': 'Quit',
|
|
35
|
-
'sessions': 'Manage sessions',
|
|
36
|
-
'new': 'New session',
|
|
37
|
-
'rename': 'Rename session',
|
|
38
|
-
'search': 'Search history',
|
|
39
|
-
'export': 'Export chat',
|
|
40
|
-
'agent': 'Run agent for a task',
|
|
41
|
-
'agent-dry': 'Preview agent actions',
|
|
42
|
-
'stop': 'Stop running agent',
|
|
43
|
-
'undo': 'Undo last action',
|
|
44
|
-
'undo-all': 'Undo all actions',
|
|
45
|
-
'history': 'Show agent history',
|
|
46
|
-
'changes': 'Show session changes',
|
|
47
|
-
'diff': 'Review git changes',
|
|
48
|
-
'commit': 'Generate commit message',
|
|
49
|
-
'git-commit': 'Commit with message',
|
|
50
|
-
'push': 'Git push',
|
|
51
|
-
'pull': 'Git pull',
|
|
52
|
-
'amend': 'Amend the last commit',
|
|
53
|
-
'pr': 'Create a pull request description',
|
|
54
|
-
'changelog': 'Generate changelog from recent commits',
|
|
55
|
-
'branch': 'Create a new branch with smart naming',
|
|
56
|
-
'stash': 'Stash changes with a meaningful message',
|
|
57
|
-
'unstash': 'Apply and drop the most recent stash',
|
|
58
|
-
'init': 'Initialize project (.codeep/)',
|
|
59
|
-
'scan': 'Scan project',
|
|
60
|
-
'memory': 'Add/list/remove project memory notes',
|
|
61
|
-
'review': 'Code review',
|
|
62
|
-
'copy': 'Copy code block',
|
|
63
|
-
'paste': 'Paste from clipboard',
|
|
64
|
-
'apply': 'Apply file changes',
|
|
65
|
-
'add': 'Add file to context',
|
|
66
|
-
'drop': 'Remove file from context',
|
|
67
|
-
'multiline': 'Toggle multi-line input',
|
|
68
|
-
'test': 'Generate/run tests',
|
|
69
|
-
'docs': 'Open web docs for a command (e.g. /docs personality)',
|
|
70
|
-
'refactor': 'Improve code quality',
|
|
71
|
-
'fix': 'Debug and fix issues',
|
|
72
|
-
'explain': 'Explain code',
|
|
73
|
-
'optimize': 'Optimize performance',
|
|
74
|
-
'debug': 'Debug problems',
|
|
75
|
-
'test-fix': 'Fix failing tests',
|
|
76
|
-
'coverage': 'Analyze test coverage and suggest improvements',
|
|
77
|
-
'e2e': 'Generate end-to-end tests',
|
|
78
|
-
'mock': 'Generate mock data for testing',
|
|
79
|
-
'readme': 'Generate or update README',
|
|
80
|
-
'api-docs': 'Generate API documentation',
|
|
81
|
-
'translate': 'Translate code comments to English',
|
|
82
|
-
'types': 'Add or improve TypeScript types',
|
|
83
|
-
'cleanup': 'Clean up code (remove unused, format)',
|
|
84
|
-
'modernize': 'Update code to use modern syntax',
|
|
85
|
-
'migrate': 'Migrate code to newer version',
|
|
86
|
-
'split': 'Split a large file into smaller modules',
|
|
87
|
-
'security': 'Security audit',
|
|
88
|
-
'log': 'Add logging to code',
|
|
89
|
-
'build': 'Build the project',
|
|
90
|
-
'deploy': 'Build and deploy',
|
|
91
|
-
'release': 'Create a new release',
|
|
92
|
-
'publish': 'Publish package to npm',
|
|
93
|
-
'component': 'Generate a React/Vue component',
|
|
94
|
-
'api': 'Generate an API endpoint',
|
|
95
|
-
'hook': 'Generate a React hook',
|
|
96
|
-
'service': 'Generate a service/utility module',
|
|
97
|
-
'page': 'Generate a new page/route',
|
|
98
|
-
'form': 'Generate a form with validation',
|
|
99
|
-
'crud': 'Generate full CRUD for an entity',
|
|
100
|
-
'docker': 'Generate Dockerfile and docker-compose',
|
|
101
|
-
'ci': 'Generate CI/CD configuration',
|
|
102
|
-
'env': 'Setup environment configuration',
|
|
103
|
-
'k8s': 'Generate Kubernetes manifests',
|
|
104
|
-
'terraform': 'Generate Terraform configuration',
|
|
105
|
-
'nginx': 'Generate Nginx configuration',
|
|
106
|
-
'monitor': 'Add monitoring and observability',
|
|
107
|
-
'skills': 'List all skills',
|
|
108
|
-
'provider': 'Switch provider',
|
|
109
|
-
'model': 'Switch model',
|
|
110
|
-
'protocol': 'Switch protocol',
|
|
111
|
-
'lang': 'Set language',
|
|
112
|
-
'grant': 'Grant write permission',
|
|
113
|
-
'login': 'Change API key',
|
|
114
|
-
'logout': 'Logout',
|
|
115
|
-
'account': 'Link this machine to your codeep.dev account',
|
|
116
|
-
'context-save': 'Save conversation',
|
|
117
|
-
'context-load': 'Load conversation',
|
|
118
|
-
'context-clear': 'Clear saved context',
|
|
119
|
-
'learn': 'Learn code preferences',
|
|
120
|
-
'cost': 'Show session cost and token usage',
|
|
121
|
-
'profile': 'Save/load settings profiles',
|
|
122
|
-
'tasks': 'List/add/done/delete codeep.dev tasks — add <title> [--bug|--feature]',
|
|
123
|
-
'sync': 'Sync learning preferences and profiles to codeep.dev',
|
|
124
|
-
'telemetry': 'Show or toggle automatic cloud telemetry (on/off)',
|
|
125
|
-
'keysync': 'Show or toggle syncing API keys to codeep.dev (on/off)',
|
|
126
|
-
'thinking': 'Set the thinking/reasoning-effort tier (auto/low/medium/high/max) for models that support it',
|
|
127
|
-
'effort': 'Alias for /thinking — set the reasoning-effort tier',
|
|
128
|
-
// 2.0 — surfaced for `/` autocomplete; documented in /help too.
|
|
129
|
-
'compact': 'Summarize older messages to free up context',
|
|
130
|
-
'commands': 'List custom slash commands in .codeep/commands/*.md',
|
|
131
|
-
'checkpoint': 'Snapshot the session (conversation + provider/model + git HEAD)',
|
|
132
|
-
'checkpoints': 'List saved checkpoints for this workspace',
|
|
133
|
-
'rewind': 'Restore conversation from a saved checkpoint',
|
|
134
|
-
'hooks': 'List installed lifecycle hooks (.codeep/hooks/<event>.sh)',
|
|
135
|
-
'mcp': 'Manage MCP servers (browse, install, add, remove, resources, prompts)',
|
|
136
|
-
'openrouter': 'Tune OpenRouter routing (preferred / ignore providers, fallbacks, privacy)',
|
|
137
|
-
'plan': 'Generate a numbered plan for a task — review before /go executes it',
|
|
138
|
-
'go': 'Execute the pending plan from /plan',
|
|
139
|
-
'personality': 'Switch agent tone: concise / verbose / security / senior-reviewer / etc',
|
|
140
|
-
'me': 'Your user profile (reply language, style, stack) — adapts the agent to you. /me init, /me learn, /me sync',
|
|
141
|
-
'agents': 'List sub-agents the agent can delegate self-contained tasks to (researcher / reviewer / tester / custom)',
|
|
142
|
-
'insights': 'Activity summary over the last N days (default 7): runs, files, tools, projects',
|
|
143
|
-
'recall': 'Search across ALL saved sessions (cross-session; /search is current-session only)',
|
|
144
|
-
};
|
|
26
|
+
// ─── Command metadata ────────────────────────────────────────────────────────
|
|
27
|
+
//
|
|
28
|
+
// `COMMAND_DESCRIPTIONS` used to be hand-maintained here in App.ts and kept in
|
|
29
|
+
// sync (manually) with the `/help` screen in components/Help.ts. Both now derive
|
|
30
|
+
// from the single source of truth in `./commands/registry.ts`.
|
|
31
|
+
import { COMMAND_DESCRIPTIONS } from './commands/registry.js';
|
|
145
32
|
import { helpCategories, keyboardShortcuts } from './components/Help.js';
|
|
146
33
|
import { handleSettingsKey, SETTINGS } from './components/Settings.js';
|
|
147
34
|
import { renderExportPanel, handleExportKey as handleExportKeyComponent } from './components/Export.js';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for Codeep slash commands.
|
|
3
|
+
*
|
|
4
|
+
* Every other place that needs command metadata — the `/` autocomplete in
|
|
5
|
+
* `App.ts`, the `/help` screen in `components/Help.ts`, the dispatcher in
|
|
6
|
+
* `commands.ts`, and the ACP command handler in `acp/commands.ts` — derives
|
|
7
|
+
* from this registry. Adding a command means adding one entry here; the
|
|
8
|
+
* autocomplete list, help screen, and command index all pick it up.
|
|
9
|
+
*
|
|
10
|
+
* ## What lives here vs. elsewhere
|
|
11
|
+
*
|
|
12
|
+
* - **`CommandDef`** is metadata only: name, aliases, description, category.
|
|
13
|
+
* The actual handler logic stays in `renderer/commands.ts` (CLI) and
|
|
14
|
+
* `acp/commands.ts` (ACP) — those files keep their per-command `case`
|
|
15
|
+
* blocks, but they now look up the canonical name/description/alias map here.
|
|
16
|
+
* - **Argument syntax** (e.g. `/rename <name>`, `/mcp browse [id]`) is
|
|
17
|
+
* documented via the optional `usage` field — surfaced in `/help` only.
|
|
18
|
+
* The autocomplete list shows just the bare command name.
|
|
19
|
+
* - **Hidden commands** (`hidden: true`) are valid and dispatched, but don't
|
|
20
|
+
* appear in the autocomplete dropdown or `/help`. Use for aliases that
|
|
21
|
+
* would clutter the list (single-letter shortcuts) and internal commands.
|
|
22
|
+
*
|
|
23
|
+
* ## Invariants (enforced by `registry.test.ts`)
|
|
24
|
+
*
|
|
25
|
+
* - No two commands share a name or alias.
|
|
26
|
+
* - Every `category` referenced exists in `CATEGORY_ORDER`.
|
|
27
|
+
* - `usage` keys never collide with a sibling command's name.
|
|
28
|
+
*/
|
|
29
|
+
/** Display categories, in the order `/help` shows them. */
|
|
30
|
+
export declare const CATEGORY_ORDER: readonly ["general", "sessions", "checkpoints", "agent", "git", "code", "skills", "settings", "extensions", "cloud", "codegen", "thinking"];
|
|
31
|
+
export type CommandCategory = (typeof CATEGORY_ORDER)[number];
|
|
32
|
+
/** Human-readable title for each category (used by `/help`). */
|
|
33
|
+
export declare const CATEGORY_TITLES: Record<CommandCategory, string>;
|
|
34
|
+
export interface CommandDef {
|
|
35
|
+
/** Primary command name, without the leading `/`. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Alternate names that dispatch to the same handler. Hidden from `/help`
|
|
38
|
+
* by default (set `aliasListed: true` to show them, e.g. `/effort`). */
|
|
39
|
+
aliases?: string[];
|
|
40
|
+
/** One-line description shown in autocomplete and `/help`. */
|
|
41
|
+
description: string;
|
|
42
|
+
/** Display group in `/help`. */
|
|
43
|
+
category: CommandCategory;
|
|
44
|
+
/** Extra usage rows shown only in `/help` (e.g. `/mcp browse [id]`).
|
|
45
|
+
* Each entry is rendered as a separate row under the same command. */
|
|
46
|
+
usage?: string[];
|
|
47
|
+
/** When true, the command is valid but hidden from autocomplete + `/help`.
|
|
48
|
+
* Used for single-letter shortcuts and internal aliases. */
|
|
49
|
+
hidden?: boolean;
|
|
50
|
+
/** When true, an alias is listed in `/help` alongside the primary name
|
|
51
|
+
* (e.g. `/effort` appears next to `/thinking`). Default false — most
|
|
52
|
+
* aliases are hidden shortcuts. */
|
|
53
|
+
aliasListed?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The registry. Order within a category is preserved as-is in `/help`,
|
|
57
|
+
* so keep entries grouped by category in source for readability.
|
|
58
|
+
*/
|
|
59
|
+
export declare const COMMANDS: CommandDef[];
|
|
60
|
+
/** `name → description` for every visible (non-hidden) command + listed alias.
|
|
61
|
+
* This is the data behind the `/` autocomplete dropdown in `App.ts`.
|
|
62
|
+
*
|
|
63
|
+
* Single-letter aliases (the `c`/`t`/`d`/… shortcuts) are deliberately
|
|
64
|
+
* EXCLUDED from the dropdown — bare one-letter rows just clutter it (they
|
|
65
|
+
* stay fully routable via the dispatcher + show in `/help` as `(/c)` suffixes).
|
|
66
|
+
* Multi-letter listed aliases (`effort`, `stats`) are kept; they read as real
|
|
67
|
+
* commands, not noise. */
|
|
68
|
+
export declare const COMMAND_DESCRIPTIONS: Record<string, string>;
|
|
69
|
+
/** Every valid command name, including hidden ones and aliases — used by the
|
|
70
|
+
* dispatcher to validate input before looking up a handler. */
|
|
71
|
+
export declare const ALL_COMMAND_NAMES: ReadonlySet<string>;
|
|
72
|
+
export declare function resolveCommand(token: string): CommandDef | undefined;
|
|
73
|
+
/** All aliases (every value in `aliases` across the registry), for quick
|
|
74
|
+
* "is this a shortcut?" checks. */
|
|
75
|
+
export declare const ALL_ALIASES: ReadonlySet<string>;
|
|
76
|
+
export interface HelpItemSpec {
|
|
77
|
+
/** Visible key in `/help`, including the leading `/`. */
|
|
78
|
+
key: string;
|
|
79
|
+
description: string;
|
|
80
|
+
}
|
|
81
|
+
export interface HelpCategorySpec {
|
|
82
|
+
title: string;
|
|
83
|
+
items: HelpItemSpec[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Hand-curated help layout. Categories appear in this order; each item's `key`
|
|
87
|
+
* is rendered verbatim. The command registry provides autocomplete + dispatch
|
|
88
|
+
* metadata; this layout provides the `/help` rendering. They overlap by design
|
|
89
|
+
* — keeping both lets the help screen document env vars, subcommand flavors,
|
|
90
|
+
* and recommended workflows that don't fit the strict command/alias shape.
|
|
91
|
+
*/
|
|
92
|
+
export declare const HELP_LAYOUT: HelpCategorySpec[];
|