mirror of
https://github.com/cline/cline.git
synced 2026-10-24 02:02:27 +08:00
fix(cli): keep the npm install's on-disk plugin bootstrap
An npm install sets CLINE_WRAPPER_PATH and ships the SDK and its other packages beside the binary, and standalone plugins rely on that host lookup (for example importing yaml without node_modules of their own). Only standalone binaries, which have none of that on disk, switch to the embedded worker.
This commit is contained in:
@@ -24,12 +24,15 @@ import { writeErr } from "./utils/output";
|
||||
|
||||
declare const CLINE_PLUGIN_WORKER_PATH: string | undefined;
|
||||
|
||||
// Compiled executables run plugins in their embedded worker, which serves the
|
||||
// SDK from this build. Override any bootstrap a parent process configured: the
|
||||
// Hub daemon and SSH remotes run this binary with no plugin files beside it.
|
||||
// The subprocess sandbox spawns a separate runtime that cannot read it.
|
||||
// Standalone compiled executables (the desktop's Hub, SSH remotes) have no
|
||||
// plugin files beside them, so plugins run in the embedded worker, which serves
|
||||
// the SDK from this build; override any bootstrap a parent configured. An npm
|
||||
// install (CLINE_WRAPPER_PATH) keeps its on-disk bootstrap, whose host lookup
|
||||
// also gives standalone plugins the install's other packages. The subprocess
|
||||
// sandbox spawns a separate runtime that cannot read the embedded worker.
|
||||
if (
|
||||
typeof CLINE_PLUGIN_WORKER_PATH === "string" &&
|
||||
!process.env.CLINE_WRAPPER_PATH &&
|
||||
process.env.CLINE_PLUGIN_MODE !== "sandbox"
|
||||
) {
|
||||
process.env.CLINE_PLUGIN_BOOTSTRAP_PATH = CLINE_PLUGIN_WORKER_PATH;
|
||||
|
||||
Reference in New Issue
Block a user