Commit e74cd2e9 authored by AI-甘富林's avatar AI-甘富林

Wire desktop runtime to bundled browser dependencies

parent e79c52f1
......@@ -7,4 +7,7 @@ lxml==5.3.0
pypdf==5.4.0
python-docx==1.1.2
charset-normalizer==3.4.1
pyyaml==6.0.2
\ No newline at end of file
pyyaml==6.0.2
pillow==11.3.0
python-dotenv==1.2.2
playwright==1.50.0
......@@ -33,6 +33,7 @@ export interface RuntimeResolvedPaths {
defaultConfigPath: string;
pythonExecutable: string;
pythonManifestPath: string;
playwrightBrowsersPath: string;
managedConfigPath: string;
readmePath: string;
runtimeDataDir: string;
......@@ -151,7 +152,10 @@ const PYTHON_RUNTIME_IMPORTS = [
["pypdf", "pypdf"],
["python-docx", "docx"],
["charset-normalizer", "charset_normalizer"],
["pyyaml", "yaml"]
["pyyaml", "yaml"],
["pillow", "PIL"],
["python-dotenv", "dotenv"],
["playwright", "playwright"]
] as const;
function formatExecError(error: unknown): string {
......@@ -601,6 +605,7 @@ export class RuntimeManager extends EventEmitter {
defaultConfigPath: path.join(this.vendorRuntimeDir, "config", "openclaw.json"),
pythonExecutable: path.join(this.vendorRuntimeDir, "python", "python.exe"),
pythonManifestPath: path.join(this.vendorRuntimeDir, "python", "python-manifest.json"),
playwrightBrowsersPath: path.join(this.vendorRuntimeDir, "playwright-browsers"),
managedConfigPath: path.join(this.runtimeDataDir, "state", "openclaw.runtime.json"),
readmePath: path.join(this.vendorRuntimeDir, "README.md"),
runtimeDataDir: this.runtimeDataDir,
......@@ -1251,6 +1256,7 @@ export class RuntimeManager extends EventEmitter {
childEnv.OPENCLAW_HOME = this.runtimeDataDir;
childEnv.OPENCLAW_STATE_DIR = paths.runtimeStateDir;
childEnv.OPENCLAW_CONFIG_PATH = managedConfigPath;
childEnv.PLAYWRIGHT_BROWSERS_PATH = paths.playwrightBrowsersPath;
childEnv.PYTHONUTF8 = "1";
childEnv.PYTHONIOENCODING = "utf-8";
childEnv.PATH = [
......
......@@ -10,6 +10,7 @@ ode/node.exe
- python/python.exe
- python/python-manifest.json
- python/runtime-requirements.lock.txt
- playwright-browsers/
Mutable runtime data lives outside the installer payload and should be created under Electron userData/runtime/.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment