@roll-agent/octopus-agent 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -91,24 +91,22 @@ if (!python) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
const packageRoot = path.resolve(__dirname, "..");
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
const PYTHON_BOOTSTRAP = [
|
|
95
|
+
"import runpy",
|
|
96
|
+
"import sys",
|
|
97
|
+
"from pathlib import Path",
|
|
98
|
+
"package_root = Path(sys.argv[1]).resolve()",
|
|
99
|
+
"sys.path.insert(0, str(package_root / 'src'))",
|
|
100
|
+
"sys.path.insert(0, str(package_root))",
|
|
101
|
+
"sys.argv = ['octopus_skill.octopus_run', *sys.argv[2:]]",
|
|
102
|
+
"runpy.run_module('octopus_skill.octopus_run', run_name='__main__', alter_sys=True)",
|
|
103
|
+
].join("; ");
|
|
102
104
|
|
|
103
105
|
const child = spawn(
|
|
104
106
|
python.command,
|
|
105
|
-
[...python.args, "-
|
|
107
|
+
[...python.args, "-c", PYTHON_BOOTSTRAP, packageRoot, ...process.argv.slice(2)],
|
|
106
108
|
{
|
|
107
109
|
cwd: packageRoot,
|
|
108
|
-
env: {
|
|
109
|
-
...process.env,
|
|
110
|
-
PYTHONPATH: buildPythonPath(),
|
|
111
|
-
},
|
|
112
110
|
stdio: "inherit",
|
|
113
111
|
windowsHide: true,
|
|
114
112
|
}
|