better-codex 0.2.3 → 0.2.4

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.
@@ -162,8 +162,14 @@ const findRoot = (explicit) => {
162
162
  throw new Error(`Specified root does not contain apps/: ${explicit}`);
163
163
  }
164
164
 
165
- // Prefer the directory the command is executed from (or an ancestor),
166
- // never the installed package directory.
165
+ // First, check if apps/ exists relative to this script (npm global install).
166
+ const scriptDir = __dirname;
167
+ const packageRoot = dirname(scriptDir);
168
+ if (isRoot(packageRoot)) {
169
+ return packageRoot;
170
+ }
171
+
172
+ // Fall back to searching from cwd (for development).
167
173
  let current = resolve(process.cwd());
168
174
  for (let depth = 0; depth < 8; depth += 1) {
169
175
  if (isRoot(current)) {
@@ -230,7 +236,8 @@ const runWeb = (options) => {
230
236
  log.success(`Bun ${c.dim}v${bunVersion}${c.reset}`);
231
237
 
232
238
  const root = findRoot(options.root);
233
- log.success(`Project root: ${c.dim}${root}${c.reset}`);
239
+ const workspaceDir = resolve(process.cwd());
240
+ log.success(`Workspace: ${c.dim}${workspaceDir}${c.reset}`);
234
241
 
235
242
  const backendDir = join(root, 'apps', 'backend');
236
243
  const webDir = join(root, 'apps', 'web');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-codex",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Web launcher for Codex Hub",
5
5
  "bin": {
6
6
  "better-codex": "bin/better-codex.cjs"