import type { AgentConfig, PluginSetupContext, WorkspaceInfo } from "@cline/shared"; import type { PluginLoadDiagnostics } from "./plugin-load-report"; import type { PluginTargeting } from "./plugin-targeting"; export type SandboxedPluginSetupContext = Pick; export interface PluginSandboxOptions extends PluginTargeting { pluginPaths: string[]; exportName?: string; /** * Max wall time for plugin module imports. Defaults to 4000 ms; falls back * to the `CLINE_PLUGIN_IMPORT_TIMEOUT_MS` env var when this option is not * set, allowing slower hosts (Windows cold-start, CI without warm caches) * to raise the ceiling without touching code. */ importTimeoutMs?: number; hookTimeoutMs?: number; contributionTimeoutMs?: number; onEvent?: (event: { name: string; payload?: unknown; }) => void; /** * The session's working directory. Forwarded to the sandbox subprocess so * that `process.cwd()` returns the correct path inside the sandbox even * when `--cwd` was passed without calling `process.chdir()` on the host. */ cwd?: string; /** * Structured workspace and git metadata (branch, commit, remotes) generated * at session startup. Forwarded to plugins via PluginSetupCtx.workspaceInfo * so they can inspect git state without running their own commands. */ workspaceInfo?: WorkspaceInfo; session?: SandboxedPluginSetupContext["session"]; client?: SandboxedPluginSetupContext["client"]; user?: SandboxedPluginSetupContext["user"]; /** Enables a logger bridge that forwards sandbox log calls to the host. */ logger?: SandboxedPluginSetupContext["logger"]; } export declare function loadSandboxedPlugins(options: PluginSandboxOptions): Promise<{ extensions: AgentConfig["extensions"]; pluginPaths: string[]; shutdown: () => Promise; } & PluginLoadDiagnostics>;