feat: deepen luker host integration

This commit is contained in:
Youzini-afk
2026-04-15 21:19:36 +08:00
parent 1251938fc6
commit 359a2a07b7
12 changed files with 1637 additions and 59 deletions

View File

@@ -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();