@autter/cli 1.6.9 → 1.7.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.
Files changed (2) hide show
  1. package/install.js +61 -0
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -101,6 +101,57 @@ async function verifyChecksum(buf, asset, tag) {
101
101
  }
102
102
  }
103
103
 
104
+ function checkGit() {
105
+ try {
106
+ execFileSync('git', ['--version'], { encoding: 'utf8', timeout: 10_000, stdio: 'pipe' });
107
+ } catch {
108
+ throw new Error(
109
+ 'git is required but not found. Install git 2.22 or newer, then re-run: npm install -g @autter/cli'
110
+ );
111
+ }
112
+ }
113
+
114
+ function checkLinuxGlibc() {
115
+ if (process.platform !== 'linux') return;
116
+ try {
117
+ const out = execFileSync('ldd', ['--version'], { encoding: 'utf8', timeout: 10_000 });
118
+ const match = out.match(/(\d+)\.(\d+)/);
119
+ if (!match) return;
120
+ const major = Number(match[1]);
121
+ const minor = Number(match[2]);
122
+ if (major < 2 || (major === 2 && minor < 35)) {
123
+ throw new Error(
124
+ `Unsupported glibc version (${major}.${minor}). autter requires glibc 2.35+ (Ubuntu 22.04+, Debian 12+, Fedora 36+). ` +
125
+ 'On Ubuntu 20.04 / older WSL2, use a newer distro or run inside ubuntu:22.04 Docker.'
126
+ );
127
+ }
128
+ } catch (err) {
129
+ if (err.message?.includes('Unsupported glibc')) throw err;
130
+ // ldd missing — rely on post-download binary verify
131
+ }
132
+ }
133
+
134
+ function verifyBinaryRuns(bin) {
135
+ try {
136
+ const out = execFileSync(bin, ['--version'], { encoding: 'utf8', timeout: 10_000 });
137
+ return out.trim().split(/\s+/)[0] || null;
138
+ } catch (err) {
139
+ const detail = err.stderr?.toString() || err.stdout?.toString() || err.message || String(err);
140
+ try {
141
+ fs.rmSync(bin, { force: true });
142
+ } catch {
143
+ // best effort
144
+ }
145
+ if (process.platform === 'linux' && detail.includes('GLIBC')) {
146
+ throw new Error(
147
+ `The autter binary could not run on this system (incompatible glibc).\n${detail}\n\n` +
148
+ 'autter requires glibc 2.35+ (Ubuntu 22.04+). On Ubuntu 20.04 / older WSL2, use a newer distro or Docker.'
149
+ );
150
+ }
151
+ throw new Error(`The autter binary could not run on this system: ${detail}`);
152
+ }
153
+ }
154
+
104
155
  // `autter --version` prints the bare version ("1.6.8", or "1.6.8 (debug)").
105
156
  function installedVersion(bin) {
106
157
  try {
@@ -188,6 +239,8 @@ async function ensureBinary() {
188
239
  }
189
240
  }
190
241
 
242
+ verifyBinaryRuns(dest);
243
+
191
244
  await reportInstallPing(tag);
192
245
  return { bin: dest, downloaded: true };
193
246
  }
@@ -200,6 +253,14 @@ async function main() {
200
253
  return;
201
254
  }
202
255
 
256
+ try {
257
+ checkGit();
258
+ checkLinuxGlibc();
259
+ } catch (err) {
260
+ console.warn(`autter: ${err.message}`);
261
+ return;
262
+ }
263
+
203
264
  let result;
204
265
  try {
205
266
  result = await ensureBinary();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autter/cli",
3
- "version": "1.6.9",
3
+ "version": "1.7.0",
4
4
  "description": "Git-native AI authorship tracking: records which lines were written by AI agents and links them to the agent, model, and prompt. This package is a thin bootstrapper that installs the native autter binary.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://autter.dev",