@aptove/aptove 0.1.4 → 0.1.6

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/README.md +25 -7
  2. package/package.json +6 -6
  3. package/postinstall.js +69 -30
package/README.md CHANGED
@@ -126,16 +126,31 @@ Images are published to `ghcr.io/aptove/aptove-agent` on every release.
126
126
  # Pull the latest multi-arch image (amd64 + arm64)
127
127
  docker pull ghcr.io/aptove/aptove-agent:latest
128
128
 
129
- # Run interactively with config and API key
129
+ # Chat mode Linux host
130
130
  docker run --rm -it \
131
131
  -v ~/.config/Aptove:/root/.config/Aptove \
132
132
  -e ANTHROPIC_API_KEY=... \
133
133
  ghcr.io/aptove/aptove-agent:latest chat
134
134
 
135
- # ACP stdio mode (for use with the bridge)
135
+ # Chat mode — macOS host (config lives under ~/Library/Application Support/Aptove)
136
+ docker run --rm -it \
137
+ -v "$HOME/Library/Application Support/Aptove":/root/.config/Aptove \
138
+ -e ANTHROPIC_API_KEY=... \
139
+ ghcr.io/aptove/aptove-agent:latest chat
140
+
141
+ # Bridge mode with QR code for mobile pairing
142
+ # --advertise-addr is required in containers: the container gets an internal virtual IP
143
+ # that mobile devices cannot reach. Pass your host machine's real LAN IP instead.
144
+ docker run --rm -it \
145
+ -p 8765:8765 \
146
+ -v "$HOME/Library/Application Support/Aptove":/root/.config/Aptove \
147
+ -e ANTHROPIC_API_KEY=... \
148
+ ghcr.io/aptove/aptove-agent:latest run --qr --advertise-addr 192.168.1.50
149
+
150
+ # ACP stdio mode (for use with an external bridge)
136
151
  docker run --rm -i \
137
152
  -e ANTHROPIC_API_KEY=... \
138
- ghcr.io/aptove/aptove-agent:latest run
153
+ ghcr.io/aptove/aptove-agent:latest stdio
139
154
  ```
140
155
 
141
156
  Works on Linux natively and on Windows via Docker Desktop (WSL2 backend).
@@ -148,11 +163,14 @@ Apple Native runs Linux containers directly via the macOS Virtualization.framewo
148
163
  # Install the container CLI
149
164
  brew install container # requires arm64 + macOS 26 (Tahoe)
150
165
 
151
- # Run
152
- container run \
153
- -v ~/.config/Aptove:/root/.config/Aptove \
166
+ # Run (macOS config lives under ~/Library/Application Support/Aptove)
167
+ # Use --advertise-addr with your Mac's real LAN IP for local transport QR pairing
168
+ container run -it \
169
+ --dns 8.8.8.8 \
170
+ -p 8765:8765 \
171
+ -v "$HOME/Library/Application Support/Aptove":/root/.config/Aptove \
154
172
  -e ANTHROPIC_API_KEY=... \
155
- ghcr.io/aptove/aptove-agent:latest-darwin-arm64 chat
173
+ ghcr.io/aptove/aptove-agent:0.1.4-darwin-arm64 run --qr --advertise-addr 192.168.1.50
156
174
  ```
157
175
 
158
176
  ### Available Tags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptove/aptove",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "ACP AI coding agent — connects to Claude, Gemini, and OpenAI",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -35,10 +35,10 @@
35
35
  "node": ">=16"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@aptove/aptove-darwin-arm64": "0.1.4",
39
- "@aptove/aptove-darwin-x64": "0.1.4",
40
- "@aptove/aptove-linux-arm64": "0.1.4",
41
- "@aptove/aptove-linux-x64": "0.1.4",
42
- "@aptove/aptove-win32-x64": "0.1.4"
38
+ "@aptove/aptove-darwin-arm64": "0.1.6",
39
+ "@aptove/aptove-darwin-x64": "0.1.6",
40
+ "@aptove/aptove-linux-arm64": "0.1.6",
41
+ "@aptove/aptove-linux-x64": "0.1.6",
42
+ "@aptove/aptove-win32-x64": "0.1.6"
43
43
  }
44
44
  }
package/postinstall.js CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * aptove postinstall script
3
3
  *
4
- * Verifies the correct platform-specific package was installed
5
- * and the binary is executable.
4
+ * Ensures the correct platform-specific binary package is installed.
5
+ * npm sometimes skips optional dependencies during global installs, so
6
+ * we detect this and install the platform package explicitly if needed.
6
7
  */
7
8
 
8
9
  const { execSync } = require('child_process');
@@ -17,43 +18,81 @@ const PLATFORM_PACKAGES = {
17
18
  'win32-x64': '@aptove/aptove-win32-x64',
18
19
  };
19
20
 
20
- function main() {
21
+ function getPlatformPackage() {
21
22
  const platformKey = `${process.platform}-${process.arch}`;
22
- const packageName = PLATFORM_PACKAGES[platformKey];
23
+ return { platformKey, packageName: PLATFORM_PACKAGES[platformKey] };
24
+ }
25
+
26
+ function isBinaryInstalled(packageName) {
27
+ try {
28
+ const packagePath = require.resolve(`${packageName}/package.json`);
29
+ const binaryName = process.platform === 'win32' ? 'aptove.exe' : 'aptove';
30
+ const binaryPath = path.join(path.dirname(packagePath), 'bin', binaryName);
31
+ return fs.existsSync(binaryPath);
32
+ } catch (e) {
33
+ return false;
34
+ }
35
+ }
36
+
37
+ function getPackageVersion() {
38
+ try {
39
+ const pkg = require('./package.json');
40
+ // optionalDependencies values are updated by the release workflow to match the published version
41
+ const deps = pkg.optionalDependencies || {};
42
+ const versions = Object.values(deps).filter(v => v !== '*');
43
+ return versions[0] || pkg.version;
44
+ } catch (e) {
45
+ return 'latest';
46
+ }
47
+ }
48
+
49
+ function installPlatformPackage(packageName, version) {
50
+ // During `npm install -g`, npm_config_prefix points to the global prefix (e.g. /usr/local or ~/.nvm/...).
51
+ // Installing with --prefix ensures the package lands in the same global node_modules tree.
52
+ const prefix = process.env.npm_config_prefix;
53
+ const prefixFlag = prefix ? `--prefix "${prefix}"` : '';
54
+
55
+ console.log(` Installing ${packageName}@${version}...`);
56
+ execSync(
57
+ `npm install ${prefixFlag} --no-save --no-audit --no-fund "${packageName}@${version}"`,
58
+ { stdio: 'inherit' }
59
+ );
60
+ }
61
+
62
+ function main() {
63
+ const { platformKey, packageName } = getPlatformPackage();
23
64
 
24
65
  if (!packageName) {
25
66
  console.warn(`⚠️ aptove: Unsupported platform ${platformKey}`);
26
- console.warn(' Supported platforms: darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64');
67
+ console.warn(' Supported: darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64');
27
68
  return;
28
69
  }
29
70
 
30
- try {
31
- const packagePath = require.resolve(`${packageName}/package.json`);
32
- const binaryName = process.platform === 'win32' ? 'aptove.exe' : 'aptove';
33
- const binaryPath = path.join(path.dirname(packagePath), 'bin', binaryName);
71
+ if (isBinaryInstalled(packageName)) {
72
+ console.log(`✓ aptove installed successfully for ${platformKey}`);
73
+ return;
74
+ }
75
+
76
+ // Optional dependency was not installed (common with `npm install -g`).
77
+ // Install it explicitly.
78
+ console.log(`⬇ aptove: platform package not found, installing ${packageName}...`);
79
+ const version = getPackageVersion();
34
80
 
35
- if (!fs.existsSync(binaryPath)) {
36
- console.warn(`⚠️ aptove: Binary not found at ${binaryPath}`);
37
- return;
38
- }
39
-
40
- if (process.platform !== 'win32') {
41
- try {
42
- fs.chmodSync(binaryPath, 0o755);
43
- } catch (e) {
44
- // Not critical
45
- }
46
- }
47
-
48
- try {
49
- execSync(`"${binaryPath}" --version`, { stdio: 'pipe' });
50
- console.log(`✓ aptove installed successfully for ${platformKey}`);
51
- } catch (e) {
52
- console.warn(`⚠️ aptove: Binary exists but failed to execute on ${platformKey}`);
53
- }
81
+ try {
82
+ installPlatformPackage(packageName, version);
54
83
  } catch (e) {
55
- console.warn(`⚠️ aptove: Platform package ${packageName} not installed`);
56
- console.warn(' This is expected on CI or unsupported platforms');
84
+ console.error(`✗ aptove: failed to install ${packageName}@${version}`);
85
+ console.error(` You can install it manually with:`);
86
+ console.error(` npm install -g ${packageName}@${version}`);
87
+ process.exit(1);
88
+ }
89
+
90
+ if (isBinaryInstalled(packageName)) {
91
+ console.log(`✓ aptove installed successfully for ${platformKey}`);
92
+ } else {
93
+ console.error(`✗ aptove: binary not found after installing ${packageName}`);
94
+ console.error(` Try: npm install -g ${packageName}@${version}`);
95
+ process.exit(1);
57
96
  }
58
97
  }
59
98