@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/octopus-agent",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "丸子Agent(Octopus Agent)",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": [
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "octopus-skill"
3
- version = "0.0.8"
3
+ version = "0.0.10"
4
4
  description = "丸子Agent(Octopus Agent)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -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, "-m", "octopus_skill.octopus_run", ...process.argv.slice(2)],
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
  }
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.0.8"
3
+ __version__ = "0.0.10"