feat: vault core/CLI/workbench, vaultd token path, filetree view-state cleanup

Land password-vault dedicated workbench and mnote-vault-core/CLI, agent token
read path design, vault transport split, and retire obsolete filetree smokes.
Ignore local vault reimport scripts that trip secret scanners.
This commit is contained in:
Agent Board
2026-07-24 11:36:06 +08:00
parent b798f628ee
commit bc6f8488ee
41 changed files with 13072 additions and 2316 deletions
@@ -10,15 +10,22 @@ function getSidebarFileTreeClipboard() {
return sidebarFileTreeClipboard;
}
function setSidebarFileTreeClipboard(action, rowIds) {
function setSidebarFileTreeClipboard(action, rowIds, options) {
sidebarFileTreeClipboard = { action: action, rowIds: rowIds };
document.documentElement.setAttribute('data-mnote-filetree-clipboard-action', action);
// Keep product runtimeState / host clipboard in sync (menu paste reads runtimeState).
if (options && typeof options.onClipboardChange === 'function') {
options.onClipboardChange(sidebarFileTreeClipboard);
}
return sidebarFileTreeClipboard;
}
function clearSidebarFileTreeClipboard() {
function clearSidebarFileTreeClipboard(options) {
sidebarFileTreeClipboard = null;
document.documentElement.removeAttribute('data-mnote-filetree-clipboard-action');
if (options && typeof options.onClipboardChange === 'function') {
options.onClipboardChange(null);
}
}
// ─── Keyboard handler ───────────────────────────────────
@@ -31,6 +38,7 @@ function handleFileTreeKeyDown(event, deps) {
var buildSidebarFileTreeContext = deps.buildSidebarFileTreeContext || function() { return {}; };
var evaluateSidebarFileTreeWhen = deps.evaluateSidebarFileTreeWhen || function() { return false; };
var deleteSelectedSidebarFileTreeRows = deps.deleteSelectedSidebarFileTreeRows || function() { return Promise.resolve(); };
var onClipboardChange = deps.onClipboardChange || null;
var keyTarget = event.target;
var fileTreeRootForKey = document.getElementById('sidebar-file-tree-root');
@@ -59,7 +67,9 @@ function handleFileTreeKeyDown(event, deps) {
}).filter(Boolean);
if (selectedRowIds.length > 0) {
event.preventDefault();
setSidebarFileTreeClipboard(shortcutKey === 'x' ? 'cut' : 'copy', selectedRowIds);
setSidebarFileTreeClipboard(shortcutKey === 'x' ? 'cut' : 'copy', selectedRowIds, {
onClipboardChange: onClipboardChange,
});
}
return true;
}
@@ -92,7 +102,7 @@ function handleFileTreeKeyDown(event, deps) {
// ─── 导出 ───────────────────────────────────────────────
window.__mnoteFileTreeKeyboardRuntime = {
sidebarFileTreeClipboard: sidebarFileTreeClipboard,
get sidebarFileTreeClipboard() { return sidebarFileTreeClipboard; },
getSidebarFileTreeClipboard: getSidebarFileTreeClipboard,
setSidebarFileTreeClipboard: setSidebarFileTreeClipboard,
clearSidebarFileTreeClipboard: clearSidebarFileTreeClipboard,