@mblua/agentscommander 0.31.0 → 0.33.0

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
@@ -1,5 +1,19 @@
1
1
  # AgentsCommander from npm
2
2
 
3
+ ## Recommended npm installation: global
4
+
5
+ When installing through npm, use `-g` so the `agentscommander` command is available from any directory:
6
+
7
+ ```bash
8
+ npm install -g @mblua/agentscommander@<version>
9
+ ```
10
+
11
+ Replace `<version>` with the exact version selected using [Resolve versions and preserve configuration](#resolve-versions-and-preserve-configuration), then follow [Install and validate](#install-and-validate). Check the supported platforms and requirements below before installing.
12
+
13
+ The npm website's **Install** sidebar shows the generic local-install command. For the recommended global npm installation, include `-g` as shown above.
14
+
15
+ ## Choosing the npm route
16
+
3
17
  For developers who deliberately choose the secondary npm route, this page defines the supported hosts, install command, verification signal, and configuration precaution.
4
18
 
5
19
  npm is not the recommended first install. Start with the reviewable [Coding Agent installation contract](https://github.com/mblua/AgentsCommander/blob/main/docs/install-with-agent.md), which detects the host, selects an approved stable-release asset, verifies its checksum, and waits for approval.
@@ -39,19 +53,15 @@ npm view @mblua/agentscommander@latest version
39
53
 
40
54
  The existing binary's exact resolver determines what must be preserved. The selected package's exact release tag determines post-install behavior. Verify both against the corresponding `v<version>` source tag; do not use `main` as evidence for a published npm package.
41
55
 
42
- ### npm `0.31.0`
56
+ ### npm `0.33.0`
43
57
 
44
- `0.31.0` is the npm `latest` at this documentation commit. Its published install script downloads the `v0.31.0` native release asset, verifies it against `SHASUMS256.txt`, and renames it to the executable in the package's `bin/` directory; the launcher only spawns that binary and injects no configuration override. The `v0.31.0` native resolver, unchanged from `v0.30.5`:
58
+ `0.33.0` is the release described by this package. Its installer downloads the `v0.33.0` native release asset and verifies it against `SHASUMS256.txt`. On Windows and Linux it renames the asset to the unsuffixed executable in the package's `bin/` directory. On macOS it downloads the `agentscommander-mac-<arch>.app.tar.gz` bundle, extracts the single `.app` directory into `bin/`, and validates the executable named by the bundle's `CFBundleExecutable`. The launcher spawns that executable and injects no configuration override.
45
59
 
46
- 1. selects the `AGENTSCOMMANDER_CONFIG_DIR` value verbatim when that variable is set and non-blank, running no probes;
47
- 2. otherwise derives the candidate `<native-executable-folder>/.<native-executable-stem>`, checks for a `portable.txt` marker beside the executable, and write-probes the candidate;
48
- 3. selects that candidate when the write probe succeeds, with or without the marker;
49
- 4. falls back to `$HOME/.agentscommander-new` only when the executable's parent and stem cannot be derived, or when the marker is absent and the candidate is conclusively unwritable; and
50
- 5. refuses to start on every other probe outcome (marker present but candidate unwritable, or an indeterminate probe), reporting an error that says to set `AGENTSCOMMANDER_CONFIG_DIR`.
60
+ The `v0.33.0` native resolver selects a non-blank `AGENTSCOMMANDER_CONFIG_DIR` value verbatim when present. Otherwise, the normal unsuffixed npm executable selects the user's home directory plus `.agentscommander`, independently of its install location and build profile. It does not inspect an adjacent `portable.txt` marker or probe an adjacent configuration directory on this route. Suffixed executables use their adjacent `.agentscommander_<suffix>` directory and refuse to start when it is not writable.
51
61
 
52
- The npm installer writes no `portable.txt`. For a normal npm `0.31.0` install with a writable global `node_modules`, the write probe succeeds and the selected directory is therefore `.agentscommander` beside the native executable under `@mblua/agentscommander/bin/`, the same location `0.30.3` selected, now confirmed by a probe instead of assumed.
62
+ **Version `0.33.0` keeps the `0.32.0` default location.** Versions `0.31.0` and `0.30.5` normally selected `.agentscommander` beside the native executable under `@mblua/agentscommander/bin/` when that location was writable, with their documented home fallback and refusal rules. Neither `0.32.0` nor `0.33.0` discovers, copies, moves or migrates any old configuration automatically. Before updating from `0.31.0` or older, identify and back up the old version's active configuration. If you intend to keep using that directory, set `AGENTSCOMMANDER_CONFIG_DIR` to its verified path; otherwise arrange the intended configuration at the new home location separately. Version `0.33.0` also drops the legacy pre-v2 `codingAgentProfiles` settings migration.
53
63
 
54
- The previous npm version, `0.30.5`, shares this resolver exactly. The older npm version `0.30.3` ships none of this: its resolver immediately selects `<native-executable-folder>/.<native-executable-stem>` whenever that parent and stem can be derived, uses `$HOME/.agentscommander-new` only when they cannot, and never reads `AGENTSCOMMANDER_CONFIG_DIR`, inspects `portable.txt`, probes writability, or falls back to home because the adjacent path is read-only. npm never published a `0.30.4` package; that number exists only as a GitHub release. For any other published version, inspect `src-tauri/src/config/mod.rs`, `src-tauri/src/config/profile.rs`, `npm/run.js`, and `npm/install.js` at its exact `v<version>` tag; do not extrapolate from `0.31.0`, `0.30.5`, `0.30.3`, or `main`.
64
+ The older npm `0.30.3` resolver immediately selected an executable-adjacent directory when the parent and stem were available and did not support the configuration override or portable-marker/write-probe rules. npm never published `0.30.4`; that number exists only as a GitHub release. For other versions, inspect `src-tauri/src/config/mod.rs`, `src-tauri/src/config/profile.rs`, `npm/run.js`, and `npm/install.js` at the exact `v<version>` tag.
55
65
 
56
66
  Before an npm update or uninstall, identify the active directory with the existing binary's verified rule and exact path. The presence of a directory alone is not proof of selection.
57
67
 
package/install.js CHANGED
@@ -4,8 +4,9 @@ const https = require('https');
4
4
  const crypto = require('crypto');
5
5
  const os = require('os');
6
6
  const { execSync } = require('child_process');
7
+ const { assertExecutable } = require('./resolve-bin');
7
8
 
8
- const VERSION = "0.31.0"; // Must match package.json
9
+ const VERSION = "0.33.0"; // Must match package.json
9
10
  const OWNER = 'mblua';
10
11
  const REPO = 'AgentsCommander';
11
12
 
@@ -132,6 +133,7 @@ async function main() {
132
133
  if (fs.existsSync(extractTmpDir)) fs.rmSync(extractTmpDir, { recursive: true, force: true });
133
134
  }
134
135
  fs.unlinkSync(tmpPath);
136
+ assertExecutable('darwin', binDir);
135
137
  } else {
136
138
  const finalBinPath = path.join(binDir, platform === 'win32' ? 'agentscommander.exe' : 'agentscommander');
137
139
  if (platform !== 'win32') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblua/agentscommander",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Install and run AgentsCommander, the local terminal session manager for AI coding agent teams with Claude Code, Codex, Hermes, Cursor CLI, OpenCode, and more to come.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "files": [
13
13
  "run.js",
14
- "install.js"
14
+ "install.js",
15
+ "resolve-bin.js"
15
16
  ],
16
17
  "engines": {
17
18
  "node": ">=18.0.0"
package/resolve-bin.js ADDED
@@ -0,0 +1,67 @@
1
+ // Shared, platform-aware locator for the AgentsCommander executable inside the
2
+ // installed package. run.js (launch) and install.js (post-extraction validation)
3
+ // both use it so the two files agree on one on-disk contract. Issue #2016.
4
+ const fs = require('node:fs');
5
+ const path = require('node:path');
6
+
7
+ // A Tauri Info.plist states CFBundleExecutable as a single <key>/<string> pair.
8
+ // A bounded regex reads it without adding a plist parser to the published package.
9
+ const CFBUNDLE_EXECUTABLE_RE = /<key>\s*CFBundleExecutable\s*<\/key>\s*<string>([^<]*)<\/string>/;
10
+
11
+ function resolveBinPath(platform, binDir) {
12
+ if (platform !== 'darwin') {
13
+ return path.join(binDir, platform === 'win32' ? 'agentscommander.exe' : 'agentscommander');
14
+ }
15
+
16
+ let entries;
17
+ try {
18
+ entries = fs.readdirSync(binDir, { withFileTypes: true });
19
+ } catch (err) {
20
+ throw new Error(`macOS app bundle not found: cannot read ${binDir} (${err.code})`);
21
+ }
22
+
23
+ const bundles = entries.filter((entry) => entry.isDirectory() && entry.name.endsWith('.app'));
24
+ if (bundles.length !== 1) {
25
+ const found = bundles.length === 0 ? 'none' : `${bundles.length}: ${bundles.map((b) => b.name).join(', ')}`;
26
+ throw new Error(`macOS app bundle not found in ${binDir}: expected exactly one *.app directory, found ${found}`);
27
+ }
28
+
29
+ const appDir = path.join(binDir, bundles[0].name);
30
+ const plistPath = path.join(appDir, 'Contents', 'Info.plist');
31
+ let plist;
32
+ try {
33
+ plist = fs.readFileSync(plistPath, 'utf8');
34
+ } catch (err) {
35
+ throw new Error(`macOS app bundle is incomplete: cannot read ${plistPath} (${err.code})`);
36
+ }
37
+
38
+ const match = CFBUNDLE_EXECUTABLE_RE.exec(plist);
39
+ const executable = match ? match[1].trim() : '';
40
+ if (
41
+ !executable ||
42
+ executable === '.' ||
43
+ executable === '..' ||
44
+ executable.includes('/') ||
45
+ executable.includes('\\')
46
+ ) {
47
+ throw new Error(`macOS app bundle is incomplete: valid CFBundleExecutable not found in ${plistPath}`);
48
+ }
49
+
50
+ return path.join(appDir, 'Contents', 'MacOS', executable);
51
+ }
52
+
53
+ function assertExecutable(platform, binDir) {
54
+ const binPath = resolveBinPath(platform, binDir);
55
+ let stat;
56
+ try {
57
+ stat = fs.statSync(binPath);
58
+ } catch (err) {
59
+ throw new Error(`macOS app bundle is incomplete: executable missing at ${binPath} (${err.code})`);
60
+ }
61
+ if (!stat.isFile()) {
62
+ throw new Error(`macOS app bundle is incomplete: not a regular file at ${binPath}`);
63
+ }
64
+ return binPath;
65
+ }
66
+
67
+ module.exports = { resolveBinPath, assertExecutable };
package/run.js CHANGED
@@ -3,13 +3,27 @@ const { spawn } = require('child_process');
3
3
  const path = require('path');
4
4
  const os = require('os');
5
5
  const fs = require('fs');
6
+ const { resolveBinPath } = require('./resolve-bin');
6
7
 
7
- const binName = os.platform() === 'win32' ? 'agentscommander.exe' : 'agentscommander';
8
- const binPath = path.join(__dirname, 'bin', binName);
8
+ const binDir = path.join(__dirname, 'bin');
9
+
10
+ const IGNORE_SCRIPTS_HINT =
11
+ 'Hint: if npm install ran with --ignore-scripts, reinstall without that flag, or run: npm rebuild -g @mblua/agentscommander';
12
+
13
+ let binPath;
14
+ try {
15
+ binPath = resolveBinPath(os.platform(), binDir);
16
+ } catch (err) {
17
+ console.error(`Error: ${err.message}`);
18
+ console.error('Please ensure the package was installed correctly.');
19
+ console.error(IGNORE_SCRIPTS_HINT);
20
+ process.exit(1);
21
+ }
9
22
 
10
23
  if (!fs.existsSync(binPath)) {
11
24
  console.error(`Error: Cannot find AgentsCommander executable at ${binPath}`);
12
25
  console.error('Please ensure the package was installed correctly.');
26
+ console.error(IGNORE_SCRIPTS_HINT);
13
27
  process.exit(1);
14
28
  }
15
29