@agentrix/cli 0.0.6 → 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 +8 -10
- package/dist/index.cjs +38 -36
- package/dist/index.mjs +38 -36
- package/dist/lib.cjs +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/{logger-BEumKD6L.cjs → logger-CNLPJOjS.cjs} +2 -2
- package/dist/{logger-DlDcMcE1.mjs → logger-D8V27PkS.mjs} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,27 +47,25 @@ Or add it to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
|
|
|
47
47
|
echo 'export AGENTRIX_DISABLE_UPDATE_CHECK=true' >> ~/.zshrc
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### Manual Upgrade Command
|
|
51
|
+
|
|
52
|
+
You can also trigger an upgrade manually at any time:
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
55
|
agentrix upgrade
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
This command will:
|
|
57
|
-
-
|
|
58
|
-
- Upgrade to the latest version
|
|
59
|
+
- Upgrade to the latest version using npm
|
|
59
60
|
- Automatically restart the daemon if it was running
|
|
60
61
|
|
|
61
|
-
###
|
|
62
|
+
### Using npm Directly
|
|
62
63
|
|
|
63
|
-
You can also upgrade
|
|
64
|
+
You can also upgrade using npm directly:
|
|
64
65
|
|
|
65
66
|
```bash
|
|
66
|
-
#
|
|
67
|
-
npm
|
|
68
|
-
|
|
69
|
-
# Or with yarn
|
|
70
|
-
yarn global upgrade @agentrix/cli
|
|
67
|
+
# Upgrade to latest version (fastest)
|
|
68
|
+
npm install -g @agentrix/cli@latest
|
|
71
69
|
|
|
72
70
|
# Check installed version
|
|
73
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-
|
|
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
|
-
|
|
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,30 +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
|
-
|
|
16650
|
-
|
|
16651
|
-
|
|
16652
|
-
execSync2("yarn --version", { stdio: "ignore" });
|
|
16653
|
-
packageManager = "yarn";
|
|
16654
|
-
} catch {
|
|
16663
|
+
if (!upgradeCheck) {
|
|
16664
|
+
console.log(chalk.blue("\u{1F504} Checking for upgrades..."));
|
|
16665
|
+
upgradeCheck = await checkForUpgrades();
|
|
16655
16666
|
}
|
|
16656
|
-
|
|
16657
|
-
|
|
16658
|
-
|
|
16659
|
-
|
|
16660
|
-
execSync2("npm update -g @agentrix/cli", { stdio: "inherit" });
|
|
16667
|
+
if (!upgradeCheck.hasUpgrade) {
|
|
16668
|
+
console.log(chalk.green("\u2713 Already on latest version"));
|
|
16669
|
+
console.log("");
|
|
16670
|
+
return true;
|
|
16661
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" });
|
|
16662
16674
|
console.log(chalk.green("\u2713 Upgrade complete"));
|
|
16663
16675
|
console.log("");
|
|
16664
16676
|
return true;
|
|
16665
16677
|
} catch (error) {
|
|
16666
16678
|
console.log("");
|
|
16667
16679
|
console.log(chalk.yellow("\u26A0\uFE0F Auto-upgrade failed"));
|
|
16668
|
-
console.log(chalk.dim(" You can upgrade manually with: agentrix
|
|
16680
|
+
console.log(chalk.dim(" You can upgrade manually with: npm install -g @agentrix/cli@latest"));
|
|
16669
16681
|
console.log("");
|
|
16670
16682
|
return false;
|
|
16671
16683
|
}
|
|
@@ -16710,7 +16722,7 @@ cli.command("upgrade", "Upgrade CLI to the latest version", {}, async (argv) =>
|
|
|
16710
16722
|
}
|
|
16711
16723
|
}
|
|
16712
16724
|
try {
|
|
16713
|
-
const { version } = await Promise.resolve().then(function () { return require('./logger-
|
|
16725
|
+
const { version } = await Promise.resolve().then(function () { return require('./logger-CNLPJOjS.cjs'); }).then(function (n) { return n._package; });
|
|
16714
16726
|
console.log(chalk.green(`
|
|
16715
16727
|
\u2713 Now running version: ${version}`));
|
|
16716
16728
|
} catch {
|
|
@@ -16883,25 +16895,15 @@ cli.command(
|
|
|
16883
16895
|
if (autoUpgradeDisabled) {
|
|
16884
16896
|
displayUpgradeNotification(upgradeResult);
|
|
16885
16897
|
} else {
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
...process.env,
|
|
16896
|
-
// Set flag to prevent infinite upgrade loop
|
|
16897
|
-
AGENTRIX_SKIP_UPGRADE_CHECK: "true"
|
|
16898
|
-
}
|
|
16899
|
-
});
|
|
16900
|
-
process.exit(0);
|
|
16901
|
-
} catch (error) {
|
|
16902
|
-
console.log(chalk.yellow("\u26A0\uFE0F Failed to restart, continuing with upgrade..."));
|
|
16903
|
-
}
|
|
16904
|
-
}
|
|
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();
|
|
16905
16907
|
}
|
|
16906
16908
|
}
|
|
16907
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-
|
|
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
|
-
|
|
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,30 +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
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
execSync2("yarn --version", { stdio: "ignore" });
|
|
16633
|
-
packageManager = "yarn";
|
|
16634
|
-
} catch {
|
|
16643
|
+
if (!upgradeCheck) {
|
|
16644
|
+
console.log(chalk.blue("\u{1F504} Checking for upgrades..."));
|
|
16645
|
+
upgradeCheck = await checkForUpgrades();
|
|
16635
16646
|
}
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
execSync2("npm update -g @agentrix/cli", { stdio: "inherit" });
|
|
16647
|
+
if (!upgradeCheck.hasUpgrade) {
|
|
16648
|
+
console.log(chalk.green("\u2713 Already on latest version"));
|
|
16649
|
+
console.log("");
|
|
16650
|
+
return true;
|
|
16641
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" });
|
|
16642
16654
|
console.log(chalk.green("\u2713 Upgrade complete"));
|
|
16643
16655
|
console.log("");
|
|
16644
16656
|
return true;
|
|
16645
16657
|
} catch (error) {
|
|
16646
16658
|
console.log("");
|
|
16647
16659
|
console.log(chalk.yellow("\u26A0\uFE0F Auto-upgrade failed"));
|
|
16648
|
-
console.log(chalk.dim(" You can upgrade manually with: agentrix
|
|
16660
|
+
console.log(chalk.dim(" You can upgrade manually with: npm install -g @agentrix/cli@latest"));
|
|
16649
16661
|
console.log("");
|
|
16650
16662
|
return false;
|
|
16651
16663
|
}
|
|
@@ -16690,7 +16702,7 @@ cli.command("upgrade", "Upgrade CLI to the latest version", {}, async (argv) =>
|
|
|
16690
16702
|
}
|
|
16691
16703
|
}
|
|
16692
16704
|
try {
|
|
16693
|
-
const { version } = await import('./logger-
|
|
16705
|
+
const { version } = await import('./logger-D8V27PkS.mjs').then(function (n) { return n._; });
|
|
16694
16706
|
console.log(chalk.green(`
|
|
16695
16707
|
\u2713 Now running version: ${version}`));
|
|
16696
16708
|
} catch {
|
|
@@ -16863,25 +16875,15 @@ cli.command(
|
|
|
16863
16875
|
if (autoUpgradeDisabled) {
|
|
16864
16876
|
displayUpgradeNotification(upgradeResult);
|
|
16865
16877
|
} else {
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
16873
|
-
|
|
16874
|
-
|
|
16875
|
-
...process.env,
|
|
16876
|
-
// Set flag to prevent infinite upgrade loop
|
|
16877
|
-
AGENTRIX_SKIP_UPGRADE_CHECK: "true"
|
|
16878
|
-
}
|
|
16879
|
-
});
|
|
16880
|
-
process.exit(0);
|
|
16881
|
-
} catch (error) {
|
|
16882
|
-
console.log(chalk.yellow("\u26A0\uFE0F Failed to restart, continuing with upgrade..."));
|
|
16883
|
-
}
|
|
16884
|
-
}
|
|
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();
|
|
16885
16887
|
}
|
|
16886
16888
|
}
|
|
16887
16889
|
const wasRunning = await isLatestDaemonRunning();
|
package/dist/lib.cjs
CHANGED
package/dist/lib.mjs
CHANGED
|
@@ -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.
|
|
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-
|
|
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.
|
|
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";
|