mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
feat: deepen luker host integration
This commit is contained in:
17
llm/llm.js
17
llm/llm.js
@@ -96,10 +96,23 @@ function isVerboseRuntimeDebugEnabled() {
|
||||
return globalThis.__stBmeVerboseDebug === true;
|
||||
}
|
||||
|
||||
function isLightweightHostModeEnabled() {
|
||||
return globalThis.__stBmeLightweightHostMode === true;
|
||||
}
|
||||
|
||||
function getTaskDebugTimelineLimit() {
|
||||
return isLightweightHostModeEnabled() ? 12 : TASK_DEBUG_TIMELINE_LIMIT;
|
||||
}
|
||||
|
||||
function buildPreviewText(value, maxChars = TASK_DEBUG_PREVIEW_MAX_CHARS) {
|
||||
const effectiveMaxChars = isLightweightHostModeEnabled()
|
||||
? Math.min(maxChars, 180)
|
||||
: maxChars;
|
||||
const text = String(value ?? "").replace(/\s+/g, " ").trim();
|
||||
if (!text) return "";
|
||||
return text.length > maxChars ? `${text.slice(0, maxChars)}...` : text;
|
||||
return text.length > effectiveMaxChars
|
||||
? `${text.slice(0, effectiveMaxChars)}...`
|
||||
: text;
|
||||
}
|
||||
|
||||
function summarizeMessageArray(messages = []) {
|
||||
@@ -446,7 +459,7 @@ function recordTaskLlmRequest(taskType, snapshot = {}, options = {}) {
|
||||
);
|
||||
if (timelineEntry) {
|
||||
state.taskTimeline = Array.isArray(state.taskTimeline)
|
||||
? [...state.taskTimeline, timelineEntry].slice(-TASK_DEBUG_TIMELINE_LIMIT)
|
||||
? [...state.taskTimeline, timelineEntry].slice(-getTaskDebugTimelineLimit())
|
||||
: [timelineEntry];
|
||||
}
|
||||
state.updatedAt = new Date().toISOString();
|
||||
|
||||
Reference in New Issue
Block a user