mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Merge branch 'main' into feat/hook_sessionstart_sessionend
This commit is contained in:
commit
b236e4152f
195 changed files with 7605 additions and 3975 deletions
|
|
@ -37,7 +37,6 @@ import {
|
|||
type FileSystemService,
|
||||
StandardFileSystemService,
|
||||
type FileEncodingType,
|
||||
FileEncoding,
|
||||
} from '../services/fileSystemService.js';
|
||||
import { GitService } from '../services/gitService.js';
|
||||
|
||||
|
|
@ -102,6 +101,7 @@ import { fireNotificationHook } from '../core/toolHookTriggers.js';
|
|||
// Utils
|
||||
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
||||
import { FileExclusions } from '../utils/ignorePatterns.js';
|
||||
import { shouldDefaultToNodePty } from '../utils/shell-utils.js';
|
||||
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
||||
import { isToolEnabled, type ToolName } from '../utils/tool-utils.js';
|
||||
import { getErrorMessage } from '../utils/errors.js';
|
||||
|
|
@ -200,10 +200,6 @@ export interface ChatCompressionSettings {
|
|||
contextPercentageThreshold?: number;
|
||||
}
|
||||
|
||||
export interface SummarizeToolOutputSettings {
|
||||
tokenBudget?: number;
|
||||
}
|
||||
|
||||
export interface TelemetrySettings {
|
||||
enabled?: boolean;
|
||||
target?: TelemetryTarget;
|
||||
|
|
@ -344,7 +340,6 @@ export interface ConfigParameters {
|
|||
allowedMcpServers?: string[];
|
||||
excludedMcpServers?: string[];
|
||||
noBrowser?: boolean;
|
||||
summarizeToolOutput?: Record<string, SummarizeToolOutputSettings>;
|
||||
folderTrustFeature?: boolean;
|
||||
folderTrust?: boolean;
|
||||
ideMode?: boolean;
|
||||
|
|
@ -380,7 +375,6 @@ export interface ConfigParameters {
|
|||
skipLoopDetection?: boolean;
|
||||
truncateToolOutputThreshold?: number;
|
||||
truncateToolOutputLines?: number;
|
||||
enableToolOutputTruncation?: boolean;
|
||||
eventEmitter?: EventEmitter;
|
||||
output?: OutputSettings;
|
||||
inputFormat?: InputFormat;
|
||||
|
|
@ -503,9 +497,6 @@ export class Config {
|
|||
private readonly listExtensions: boolean;
|
||||
private readonly overrideExtensions?: string[];
|
||||
|
||||
private readonly summarizeToolOutput:
|
||||
| Record<string, SummarizeToolOutputSettings>
|
||||
| undefined;
|
||||
private readonly cliVersion?: string;
|
||||
private readonly experimentalZedIntegration: boolean = false;
|
||||
private readonly chatRecordingEnabled: boolean;
|
||||
|
|
@ -535,10 +526,9 @@ export class Config {
|
|||
private readonly fileExclusions: FileExclusions;
|
||||
private readonly truncateToolOutputThreshold: number;
|
||||
private readonly truncateToolOutputLines: number;
|
||||
private readonly enableToolOutputTruncation: boolean;
|
||||
private readonly eventEmitter?: EventEmitter;
|
||||
private readonly channel: string | undefined;
|
||||
private readonly defaultFileEncoding: FileEncodingType;
|
||||
private readonly defaultFileEncoding: FileEncodingType | undefined;
|
||||
private readonly enableHooks: boolean;
|
||||
private readonly hooks?: Record<string, unknown>;
|
||||
private readonly hooksConfig?: Record<string, unknown>;
|
||||
|
|
@ -619,7 +609,6 @@ export class Config {
|
|||
this.listExtensions = params.listExtensions ?? false;
|
||||
this.overrideExtensions = params.overrideExtensions;
|
||||
this.noBrowser = params.noBrowser ?? false;
|
||||
this.summarizeToolOutput = params.summarizeToolOutput;
|
||||
this.folderTrustFeature = params.folderTrustFeature ?? false;
|
||||
this.folderTrust = params.folderTrust ?? false;
|
||||
this.ideMode = params.ideMode ?? false;
|
||||
|
|
@ -642,7 +631,8 @@ export class Config {
|
|||
this.webSearch = params.webSearch;
|
||||
this.useRipgrep = params.useRipgrep ?? true;
|
||||
this.useBuiltinRipgrep = params.useBuiltinRipgrep ?? true;
|
||||
this.shouldUseNodePtyShell = params.shouldUseNodePtyShell ?? true;
|
||||
this.shouldUseNodePtyShell =
|
||||
params.shouldUseNodePtyShell ?? shouldDefaultToNodePty();
|
||||
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
|
||||
this.shellExecutionConfig = {
|
||||
terminalWidth: params.shellExecutionConfig?.terminalWidth ?? 80,
|
||||
|
|
@ -655,9 +645,8 @@ export class Config {
|
|||
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD;
|
||||
this.truncateToolOutputLines =
|
||||
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
||||
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
||||
this.channel = params.channel;
|
||||
this.defaultFileEncoding = params.defaultFileEncoding ?? FileEncoding.UTF8;
|
||||
this.defaultFileEncoding = params.defaultFileEncoding;
|
||||
this.storage = new Storage(this.targetDir);
|
||||
this.inputFormat = params.inputFormat ?? InputFormat.TEXT;
|
||||
this.fileExclusions = new FileExclusions(this);
|
||||
|
|
@ -1687,12 +1676,6 @@ export class Config {
|
|||
return this.getNoBrowser() || !shouldAttemptBrowserLaunch();
|
||||
}
|
||||
|
||||
getSummarizeToolOutputConfig():
|
||||
| Record<string, SummarizeToolOutputSettings>
|
||||
| undefined {
|
||||
return this.summarizeToolOutput;
|
||||
}
|
||||
|
||||
// Web search provider configuration
|
||||
getWebSearchConfig() {
|
||||
return this.webSearch;
|
||||
|
|
@ -1753,7 +1736,7 @@ export class Config {
|
|||
* Get the default file encoding for new files.
|
||||
* @returns FileEncodingType
|
||||
*/
|
||||
getDefaultFileEncoding(): FileEncodingType {
|
||||
getDefaultFileEncoding(): FileEncodingType | undefined {
|
||||
return this.defaultFileEncoding;
|
||||
}
|
||||
|
||||
|
|
@ -1821,15 +1804,8 @@ export class Config {
|
|||
return this.skipStartupContext;
|
||||
}
|
||||
|
||||
getEnableToolOutputTruncation(): boolean {
|
||||
return this.enableToolOutputTruncation;
|
||||
}
|
||||
|
||||
getTruncateToolOutputThreshold(): number {
|
||||
if (
|
||||
!this.enableToolOutputTruncation ||
|
||||
this.truncateToolOutputThreshold <= 0
|
||||
) {
|
||||
if (this.truncateToolOutputThreshold <= 0) {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
|
|
@ -1837,7 +1813,7 @@ export class Config {
|
|||
}
|
||||
|
||||
getTruncateToolOutputLines(): number {
|
||||
if (!this.enableToolOutputTruncation || this.truncateToolOutputLines <= 0) {
|
||||
if (this.truncateToolOutputLines <= 0) {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue