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 ...@@ -7,4 +7,7 @@ lxml==5.3.0
pypdf==5.4.0 pypdf==5.4.0
python-docx==1.1.2 python-docx==1.1.2
charset-normalizer==3.4.1 charset-normalizer==3.4.1
pyyaml==6.0.2 pyyaml==6.0.2
\ No newline at end of file pillow==11.3.0
python-dotenv==1.2.2
playwright==1.50.0
...@@ -33,6 +33,7 @@ export interface RuntimeResolvedPaths { ...@@ -33,6 +33,7 @@ export interface RuntimeResolvedPaths {
defaultConfigPath: string; defaultConfigPath: string;
pythonExecutable: string; pythonExecutable: string;
pythonManifestPath: string; pythonManifestPath: string;
playwrightBrowsersPath: string;
managedConfigPath: string; managedConfigPath: string;
readmePath: string; readmePath: string;
runtimeDataDir: string; runtimeDataDir: string;
...@@ -151,7 +152,10 @@ const PYTHON_RUNTIME_IMPORTS = [ ...@@ -151,7 +152,10 @@ const PYTHON_RUNTIME_IMPORTS = [
["pypdf", "pypdf"], ["pypdf", "pypdf"],
["python-docx", "docx"], ["python-docx", "docx"],
["charset-normalizer", "charset_normalizer"], ["charset-normalizer", "charset_normalizer"],
["pyyaml", "yaml"] ["pyyaml", "yaml"],
["pillow", "PIL"],
["python-dotenv", "dotenv"],
["playwright", "playwright"]
] as const; ] as const;
function formatExecError(error: unknown): string { function formatExecError(error: unknown): string {
...@@ -601,6 +605,7 @@ export class RuntimeManager extends EventEmitter { ...@@ -601,6 +605,7 @@ export class RuntimeManager extends EventEmitter {
defaultConfigPath: path.join(this.vendorRuntimeDir, "config", "openclaw.json"), defaultConfigPath: path.join(this.vendorRuntimeDir, "config", "openclaw.json"),
pythonExecutable: path.join(this.vendorRuntimeDir, "python", "python.exe"), pythonExecutable: path.join(this.vendorRuntimeDir, "python", "python.exe"),
pythonManifestPath: path.join(this.vendorRuntimeDir, "python", "python-manifest.json"), 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"), managedConfigPath: path.join(this.runtimeDataDir, "state", "openclaw.runtime.json"),
readmePath: path.join(this.vendorRuntimeDir, "README.md"), readmePath: path.join(this.vendorRuntimeDir, "README.md"),
runtimeDataDir: this.runtimeDataDir, runtimeDataDir: this.runtimeDataDir,
...@@ -1251,6 +1256,7 @@ export class RuntimeManager extends EventEmitter { ...@@ -1251,6 +1256,7 @@ export class RuntimeManager extends EventEmitter {
childEnv.OPENCLAW_HOME = this.runtimeDataDir; childEnv.OPENCLAW_HOME = this.runtimeDataDir;
childEnv.OPENCLAW_STATE_DIR = paths.runtimeStateDir; childEnv.OPENCLAW_STATE_DIR = paths.runtimeStateDir;
childEnv.OPENCLAW_CONFIG_PATH = managedConfigPath; childEnv.OPENCLAW_CONFIG_PATH = managedConfigPath;
childEnv.PLAYWRIGHT_BROWSERS_PATH = paths.playwrightBrowsersPath;
childEnv.PYTHONUTF8 = "1"; childEnv.PYTHONUTF8 = "1";
childEnv.PYTHONIOENCODING = "utf-8"; childEnv.PYTHONIOENCODING = "utf-8";
childEnv.PATH = [ childEnv.PATH = [
......
...@@ -10,6 +10,7 @@ ode/node.exe ...@@ -10,6 +10,7 @@ ode/node.exe
- python/python.exe - python/python.exe
- python/python-manifest.json - python/python-manifest.json
- python/runtime-requirements.lock.txt - python/runtime-requirements.lock.txt
- playwright-browsers/
Mutable runtime data lives outside the installer payload and should be created under Electron userData/runtime/. 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