adelie-ai 0.2.9 → 0.2.11

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.
@@ -13,4 +13,4 @@ def _get_version() -> str:
13
13
  pass
14
14
  return "0.0.0"
15
15
 
16
- __version__ = "0.2.9"
16
+ __version__ = "0.2.11"
@@ -84,7 +84,13 @@ def cmd_init(args) -> None:
84
84
  """Initialize a new Adelie workspace."""
85
85
  from adelie import registry
86
86
 
87
- target = Path(args.directory).resolve()
87
+ # Resolve relative to user's actual CWD (ADELIE_CWD), not the Python process
88
+ # cwd (which is set to PKG_ROOT so that 'from adelie import ...' works).
89
+ import os
90
+ user_cwd = Path(os.environ.get("ADELIE_CWD", os.getcwd())).resolve()
91
+ raw_dir = args.directory if args.directory != "." else str(user_cwd)
92
+ target = (user_cwd / raw_dir).resolve() if not Path(raw_dir).is_absolute() else Path(raw_dir).resolve()
93
+
88
94
  adelie_dir = target / ".adelie"
89
95
 
90
96
  if adelie_dir.exists() and not args.force:
package/bin/adelie.js CHANGED
@@ -67,15 +67,15 @@ function ensureVenv() {
67
67
 
68
68
  ensureVenv();
69
69
 
70
- const child = spawn(PYTHON_BIN, [CLI_PY, ...process.argv.slice(2)], {
71
- cwd: process.cwd(),
70
+ // Run adelie as a module so Python adds PKG_ROOT to sys.path automatically.
71
+ // ADELIE_CWD preserves the user's actual working directory for workspace detection.
72
+ const child = spawn(PYTHON_BIN, ["-m", "adelie.cli", ...process.argv.slice(2)], {
73
+ cwd: PKG_ROOT,
72
74
  stdio: "inherit",
73
75
  env: {
74
76
  ...process.env,
75
77
  ADELIE_PKG_ROOT: PKG_ROOT,
76
78
  ADELIE_CWD: process.cwd(),
77
- // Ensure 'adelie' package is importable regardless of install method
78
- PYTHONPATH: PKG_ROOT + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : ""),
79
79
  },
80
80
  });
81
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adelie-ai",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Adelie — Self-Communicating Autonomous AI Loop CLI",
5
5
  "bin": {
6
6
  "adelie": "bin/adelie.js"