Give the terminal and folder grant services to each plugin session

Bind the native terminal service and the folder grant service of the
plugin to its ExternalSession. Without this change, api.pty and
api.files are absent.
This commit is contained in:
Knotty Wyvern
2026-10-28 02:01:50 -07:00
parent e83bf46268
commit 374d4db933
+3
View File
@@ -5,6 +5,7 @@ import { listen } from "@tauri-apps/api/event";
import { workspaceList, workspaceRead, workspaceReadBytes, workspaceWrite } from "../workspace/api"; import { workspaceList, workspaceRead, workspaceReadBytes, workspaceWrite } from "../workspace/api";
import { gitApi } from "../git/service"; import { gitApi } from "../git/service";
import { ExternalSession, deadline } from "./externalSession"; import { ExternalSession, deadline } from "./externalSession";
import { filesTransport, ptyTransport } from "./nativeServices";
import { pluginAccess, type PluginTool } from "./access"; import { pluginAccess, type PluginTool } from "./access";
import { containsPane, splitPane, removePane, type SplitLayout } from "../workspace/splitLayout"; import { containsPane, splitPane, removePane, type SplitLayout } from "../workspace/splitLayout";
import type { PluginViewOpenOptions } from "./sdk"; import type { PluginViewOpenOptions } from "./sdk";
@@ -253,6 +254,8 @@ async function activate(row: InstalledPlugin, builtin?: PluginModule) {
const session = new ExternalSession(id, { const session = new ExternalSession(id, {
completionTransport, completionTransport,
git: gitApi, git: gitApi,
pty: ptyTransport,
files: filesTransport(id),
backgrounds: { backgrounds: {
chooseFolder: () => invoke<string | null>('backgrounds_choose_folder', { id }), chooseFolder: () => invoke<string | null>('backgrounds_choose_folder', { id }),
defaultFolder: () => invoke<string>('backgrounds_default_folder', { id }), defaultFolder: () => invoke<string>('backgrounds_default_folder', { id }),