@gokulvenkatareddy/cortex 0.1.10 → 0.1.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.
Files changed (3) hide show
  1. package/bin/cortex +19 -18
  2. package/dist/cli.mjs +10 -10
  3. package/package.json +1 -1
package/bin/cortex CHANGED
@@ -1,15 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * CORTEX — Global CLI entry point (CommonJS compatible)
3
+ * CORTEX — Global CLI entry point
4
4
  * Works anywhere: npm install -g @gokulvenkatareddy/cortex
5
- * Config lives in ~/.cortex/.env (the user's machine, NOT this package).
5
+ * Config lives in ~/.cortex/.env
6
6
  */
7
7
 
8
- const { execFileSync, spawn } = require('child_process');
9
- const fs = require('fs');
10
- const os = require('os');
11
- const path = require('path');
8
+ import { execFileSync, spawn } from 'child_process';
9
+ import fs from 'fs';
10
+ import os from 'os';
11
+ import path from 'path';
12
+ import { fileURLToPath } from 'url';
12
13
 
14
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
15
  const ROOT = path.resolve(__dirname, '..');
14
16
  const CLI_PATH = path.join(ROOT, 'dist', 'cli.mjs');
15
17
  const WIZARD = path.join(ROOT, 'scripts', 'setup-wizard.ts');
@@ -21,17 +23,17 @@ const args = process.argv.slice(2);
21
23
 
22
24
  function loadUserConfig() {
23
25
  if (!fs.existsSync(CONFIG_ENV)) return {};
24
- const lines = fs.readFileSync(CONFIG_ENV, 'utf8').split('\n');
25
- const env = {};
26
- for (const line of lines) {
27
- const m = line.match(/^([A-Z_]+[A-Z0-9_]*)=(.+)$/);
26
+ var lines = fs.readFileSync(CONFIG_ENV, 'utf8').split('\n');
27
+ var env = {};
28
+ for (var i = 0; i < lines.length; i++) {
29
+ var m = lines[i].match(/^([A-Z_][A-Z0-9_]*)=(.+)$/);
28
30
  if (m) env[m[1]] = m[2].trim();
29
31
  }
30
32
  return env;
31
33
  }
32
34
 
33
35
  function isConfigured() {
34
- const env = loadUserConfig();
36
+ var env = loadUserConfig();
35
37
  return !!(
36
38
  env['NVIDIA_API_KEY'] ||
37
39
  env['OPENAI_API_KEY'] ||
@@ -45,13 +47,13 @@ function isConfigured() {
45
47
  }
46
48
 
47
49
  function runWizard() {
48
- const runners = [
50
+ var runners = [
49
51
  ['bun', [WIZARD]],
50
52
  ['npx', ['--yes', 'tsx', WIZARD]],
51
53
  ];
52
- for (const [cmd, cmdArgs] of runners) {
54
+ for (var i = 0; i < runners.length; i++) {
53
55
  try {
54
- execFileSync(cmd, cmdArgs, { stdio: 'inherit', cwd: ROOT });
56
+ execFileSync(runners[i][0], runners[i][1], { stdio: 'inherit', cwd: ROOT });
55
57
  return;
56
58
  } catch (e) {
57
59
  continue;
@@ -66,9 +68,9 @@ function launchCortex(extraEnv) {
66
68
  console.error('\n❌ dist/cli.mjs not found.\n');
67
69
  process.exit(1);
68
70
  }
69
- const userConfig = loadUserConfig();
70
- const mergedEnv = Object.assign({}, process.env, userConfig, extraEnv || {});
71
- const proc = spawn('node', [CLI_PATH].concat(args), {
71
+ var userConfig = loadUserConfig();
72
+ var mergedEnv = Object.assign({}, process.env, userConfig, extraEnv || {});
73
+ var proc = spawn('node', [CLI_PATH].concat(args), {
72
74
  stdio: 'inherit',
73
75
  cwd: ROOT,
74
76
  env: mergedEnv,
@@ -76,7 +78,6 @@ function launchCortex(extraEnv) {
76
78
  proc.on('exit', function(code) { process.exit(code || 0); });
77
79
  }
78
80
 
79
- // ─── Entry point ───────────────────────────────────────────────────────────
80
81
  if (args[0] === 'setup' || args[0] === 'init' || args[0] === 'configure') {
81
82
  runWizard();
82
83
  launchCortex();
package/dist/cli.mjs CHANGED
@@ -367814,7 +367814,7 @@ function getCORTEXEnvMetadata() {
367814
367814
  function getBuildAgeMinutes() {
367815
367815
  if (false)
367816
367816
  ;
367817
- const buildTime = new Date("2026-05-07T10:37:38.396Z").getTime();
367817
+ const buildTime = new Date("2026-05-07T10:44:08.571Z").getTime();
367818
367818
  if (isNaN(buildTime))
367819
367819
  return;
367820
367820
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -394605,7 +394605,7 @@ function buildPrimarySection() {
394605
394605
  }, undefined, false, undefined, this);
394606
394606
  return [{
394607
394607
  label: "Version",
394608
- value: "0.1.10"
394608
+ value: "0.1.11"
394609
394609
  }, {
394610
394610
  label: "Session name",
394611
394611
  value: nameValue
@@ -460184,7 +460184,7 @@ var init_bridge_kick = __esm(() => {
460184
460184
  var call60 = async () => {
460185
460185
  return {
460186
460186
  type: "text",
460187
- value: `${"99.0.0"} (built ${"2026-05-07T10:37:38.396Z"})`
460187
+ value: `${"99.0.0"} (built ${"2026-05-07T10:44:08.571Z"})`
460188
460188
  };
460189
460189
  }, version2, version_default;
460190
460190
  var init_version = __esm(() => {
@@ -534314,7 +534314,7 @@ function WelcomeV2() {
534314
534314
  dimColor: true,
534315
534315
  children: [
534316
534316
  "v",
534317
- "0.1.10",
534317
+ "0.1.11",
534318
534318
  " "
534319
534319
  ]
534320
534320
  }, undefined, true, undefined, this)
@@ -534514,7 +534514,7 @@ function WelcomeV2() {
534514
534514
  dimColor: true,
534515
534515
  children: [
534516
534516
  "v",
534517
- "0.1.10",
534517
+ "0.1.11",
534518
534518
  " "
534519
534519
  ]
534520
534520
  }, undefined, true, undefined, this)
@@ -534740,7 +534740,7 @@ function AppleTerminalWelcomeV2(t0) {
534740
534740
  dimColor: true,
534741
534741
  children: [
534742
534742
  "v",
534743
- "0.1.10",
534743
+ "0.1.11",
534744
534744
  " "
534745
534745
  ]
534746
534746
  }, undefined, true, undefined, this);
@@ -534994,7 +534994,7 @@ function AppleTerminalWelcomeV2(t0) {
534994
534994
  dimColor: true,
534995
534995
  children: [
534996
534996
  "v",
534997
- "0.1.10",
534997
+ "0.1.11",
534998
534998
  " "
534999
534999
  ]
535000
535000
  }, undefined, true, undefined, this);
@@ -554875,7 +554875,7 @@ Usage: cortex --remote "your task description"`, () => gracefulShutdown(1));
554875
554875
  pendingHookMessages
554876
554876
  }, renderAndRun);
554877
554877
  }
554878
- }).version("0.1.10 (CORTEX)", "-v, --version", "Output the version number");
554878
+ }).version("0.1.11 (CORTEX)", "-v, --version", "Output the version number");
554879
554879
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
554880
554880
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
554881
554881
  if (canUserConfigureAdvisor()) {
@@ -555470,7 +555470,7 @@ if (false) {}
555470
555470
  async function main2() {
555471
555471
  const args = process.argv.slice(2);
555472
555472
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
555473
- const v = typeof MACRO !== "undefined" ? "0.1.10" : "99.0.0-dev";
555473
+ const v = typeof MACRO !== "undefined" ? "0.1.11" : "99.0.0-dev";
555474
555474
  console.log(`${v} (CORTEX)`);
555475
555475
  return;
555476
555476
  }
@@ -555655,4 +555655,4 @@ ${DIM4} session id:${RESET4} ${BOLD2}${handle.sessionId}${RESET4} ${DIM4}(rotat
555655
555655
  }
555656
555656
  main2();
555657
555657
 
555658
- //# debugId=AAB29BFC16F3829C64756E2164756E21
555658
+ //# debugId=805ACAE77880D8DA64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gokulvenkatareddy/cortex",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "CORTEX — Autonomous AGI Terminal. Any LLM, one command. NVIDIA, OpenAI, Gemini, Groq, Ollama and more.",
5
5
  "type": "module",
6
6
  "bin": {