feat(text): refactored text processing with UTF-16 optimization and ANSI state bitflags
- Added `visibleWidth()` function to measure visible text width while excluding ANSI codes. - Optimized text processing from UTF-8 to UTF-16 implementation with direct JsString handling for improved performance. - Refactored ANSI state tracking to use bitflags-based SgrState struct instead of individual boolean fields for more efficient storage. - Introduced ColorCode enum to represent color codes (Basic, Indexed, Rgb) for better type safety. - Added comprehensive test coverage for UTF-16 text processing, ANSI detection, and width calculations. - Updated napi feature from 'napi8' to 'napi10' and added unicode-segmentation dependency.
This commit is contained in:
@@ -135,7 +135,7 @@ function resolveModelOverride(
|
||||
): { model?: Model<Api>; thinkingLevel?: ThinkingLevel } {
|
||||
if (modelPatterns.length === 0) return {};
|
||||
const matchPreferences = { usageOrder: settings?.getStorage()?.getModelUsageOrder() };
|
||||
const roles = settings?.serialize().modelRoles as Record<string, string> | undefined;
|
||||
const roles = settings?.getGroup("modelRoles");
|
||||
for (const pattern of modelPatterns) {
|
||||
const normalized = pattern.trim().toLowerCase();
|
||||
if (!normalized || DEFAULT_MODEL_ALIASES.has(normalized)) {
|
||||
|
||||
Reference in New Issue
Block a user