mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: subagent runtime & CLI display - done
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { COLOR_OPTIONS } from './constants.js';
|
||||
|
||||
export const shouldShowColor = (backgroundColor?: string): boolean =>
|
||||
backgroundColor !== undefined && backgroundColor !== 'auto';
|
||||
export const shouldShowColor = (color?: string): boolean =>
|
||||
color !== undefined && color !== 'auto';
|
||||
|
||||
export const getColorForDisplay = (colorName?: string): string | undefined =>
|
||||
!colorName || colorName === 'auto'
|
||||
@@ -20,3 +20,16 @@ export function sanitizeInput(input: string): string {
|
||||
.replace(/\s+/g, ' ') // Normalize whitespace
|
||||
); // Limit length
|
||||
}
|
||||
|
||||
export function fmtDuration(ms: number): string {
|
||||
if (ms < 1000) return `${Math.round(ms)}ms`;
|
||||
if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
|
||||
if (ms < 3600000) {
|
||||
const m = Math.floor(ms / 60000);
|
||||
const s = Math.floor((ms % 60000) / 1000);
|
||||
return `${m}m ${s}s`;
|
||||
}
|
||||
const h = Math.floor(ms / 3600000);
|
||||
const m = Math.floor((ms % 3600000) / 60000);
|
||||
return `${h}h ${m}m`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user