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:
@@ -163,6 +163,50 @@ export function createSidebarPageAiProfileRuntime(context) {
|
||||
});
|
||||
}
|
||||
|
||||
function pageAiSessionStatusFilterValue(session) {
|
||||
var status = String(session && session.status || '').trim();
|
||||
var mode = String(session && (session.runtimeMode || session.mode) || '').trim();
|
||||
if (pageUiState.pageAiActiveSessionId && session && session.id === pageUiState.pageAiActiveSessionId) return 'active';
|
||||
if (session && session.replaySeen) return 'replay_seen';
|
||||
if (mode === 'native_live' || mode === 'cold_resumed' || mode === 'replay_seen') return mode;
|
||||
if (['running', 'tool_calling', 'queued', 'pending', 'acp_pending'].indexOf(status) >= 0) return 'active';
|
||||
if (['failed', 'aborted', 'cancelled', 'canceled'].indexOf(status) >= 0) return 'failed';
|
||||
if (status === 'completed') return 'completed';
|
||||
return status || 'unknown';
|
||||
}
|
||||
|
||||
function pageAiSessionStatusLabel(value) {
|
||||
return {
|
||||
all: '全部状态',
|
||||
active: 'Active',
|
||||
completed: 'Completed',
|
||||
failed: 'Failed',
|
||||
native_live: 'Reasonix native-live',
|
||||
cold_resumed: 'Cold resumed',
|
||||
replay_seen: 'Replay seen',
|
||||
unknown: 'Unknown'
|
||||
}[value] || value;
|
||||
}
|
||||
|
||||
function pageAiSessionStatusFilterOptions(rows) {
|
||||
var byValue = {
|
||||
all: pageAiSessionStatusLabel('all'),
|
||||
active: pageAiSessionStatusLabel('active'),
|
||||
completed: pageAiSessionStatusLabel('completed'),
|
||||
failed: pageAiSessionStatusLabel('failed'),
|
||||
native_live: pageAiSessionStatusLabel('native_live'),
|
||||
cold_resumed: pageAiSessionStatusLabel('cold_resumed'),
|
||||
replay_seen: pageAiSessionStatusLabel('replay_seen')
|
||||
};
|
||||
pageAiNormalizeArray(rows).filter(pageAiVisibleHistorySession).forEach(function(session) {
|
||||
var value = pageAiSessionStatusFilterValue(session);
|
||||
byValue[value] = pageAiSessionStatusLabel(value);
|
||||
});
|
||||
return Object.keys(byValue).map(function(value) {
|
||||
return { value: value, label: byValue[value] };
|
||||
});
|
||||
}
|
||||
|
||||
function pageAiVisibleHistorySession(session) {
|
||||
var source = String(session && session.source || '').trim();
|
||||
var status = String(session && session.status || '').trim();
|
||||
@@ -172,10 +216,11 @@ export function createSidebarPageAiProfileRuntime(context) {
|
||||
|
||||
function pageAiFilteredHistoryRows(rows) {
|
||||
var filterValue = String(pageUiState.pageAiSessionAgentFilter || 'all').trim() || 'all';
|
||||
var statusFilter = String(pageUiState.pageAiSessionStatusFilter || 'all').trim() || 'all';
|
||||
var normalized = pageAiNormalizeArray(rows).filter(pageAiVisibleHistorySession);
|
||||
if (filterValue === 'all') return normalized;
|
||||
return normalized.filter(function(session) {
|
||||
return pageAiSessionAgentFilterValue(session) === filterValue;
|
||||
return (filterValue === 'all' || pageAiSessionAgentFilterValue(session) === filterValue)
|
||||
&& (statusFilter === 'all' || pageAiSessionStatusFilterValue(session) === statusFilter);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -220,6 +265,9 @@ export function createSidebarPageAiProfileRuntime(context) {
|
||||
pageAiSessionAgentLabel,
|
||||
pageAiSessionPreviewText,
|
||||
pageAiSessionAgentFilterOptions,
|
||||
pageAiSessionStatusFilterValue,
|
||||
pageAiSessionStatusLabel,
|
||||
pageAiSessionStatusFilterOptions,
|
||||
pageAiFilteredHistoryRows,
|
||||
pageAiTimestamp,
|
||||
pageAiUsageSummary
|
||||
|
||||
Reference in New Issue
Block a user