mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Merge branch 'main' into feat/mcp-tui
This commit is contained in:
commit
1542a2bdc4
114 changed files with 6943 additions and 1324 deletions
|
|
@ -36,6 +36,7 @@ import {
|
|||
MODIFIER_ALT_BIT,
|
||||
MODIFIER_CTRL_BIT,
|
||||
} from '../utils/platformConstants.js';
|
||||
import { clipboardHasImage } from '../utils/clipboardUtils.js';
|
||||
|
||||
import { FOCUS_IN, FOCUS_OUT } from '../hooks/useFocus.js';
|
||||
|
||||
|
|
@ -54,6 +55,7 @@ export interface Key {
|
|||
paste: boolean;
|
||||
sequence: string;
|
||||
kittyProtocol?: boolean;
|
||||
pasteImage?: boolean;
|
||||
}
|
||||
|
||||
export type KeypressHandler = (key: Key) => void;
|
||||
|
|
@ -390,7 +392,7 @@ export function KeypressProvider({
|
|||
}
|
||||
};
|
||||
|
||||
const handleKeypress = (_: unknown, key: Key) => {
|
||||
const handleKeypress = async (_: unknown, key: Key) => {
|
||||
if (key.sequence === FOCUS_IN || key.sequence === FOCUS_OUT) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -400,14 +402,28 @@ export function KeypressProvider({
|
|||
}
|
||||
if (key.name === 'paste-end') {
|
||||
isPaste = false;
|
||||
broadcast({
|
||||
name: '',
|
||||
ctrl: false,
|
||||
meta: false,
|
||||
shift: false,
|
||||
paste: true,
|
||||
sequence: pasteBuffer.toString(),
|
||||
});
|
||||
if (pasteBuffer.toString().length > 0) {
|
||||
broadcast({
|
||||
name: '',
|
||||
ctrl: false,
|
||||
meta: false,
|
||||
shift: false,
|
||||
paste: true,
|
||||
sequence: pasteBuffer.toString(),
|
||||
});
|
||||
} else {
|
||||
const hasImage = await clipboardHasImage();
|
||||
broadcast({
|
||||
name: '',
|
||||
ctrl: false,
|
||||
meta: false,
|
||||
shift: false,
|
||||
paste: true,
|
||||
pasteImage: hasImage,
|
||||
sequence: pasteBuffer.toString(),
|
||||
});
|
||||
}
|
||||
|
||||
pasteBuffer = Buffer.alloc(0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -722,6 +738,7 @@ export function KeypressProvider({
|
|||
};
|
||||
|
||||
let rl: readline.Interface;
|
||||
|
||||
if (usePassthrough) {
|
||||
rl = readline.createInterface({
|
||||
input: keypressStream,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
type ApprovalMode,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { type SettingScope } from '../../config/settings.js';
|
||||
import { type CodingPlanRegion } from '../../constants/codingPlan.js';
|
||||
import type { AuthState } from '../types.js';
|
||||
import { type VisionSwitchOutcome } from '../components/ModelSwitchDialog.js';
|
||||
// OpenAICredentials type (previously imported from OpenAIKeyPrompt)
|
||||
|
|
@ -40,7 +41,10 @@ export interface UIActions {
|
|||
authType: AuthType | undefined,
|
||||
credentials?: OpenAICredentials,
|
||||
) => Promise<void>;
|
||||
handleCodingPlanSubmit: (apiKey: string) => Promise<void>;
|
||||
handleCodingPlanSubmit: (
|
||||
apiKey: string,
|
||||
region?: CodingPlanRegion,
|
||||
) => Promise<void>;
|
||||
setAuthState: (state: AuthState) => void;
|
||||
onAuthError: (error: string | null) => void;
|
||||
cancelAuthentication: () => void;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue