Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

666 B
Raw Blame
/// #if !BROWSER
import * as path from "path";
/// #endif
import {useShell} from "../../util/pathName";
import {getSettingsWindowHost} from "../setting/windowContext";

export const openBazaarPath = (type: TBazaarType, name: string, storage = false) => {
    const host = getSettingsWindowHost();
    if (host) {
        host.openBazaarPath(type, name, storage);
        return;
    }
    /// #if !BROWSER
    const dataDir = window.siyuan.config.system.dataDir;
    if (!dataDir || !name || (storage && type !== "plugins")) return;
    useShell("openPath", storage ? path.join(dataDir, "storage", "petal", name) : path.join(dataDir, type, name));
    /// #endif
};