diff --git a/frontend/src/lib/plugin-host/VerstakPluginAPI.js b/frontend/src/lib/plugin-host/VerstakPluginAPI.js index 4ba0d31..fc68dd6 100644 --- a/frontend/src/lib/plugin-host/VerstakPluginAPI.js +++ b/frontend/src/lib/plugin-host/VerstakPluginAPI.js @@ -225,6 +225,23 @@ export function createPluginAPI(pluginId) { } }, + backend: { + call: async function(method, ...args) { + assertActive('backend.call(' + method + ')'); + try { + const App = window['go']?.['api']?.['App']; + if (!App || typeof App[method] !== 'function') { + throw new Error('Backend method not found: ' + method); + } + const result = await App[method](...args); + return result; + } catch (e) { + const message = e && e.message ? e.message : String(e); + throw new Error('[plugin:' + pluginId + '] backend.call(' + method + ') failed: ' + message); + } + } + }, + workbench: { openResource: async function(request) { assertActive('workbench.openResource'); diff --git a/frontend/src/lib/shell/WorkspaceTree.svelte b/frontend/src/lib/shell/WorkspaceTree.svelte index e9eaa92..abf3dd4 100644 --- a/frontend/src/lib/shell/WorkspaceTree.svelte +++ b/frontend/src/lib/shell/WorkspaceTree.svelte @@ -1,7 +1,7 @@ -{#if depth === 0} -