@roll-agent/octopus-agent 0.0.8 → 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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
const { spawn, spawnSync } = require("node:child_process");
|
|
5
|
+
const path = require("node:path");
|
|
5
6
|
|
|
6
7
|
const MIN_MAJOR = 3;
|
|
7
8
|
const MIN_MINOR = 11;
|
|
@@ -89,10 +90,23 @@ if (!python) {
|
|
|
89
90
|
process.exit(1);
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
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("; ");
|
|
104
|
+
|
|
92
105
|
const child = spawn(
|
|
93
106
|
python.command,
|
|
94
|
-
[...python.args, "-
|
|
107
|
+
[...python.args, "-c", PYTHON_BOOTSTRAP, packageRoot, ...process.argv.slice(2)],
|
|
95
108
|
{
|
|
109
|
+
cwd: packageRoot,
|
|
96
110
|
stdio: "inherit",
|
|
97
111
|
windowsHide: true,
|
|
98
112
|
}
|