mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
Merge branch 'main' into feature/arena-agent-collaboration
This commit is contained in:
commit
f9d4fa0a39
292 changed files with 28467 additions and 8155 deletions
|
|
@ -125,6 +125,7 @@ export function colorizeLine(
|
|||
*
|
||||
* @param code The code string to highlight.
|
||||
* @param language The language identifier (e.g., 'javascript', 'css', 'html')
|
||||
* @param tabWidth The number of spaces to replace each tab character with, default is 4
|
||||
* @returns A React.ReactNode containing Ink <Text> elements for the highlighted code.
|
||||
*/
|
||||
export function colorizeCode(
|
||||
|
|
@ -134,8 +135,11 @@ export function colorizeCode(
|
|||
maxWidth?: number,
|
||||
theme?: Theme,
|
||||
settings?: LoadedSettings,
|
||||
tabWidth = 4,
|
||||
): React.ReactNode {
|
||||
const codeToHighlight = code.replace(/\n$/, '');
|
||||
const codeToHighlight = code
|
||||
.replace(/\n$/, '')
|
||||
.replace(/\t/g, ' '.repeat(tabWidth));
|
||||
const activeTheme = theme || themeManager.getActiveTheme();
|
||||
const showLineNumbers = settings?.merged.ui?.showLineNumbers ?? true;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import { randomUUID } from 'node:crypto';
|
||||
import type { Config, ChatRecord } from '@qwen-code/qwen-code-core';
|
||||
import type { SessionContext } from '../../../acp-integration/session/types.js';
|
||||
import type * as acp from '../../../acp-integration/acp.js';
|
||||
import type { SessionUpdate, ToolCall } from '@agentclientprotocol/sdk';
|
||||
import { HistoryReplayer } from '../../../acp-integration/session/HistoryReplayer.js';
|
||||
import type { ExportMessage, ExportSessionData } from './types.js';
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ class ExportSessionContext implements SessionContext {
|
|||
this.config = config;
|
||||
}
|
||||
|
||||
async sendUpdate(update: acp.SessionUpdate): Promise<void> {
|
||||
async sendUpdate(update: SessionUpdate): Promise<void> {
|
||||
switch (update.sessionUpdate) {
|
||||
case 'user_message_chunk':
|
||||
this.handleMessageChunk('user', update.content);
|
||||
|
|
@ -108,7 +108,7 @@ class ExportSessionContext implements SessionContext {
|
|||
}
|
||||
}
|
||||
|
||||
private handleToolCallStart(update: acp.ToolCall): void {
|
||||
private handleToolCallStart(update: ToolCall): void {
|
||||
const toolCall: ExportMessage['toolCall'] = {
|
||||
toolCallId: update.toolCallId,
|
||||
kind: update.kind || 'other',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue