Harden auth/vault path sanitization and clean WeKnora docs
This commit is contained in:
@@ -14,8 +14,21 @@ export function createSidebarPageAiRuntime(context) {
|
||||
|
||||
function openPageAiDrawer() {
|
||||
// 产品唯一入口:Pi Lab。旧 Hermes/OpenCode/Board drawer 不再打开。
|
||||
if (window.createSidebarPageAiPiLabRuntime) {
|
||||
if (typeof window.createSidebarPageAiPiLabRuntime !== 'function') {
|
||||
console.warn('[page-ai] Pi Lab runtime not loaded');
|
||||
if (window.mnote && typeof window.mnote.toast === 'function') {
|
||||
window.mnote.toast('Page AI 运行时未加载', { kind: 'warning' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
window.createSidebarPageAiPiLabRuntime({});
|
||||
} catch (err) {
|
||||
console.error('[page-ai] Pi Lab runtime init failed', err);
|
||||
if (window.mnote && typeof window.mnote.toast === 'function') {
|
||||
window.mnote.toast('Page AI 启动失败', { kind: 'error' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
window.postMessage({ source: 'mnote-sidebar', type: 'mnote:pi-lab-show' }, window.location.origin);
|
||||
if (pageUiState) pageUiState.pageAiOpen = true;
|
||||
|
||||
Reference in New Issue
Block a user