feat: Page AI Reasonix desktop session alignment, settings IA cleanup, knowledge RAG hardening
- ACP client/session manager: Reasonix desktop live session context - Hermes tools: knowledge_rag tool manifest and skill updates - Browser runtime: sidebar page AI permission/profile/render/session/tree modules - Routes: hermes_client, hermes_tools, knowledge_rag, web_shell - Scripts: reasonix ACP wrapper, LightRAG MCP, smoke tasks 159/558/559/561/562 - Skills: mnote-knowledge-rag and mnote-lightrag-bridge SKILL.md updates
This commit is contained in:
@@ -1684,11 +1684,12 @@ import { createSidebarPageSettingsRuntime } from './sidebar-page-settings-runtim
|
||||
}
|
||||
var controller = typeof AbortController === 'function' ? new AbortController() : null;
|
||||
var timer = 0;
|
||||
var timeout = Math.max(1000, Number(timeoutMs) || 15000);
|
||||
try {
|
||||
if (controller) {
|
||||
timer = window.setTimeout(function() {
|
||||
controller.abort();
|
||||
}, Math.max(1000, Number(timeoutMs) || 15000));
|
||||
}, timeout);
|
||||
}
|
||||
var nextInit = Object.assign({}, init || {});
|
||||
if (controller) nextInit.signal = controller.signal;
|
||||
@@ -1703,6 +1704,16 @@ import { createSidebarPageSettingsRuntime } from './sidebar-page-settings-runtim
|
||||
}
|
||||
}
|
||||
|
||||
function uploadTimeoutMsForFile(file, requestedMs) {
|
||||
var runtimeFn = localUploadRuntimeFunction('uploadTimeoutMsForFile');
|
||||
if (runtimeFn) return runtimeFn(file, requestedMs);
|
||||
var requested = Number(requestedMs) || 0;
|
||||
var size = Number(file && file.size || 0);
|
||||
if (!Number.isFinite(size) || size <= 0) return Math.max(requested, 15000);
|
||||
var sizeBased = 15000 + Math.ceil(size / (1024 * 1024)) * 12000;
|
||||
return Math.min(10 * 60 * 1000, Math.max(requested, 60000, sizeBased));
|
||||
}
|
||||
|
||||
async function insertUploadedAssetIntoEditor(asset, targetRoot) {
|
||||
var runtimeFn = localUploadRuntimeFunction('insertUploadedAssetIntoEditor');
|
||||
if (runtimeFn) {
|
||||
@@ -1842,7 +1853,7 @@ import { createSidebarPageSettingsRuntime } from './sidebar-page-settings-runtim
|
||||
var localResult = await localUploadRuntime(file, plan, {
|
||||
rootUri: rootUri,
|
||||
documentId: documentId,
|
||||
timeoutMs: 15000
|
||||
timeoutMs: uploadTimeoutMsForFile(file, 15000)
|
||||
});
|
||||
localPayload = localResult && localResult.asset ? { asset: localResult.asset } : null;
|
||||
} else {
|
||||
@@ -1857,7 +1868,7 @@ import { createSidebarPageSettingsRuntime } from './sidebar-page-settings-runtim
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
body: localForm
|
||||
}, 15000, '本地上传');
|
||||
}, uploadTimeoutMsForFile(file, 15000), '本地上传');
|
||||
localPayload = await localResponse.json().catch(function() { return null; });
|
||||
if (!localResponse.ok || !localPayload || !localPayload.asset) {
|
||||
throw new Error(localPayload && localPayload.error ? localPayload.error : '上传失败');
|
||||
|
||||
Reference in New Issue
Block a user