@agentrix/cli 0.0.7 → 0.0.8

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/README.md CHANGED
@@ -64,8 +64,8 @@ This command will:
64
64
  You can also upgrade using npm directly:
65
65
 
66
66
  ```bash
67
- # Upgrade to latest version
68
- npm update -g @agentrix/cli
67
+ # Upgrade to latest version (fastest)
68
+ npm install -g @agentrix/cli@latest
69
69
 
70
70
  # Check installed version
71
71
  agentrix --version
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ var chalk = require('chalk');
6
6
  var shared = require('@agentrix/shared');
7
7
  var node_crypto = require('node:crypto');
8
8
  var axios = require('axios');
9
- var _package = require('./logger-CqXZ3EDu.cjs');
9
+ var _package = require('./logger-CNLPJOjS.cjs');
10
10
  var fs$1 = require('node:fs');
11
11
  var node_readline = require('node:readline');
12
12
  var fs = require('fs');
@@ -12482,15 +12482,29 @@ const VALID_HOOK_NAMES = [
12482
12482
  ];
12483
12483
  async function loadHooks(claudeDir) {
12484
12484
  const hooksDir = require$$1.join(claudeDir, "hooks");
12485
- const hooksEntry = require$$1.join(hooksDir, "dist", "index.js");
12486
12485
  if (!fs.existsSync(hooksDir)) {
12487
12486
  return {};
12488
12487
  }
12489
- if (!fs.existsSync(hooksEntry)) {
12488
+ const entryPoints = [
12489
+ require$$1.join(hooksDir, "dist", "index.mjs"),
12490
+ require$$1.join(hooksDir, "dist", "index.js"),
12491
+ require$$1.join(hooksDir, "index.mjs"),
12492
+ require$$1.join(hooksDir, "index.js")
12493
+ ];
12494
+ let hooksEntry = null;
12495
+ for (const entry of entryPoints) {
12496
+ if (fs.existsSync(entry)) {
12497
+ hooksEntry = entry;
12498
+ break;
12499
+ }
12500
+ }
12501
+ if (!hooksEntry) {
12490
12502
  console.warn(`[Hook Loader] Hooks not built: ${hooksDir}`);
12491
12503
  console.warn("[Hook Loader] To build hooks, run:");
12492
12504
  console.warn(`[Hook Loader] cd ${hooksDir}`);
12493
12505
  console.warn("[Hook Loader] npm install && npm run build");
12506
+ console.warn("[Hook Loader] Or place hooks directly in:");
12507
+ console.warn(`[Hook Loader] ${require$$1.join(hooksDir, "index.js")} or ${require$$1.join(hooksDir, "index.mjs")}`);
12494
12508
  return {};
12495
12509
  }
12496
12510
  try {
@@ -16642,19 +16656,28 @@ function displayUpgradeNotification(result) {
16642
16656
  function isAutoUpgradeDisabled() {
16643
16657
  return process.env.AGENTRIX_DISABLE_AUTO_UPGRADE === "true";
16644
16658
  }
16645
- async function performAutoUpgrade() {
16659
+ async function performAutoUpgrade(upgradeCheck) {
16646
16660
  try {
16647
16661
  const { execSync: execSync2 } = await import('child_process');
16648
16662
  console.log("");
16649
- console.log(chalk.blue("\u{1F504} Auto-upgrading Agentrix CLI..."));
16650
- execSync2("npm update -g @agentrix/cli", { stdio: "inherit" });
16663
+ if (!upgradeCheck) {
16664
+ console.log(chalk.blue("\u{1F504} Checking for upgrades..."));
16665
+ upgradeCheck = await checkForUpgrades();
16666
+ }
16667
+ if (!upgradeCheck.hasUpgrade) {
16668
+ console.log(chalk.green("\u2713 Already on latest version"));
16669
+ console.log("");
16670
+ return true;
16671
+ }
16672
+ console.log(chalk.blue(`\u{1F504} Upgrading from ${upgradeCheck.currentVersion} to ${upgradeCheck.latestVersion}...`));
16673
+ execSync2("npm install -g @agentrix/cli@latest", { stdio: "inherit" });
16651
16674
  console.log(chalk.green("\u2713 Upgrade complete"));
16652
16675
  console.log("");
16653
16676
  return true;
16654
16677
  } catch (error) {
16655
16678
  console.log("");
16656
16679
  console.log(chalk.yellow("\u26A0\uFE0F Auto-upgrade failed"));
16657
- console.log(chalk.dim(" You can upgrade manually with: npm update -g @agentrix/cli"));
16680
+ console.log(chalk.dim(" You can upgrade manually with: npm install -g @agentrix/cli@latest"));
16658
16681
  console.log("");
16659
16682
  return false;
16660
16683
  }
@@ -16699,7 +16722,7 @@ cli.command("upgrade", "Upgrade CLI to the latest version", {}, async (argv) =>
16699
16722
  }
16700
16723
  }
16701
16724
  try {
16702
- const { version } = await Promise.resolve().then(function () { return require('./logger-CqXZ3EDu.cjs'); }).then(function (n) { return n._package; });
16725
+ const { version } = await Promise.resolve().then(function () { return require('./logger-CNLPJOjS.cjs'); }).then(function (n) { return n._package; });
16703
16726
  console.log(chalk.green(`
16704
16727
  \u2713 Now running version: ${version}`));
16705
16728
  } catch {
@@ -16872,25 +16895,15 @@ cli.command(
16872
16895
  if (autoUpgradeDisabled) {
16873
16896
  displayUpgradeNotification(upgradeResult);
16874
16897
  } else {
16875
- const upgraded = await performAutoUpgrade();
16876
- if (upgraded) {
16877
- console.log(chalk.green("\u2713 Restarting with new version..."));
16878
- console.log("");
16879
- const { execSync } = await import('child_process');
16880
- try {
16881
- execSync("agentrix start", {
16882
- stdio: "inherit",
16883
- env: {
16884
- ...process.env,
16885
- // Set flag to prevent infinite upgrade loop
16886
- AGENTRIX_SKIP_UPGRADE_CHECK: "true"
16887
- }
16888
- });
16889
- process.exit(0);
16890
- } catch (error) {
16891
- console.log(chalk.yellow("\u26A0\uFE0F Failed to restart, continuing with upgrade..."));
16892
- }
16893
- }
16898
+ console.log(chalk.blue("\u{1F504} Starting upgrade in background..."));
16899
+ console.log(chalk.dim(` Upgrading from ${upgradeResult.currentVersion} to ${upgradeResult.latestVersion}`));
16900
+ console.log("");
16901
+ const upgradeProcess = spawnAgentrixCLI(["upgrade"], {
16902
+ detached: true,
16903
+ stdio: "ignore",
16904
+ env: process.env
16905
+ });
16906
+ upgradeProcess.unref();
16894
16907
  }
16895
16908
  }
16896
16909
  const wasRunning = await isLatestDaemonRunning();
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import chalk from 'chalk';
4
4
  import { encodeBase64, createKeyPairWithUit8Array, encryptMachineEncryptionKey, generateAESKey, decodeBase64, decryptWithEphemeralKey, createEventId, encryptFileContent, machineAuth, encryptSdkMessage, decryptSdkMessage, loadAgentConfig, getAgentContext, workerAuth } from '@agentrix/shared';
5
5
  import { randomBytes, randomUUID as randomUUID$1 } from 'node:crypto';
6
6
  import axios from 'axios';
7
- import { m as machine, l as logger, p as projectPath, a as packageJson, c as createLogger, g as getLogPath, b as logger$1 } from './logger-CE8nWMZI.mjs';
7
+ import { m as machine, l as logger, p as projectPath, a as packageJson, c as createLogger, g as getLogPath, b as logger$1 } from './logger-D8V27PkS.mjs';
8
8
  import * as fs from 'node:fs';
9
9
  import { existsSync, rmSync, mkdirSync, readdirSync, createWriteStream } from 'node:fs';
10
10
  import { createInterface } from 'node:readline';
@@ -12462,15 +12462,29 @@ const VALID_HOOK_NAMES = [
12462
12462
  ];
12463
12463
  async function loadHooks(claudeDir) {
12464
12464
  const hooksDir = join(claudeDir, "hooks");
12465
- const hooksEntry = join(hooksDir, "dist", "index.js");
12466
12465
  if (!existsSync$1(hooksDir)) {
12467
12466
  return {};
12468
12467
  }
12469
- if (!existsSync$1(hooksEntry)) {
12468
+ const entryPoints = [
12469
+ join(hooksDir, "dist", "index.mjs"),
12470
+ join(hooksDir, "dist", "index.js"),
12471
+ join(hooksDir, "index.mjs"),
12472
+ join(hooksDir, "index.js")
12473
+ ];
12474
+ let hooksEntry = null;
12475
+ for (const entry of entryPoints) {
12476
+ if (existsSync$1(entry)) {
12477
+ hooksEntry = entry;
12478
+ break;
12479
+ }
12480
+ }
12481
+ if (!hooksEntry) {
12470
12482
  console.warn(`[Hook Loader] Hooks not built: ${hooksDir}`);
12471
12483
  console.warn("[Hook Loader] To build hooks, run:");
12472
12484
  console.warn(`[Hook Loader] cd ${hooksDir}`);
12473
12485
  console.warn("[Hook Loader] npm install && npm run build");
12486
+ console.warn("[Hook Loader] Or place hooks directly in:");
12487
+ console.warn(`[Hook Loader] ${join(hooksDir, "index.js")} or ${join(hooksDir, "index.mjs")}`);
12474
12488
  return {};
12475
12489
  }
12476
12490
  try {
@@ -16622,19 +16636,28 @@ function displayUpgradeNotification(result) {
16622
16636
  function isAutoUpgradeDisabled() {
16623
16637
  return process.env.AGENTRIX_DISABLE_AUTO_UPGRADE === "true";
16624
16638
  }
16625
- async function performAutoUpgrade() {
16639
+ async function performAutoUpgrade(upgradeCheck) {
16626
16640
  try {
16627
16641
  const { execSync: execSync2 } = await import('child_process');
16628
16642
  console.log("");
16629
- console.log(chalk.blue("\u{1F504} Auto-upgrading Agentrix CLI..."));
16630
- execSync2("npm update -g @agentrix/cli", { stdio: "inherit" });
16643
+ if (!upgradeCheck) {
16644
+ console.log(chalk.blue("\u{1F504} Checking for upgrades..."));
16645
+ upgradeCheck = await checkForUpgrades();
16646
+ }
16647
+ if (!upgradeCheck.hasUpgrade) {
16648
+ console.log(chalk.green("\u2713 Already on latest version"));
16649
+ console.log("");
16650
+ return true;
16651
+ }
16652
+ console.log(chalk.blue(`\u{1F504} Upgrading from ${upgradeCheck.currentVersion} to ${upgradeCheck.latestVersion}...`));
16653
+ execSync2("npm install -g @agentrix/cli@latest", { stdio: "inherit" });
16631
16654
  console.log(chalk.green("\u2713 Upgrade complete"));
16632
16655
  console.log("");
16633
16656
  return true;
16634
16657
  } catch (error) {
16635
16658
  console.log("");
16636
16659
  console.log(chalk.yellow("\u26A0\uFE0F Auto-upgrade failed"));
16637
- console.log(chalk.dim(" You can upgrade manually with: npm update -g @agentrix/cli"));
16660
+ console.log(chalk.dim(" You can upgrade manually with: npm install -g @agentrix/cli@latest"));
16638
16661
  console.log("");
16639
16662
  return false;
16640
16663
  }
@@ -16679,7 +16702,7 @@ cli.command("upgrade", "Upgrade CLI to the latest version", {}, async (argv) =>
16679
16702
  }
16680
16703
  }
16681
16704
  try {
16682
- const { version } = await import('./logger-CE8nWMZI.mjs').then(function (n) { return n._; });
16705
+ const { version } = await import('./logger-D8V27PkS.mjs').then(function (n) { return n._; });
16683
16706
  console.log(chalk.green(`
16684
16707
  \u2713 Now running version: ${version}`));
16685
16708
  } catch {
@@ -16852,25 +16875,15 @@ cli.command(
16852
16875
  if (autoUpgradeDisabled) {
16853
16876
  displayUpgradeNotification(upgradeResult);
16854
16877
  } else {
16855
- const upgraded = await performAutoUpgrade();
16856
- if (upgraded) {
16857
- console.log(chalk.green("\u2713 Restarting with new version..."));
16858
- console.log("");
16859
- const { execSync } = await import('child_process');
16860
- try {
16861
- execSync("agentrix start", {
16862
- stdio: "inherit",
16863
- env: {
16864
- ...process.env,
16865
- // Set flag to prevent infinite upgrade loop
16866
- AGENTRIX_SKIP_UPGRADE_CHECK: "true"
16867
- }
16868
- });
16869
- process.exit(0);
16870
- } catch (error) {
16871
- console.log(chalk.yellow("\u26A0\uFE0F Failed to restart, continuing with upgrade..."));
16872
- }
16873
- }
16878
+ console.log(chalk.blue("\u{1F504} Starting upgrade in background..."));
16879
+ console.log(chalk.dim(` Upgrading from ${upgradeResult.currentVersion} to ${upgradeResult.latestVersion}`));
16880
+ console.log("");
16881
+ const upgradeProcess = spawnAgentrixCLI(["upgrade"], {
16882
+ detached: true,
16883
+ stdio: "ignore",
16884
+ env: process.env
16885
+ });
16886
+ upgradeProcess.unref();
16874
16887
  }
16875
16888
  }
16876
16889
  const wasRunning = await isLatestDaemonRunning();
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var _package = require('./logger-CqXZ3EDu.cjs');
3
+ var _package = require('./logger-CNLPJOjS.cjs');
4
4
  require('winston');
5
5
  require('chalk');
6
6
  require('node:os');
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { M as Machine, l as logger, m as machine } from './logger-CE8nWMZI.mjs';
1
+ export { M as Machine, l as logger, m as machine } from './logger-D8V27PkS.mjs';
2
2
  import 'winston';
3
3
  import 'chalk';
4
4
  import 'node:os';
@@ -13,7 +13,7 @@ var url = require('url');
13
13
 
14
14
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
15
15
  var name = "@agentrix/cli";
16
- var version = "0.0.7";
16
+ var version = "0.0.8";
17
17
  var description = "Mobile and Web client for Claude Code and Codex";
18
18
  var author = "agentrix.xmz.ai";
19
19
  var type = "module";
@@ -185,7 +185,7 @@ var _package = /*#__PURE__*/Object.freeze({
185
185
  version: version
186
186
  });
187
187
 
188
- const __dirname$1 = require$$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('logger-CqXZ3EDu.cjs', document.baseURI).href))));
188
+ const __dirname$1 = require$$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('logger-CNLPJOjS.cjs', document.baseURI).href))));
189
189
  function projectPath() {
190
190
  const path = require$$1.resolve(__dirname$1, "..");
191
191
  return path;
@@ -10,7 +10,7 @@ import { dirname, resolve } from 'path';
10
10
  import { fileURLToPath } from 'url';
11
11
 
12
12
  var name = "@agentrix/cli";
13
- var version = "0.0.7";
13
+ var version = "0.0.8";
14
14
  var description = "Mobile and Web client for Claude Code and Codex";
15
15
  var author = "agentrix.xmz.ai";
16
16
  var type = "module";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrix/cli",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Mobile and Web client for Claude Code and Codex",
5
5
  "author": "agentrix.xmz.ai",
6
6
  "type": "module",