@nexus-cortex/tui 4.134.1 → 4.134.3

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/bin/ink-ui.js CHANGED
@@ -16,6 +16,8 @@
16
16
  import { fileURLToPath } from 'url';
17
17
  import { dirname, join } from 'path';
18
18
  import { realpathSync } from 'fs';
19
+ import { createRequire } from 'node:module';
20
+ import { existsSync } from 'node:fs';
19
21
 
20
22
  // Parse CLI arguments (pure — no imports needed)
21
23
  const args = process.argv.slice(2);
@@ -77,7 +79,18 @@ const PKG_ROOT = join(__dirname, '..', '..', '..');
77
79
 
78
80
  // Anchor the install root so .cortex/ config (agents, MCP, etc.) is discoverable
79
81
  // regardless of the cwd the user launches from. Honors a pre-set CORTEX_ROOT.
80
- process.env.CORTEX_ROOT = process.env.CORTEX_ROOT || PKG_ROOT;
82
+ // 2026-11-13 (operator: hosted fuzzycortex reported "no .cortex/orient script"): PKG_ROOT is the monorepo root in a checkout, but in an
83
+ // npm install it is .../node_modules — no .cortex there, so the orient script, builtin agents and skills never resolved for TUI users.
84
+ // Prefer a PKG_ROOT that holds .cortex; else the @nexus-cortex/cli package (the one that ships the scaffold); else PKG_ROOT.
85
+ function __resolveCortexRoot(pkgRoot) {
86
+ try { if (existsSync(join(pkgRoot, '.cortex'))) return pkgRoot; } catch { /* fall through */ }
87
+ try {
88
+ const cli = dirname(createRequire(import.meta.url).resolve('@nexus-cortex/cli/package.json'));
89
+ if (existsSync(join(cli, '.cortex'))) return cli;
90
+ } catch { /* cli not installed alongside */ }
91
+ return pkgRoot;
92
+ }
93
+ process.env.CORTEX_ROOT = process.env.CORTEX_ROOT || __resolveCortexRoot(PKG_ROOT);
81
94
 
82
95
  // Heavy imports — sequential top-level await keeps the original init order
83
96
  // (env bootstrap before anything reads process.env-derived config).
package/bin/launcher.js CHANGED
@@ -16,6 +16,7 @@ import { fileURLToPath } from 'url';
16
16
  import { dirname, join } from 'path';
17
17
  import { existsSync, realpathSync } from 'fs';
18
18
  import http from 'http';
19
+ import { createRequire } from 'node:module';
19
20
  // L-11: @nexus-cortex/core's barrel costs ~1s to load — imported DYNAMICALLY
20
21
  // below so the first-paint banner beats it (static imports hoist).
21
22
 
@@ -31,7 +32,18 @@ const PKG_ROOT = join(CLI_DIR, '..', '..');
31
32
  // Anchor the install root so .cortex/ config (agents, MCP, etc.) is discoverable
32
33
  // regardless of the cwd the user launches from. Honors a pre-set CORTEX_ROOT.
33
34
  // Spawned children inherit this via process.env.
34
- process.env.CORTEX_ROOT = process.env.CORTEX_ROOT || PKG_ROOT;
35
+ // 2026-11-13 (operator: hosted fuzzycortex reported "no .cortex/orient script"): PKG_ROOT is the monorepo root in a checkout, but in an
36
+ // npm install it is .../node_modules — no .cortex there, so the orient script, builtin agents and skills never resolved for TUI users.
37
+ // Prefer a PKG_ROOT that holds .cortex; else the @nexus-cortex/cli package (the one that ships the scaffold); else PKG_ROOT.
38
+ function __resolveCortexRoot(pkgRoot) {
39
+ try { if (existsSync(join(pkgRoot, '.cortex'))) return pkgRoot; } catch { /* fall through */ }
40
+ try {
41
+ const cli = dirname(createRequire(import.meta.url).resolve('@nexus-cortex/cli/package.json'));
42
+ if (existsSync(join(cli, '.cortex'))) return cli;
43
+ } catch { /* cli not installed alongside */ }
44
+ return pkgRoot;
45
+ }
46
+ process.env.CORTEX_ROOT = process.env.CORTEX_ROOT || __resolveCortexRoot(PKG_ROOT);
35
47
 
36
48
  // FIRST PAINT (L-11): the fuzzycortex blank was launcher import cost + the
37
49
  // spawned child's own import graph (~3s of empty screen). Put chrome up
@@ -423,7 +435,7 @@ async function launchCLI() {
423
435
  ...process.env,
424
436
  CORTEX_MODE: mode,
425
437
  CORTEX_SERVER_URL: mode === 'server' ? finalServerUrl : '',
426
- CORTEX_ROOT: PKG_ROOT,
438
+ CORTEX_ROOT: process.env.CORTEX_ROOT,
427
439
  NODE_ENV: isDevMode ? 'development' : 'production',
428
440
  },
429
441
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/tui",
3
- "version": "4.134.1",
3
+ "version": "4.134.3",
4
4
  "description": "Nexus Cortex interactive terminal UI (React/Ink) — the polished cockpit + launchers over @nexus-cortex/cli",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -18,8 +18,8 @@
18
18
  "dev": "tsx watch src/index.ts"
19
19
  },
20
20
  "dependencies": {
21
- "@nexus-cortex/cli": "4.134.1",
22
- "@nexus-cortex/core": "4.134.1",
21
+ "@nexus-cortex/cli": "4.134.3",
22
+ "@nexus-cortex/core": "4.134.3",
23
23
  "chalk": "^4.1.2",
24
24
  "cli-spinners": "^2.9.0",
25
25
  "commander": "^11.0.0",