@bash0816/claude-code 2.1.150-1 → 2.1.150-3

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.
@@ -125,6 +125,20 @@
125
125
  "entry_js_offset": 221278436,
126
126
  "entry_end_offset": 236586147,
127
127
  "status": "termux_verified"
128
+ },
129
+ "2.1.150-2": {
130
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.150",
131
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.150",
132
+ "entry_js_offset": 221278436,
133
+ "entry_end_offset": 236586147,
134
+ "status": "termux_verified"
135
+ },
136
+ "2.1.150-3": {
137
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.150",
138
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.150",
139
+ "entry_js_offset": 221278436,
140
+ "entry_end_offset": 236586147,
141
+ "status": "termux_verified"
128
142
  }
129
143
  }
130
144
  }
@@ -5,9 +5,9 @@
5
5
  "canonical_manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json",
6
6
  "canonical_repository_url": "https://github.com/bash0816/ClaudeCode-Termux",
7
7
  "bridge_package_version": "2.1.123",
8
- "default_native_version": "2.1.150-1",
9
- "latest_audited_version": "2.1.150-1",
10
- "latest_candidate_version": "2.1.150-1",
11
- "previous_stable_version": "2.1.150",
8
+ "default_native_version": "2.1.150-3",
9
+ "latest_audited_version": "2.1.150-3",
10
+ "latest_candidate_version": "2.1.150-3",
11
+ "previous_stable_version": "2.1.150-2",
12
12
  "manifest_url": "https://raw.githubusercontent.com/bash0816/CluadeCode-Termux/main/config/claude-termux-release-manifest.json"
13
13
  }
package/lib/preinstall.js CHANGED
@@ -1,6 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
+ const [_nodeMajor] = process.versions.node.split('.').map(Number);
5
+ if (_nodeMajor < 20) {
6
+ process.stderr.write('@bash0816/claude-code requires Node.js v20 or later. Found: v' + process.versions.node + '\n');
7
+ process.exit(1);
8
+ }
9
+
4
10
  const cp = require('child_process');
5
11
  const fs = require('fs');
6
12
  const os = require('os');
@@ -201,17 +201,90 @@ function createBunShim() {
201
201
  throw new TypeError('Bun.spawn expects a non-empty argv array');
202
202
  }
203
203
  const [command, ...args] = argv;
204
- const child = childProcess.spawn(command, args, {
204
+ const terminal = options.terminal || null;
205
+
206
+ function resolveStdio(val, fallback) {
207
+ if (val === 'ignore' || val === 'inherit' || val === 'pipe') return val;
208
+ return fallback;
209
+ }
210
+
211
+ let stdioSpec;
212
+ if (terminal) {
213
+ stdioSpec = ['pipe', 'pipe', 'pipe'];
214
+ } else if (Array.isArray(options.stdio)) {
215
+ stdioSpec = options.stdio.map(s => resolveStdio(s, 'pipe'));
216
+ } else {
217
+ stdioSpec = [
218
+ resolveStdio(options.stdin, 'pipe'),
219
+ resolveStdio(options.stdout, 'pipe'),
220
+ resolveStdio(options.stderr, 'pipe'),
221
+ ];
222
+ }
223
+
224
+ const nodeChild = childProcess.spawn(command, args, {
205
225
  cwd: options.cwd,
206
- env: options.env,
226
+ env: options.env || process.env,
207
227
  detached: options.detached,
208
- stdio: options.stdio || 'pipe',
209
228
  windowsHide: options.windowsHide,
229
+ stdio: stdioSpec,
210
230
  });
211
- child.exited = new Promise(resolve => {
212
- child.once('exit', (code, signal) => resolve({ code, signal }));
231
+
232
+ if (terminal) {
233
+ const fireData = chunk => {
234
+ if (!terminal._closed && terminal._options && typeof terminal._options.data === 'function') {
235
+ terminal._options.data(terminal, Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
236
+ }
237
+ };
238
+ nodeChild.stdout?.on('data', fireData);
239
+ nodeChild.stderr?.on('data', fireData);
240
+ const origWrite = terminal.write.bind(terminal);
241
+ terminal.write = data => {
242
+ if (nodeChild.stdin && !nodeChild.stdin.destroyed) {
243
+ nodeChild.stdin.write(Buffer.isBuffer(data) ? data : Buffer.from(data));
244
+ }
245
+ return origWrite(data);
246
+ };
247
+ }
248
+
249
+ nodeChild.exited = new Promise(resolve => {
250
+ nodeChild.once('exit', (code, signal) => resolve(code != null ? code : (signal ? 1 : 0)));
213
251
  });
214
- return child;
252
+
253
+ function makeTextReader(stream) {
254
+ return {
255
+ text() {
256
+ return new Promise((resolve, reject) => {
257
+ if (!stream) return resolve('');
258
+ const chunks = [];
259
+ stream.on('data', chunk => chunks.push(chunk));
260
+ stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
261
+ stream.on('error', reject);
262
+ });
263
+ },
264
+ };
265
+ }
266
+ if (nodeChild.stdout) Object.assign(nodeChild.stdout, makeTextReader(nodeChild.stdout));
267
+ if (nodeChild.stderr) Object.assign(nodeChild.stderr, makeTextReader(nodeChild.stderr));
268
+ return nodeChild;
269
+ }
270
+
271
+ class TerminalShim {
272
+ constructor(options = {}) {
273
+ this._options = options;
274
+ this._cols = options.cols || 80;
275
+ this._rows = options.rows || 24;
276
+ this._closed = false;
277
+ }
278
+ write(data) {
279
+ if (this._closed) return;
280
+ }
281
+ resize(cols, rows) {
282
+ this._cols = cols;
283
+ this._rows = rows;
284
+ }
285
+ close() {
286
+ this._closed = true;
287
+ }
215
288
  }
216
289
 
217
290
  function listen(options) {
@@ -276,20 +349,72 @@ function createBunShim() {
276
349
 
277
350
  const semver = {
278
351
  order(left, right) {
279
- const leftParts = String(left).split('.').map(Number);
280
- const rightParts = String(right).split('.').map(Number);
352
+ const leftParts = String(left).replace(/^[^0-9]*/, '').split('.').map(Number);
353
+ const rightParts = String(right).replace(/^[^0-9]*/, '').split('.').map(Number);
281
354
  const size = Math.max(leftParts.length, rightParts.length);
282
355
  for (let index = 0; index < size; index += 1) {
283
356
  const diff = (leftParts[index] || 0) - (rightParts[index] || 0);
284
- if (diff !== 0) return diff;
357
+ if (diff !== 0) return diff > 0 ? 1 : -1;
285
358
  }
286
359
  return 0;
287
360
  },
361
+ satisfies(version, range) {
362
+ const v = String(version).replace(/^[^0-9]*/, '');
363
+ const clean = String(range).trim();
364
+ const match = clean.match(/^([><=!^~]+)\s*([0-9][^\s]*)/);
365
+ if (!match) return true;
366
+ const [, op, rv] = match;
367
+ const cmp = semver.order(v, rv);
368
+ if (op === '>=' || op === '=>') return cmp >= 0;
369
+ if (op === '>') return cmp > 0;
370
+ if (op === '<=' || op === '=<') return cmp <= 0;
371
+ if (op === '<') return cmp < 0;
372
+ if (op === '==' || op === '=') return cmp === 0;
373
+ if (op === '!=') return cmp !== 0;
374
+ return true;
375
+ },
288
376
  };
289
377
 
378
+ const YAML = {
379
+ parse(text) {
380
+ try {
381
+ const lines = String(text).split('\n');
382
+ const result = {};
383
+ for (const line of lines) {
384
+ const m = line.match(/^([^:#]+):\s*(.*)$/);
385
+ if (m) result[m[1].trim()] = m[2].trim().replace(/^["']|["']$/g, '');
386
+ }
387
+ return result;
388
+ } catch { return {}; }
389
+ },
390
+ stringify(obj) {
391
+ try {
392
+ return Object.entries(obj || {}).map(([k, v]) => `${k}: ${v}`).join('\n') + '\n';
393
+ } catch { return ''; }
394
+ },
395
+ };
396
+
397
+ class Transpiler {
398
+ constructor(_options) {}
399
+ transformSync(code) { return typeof code === 'string' ? code : ''; }
400
+ scanImports(code) {
401
+ const imports = [];
402
+ const reStatic = /(?:^|[^.])import\s+(?:[^'"]+\s+from\s+)?['"]([^'"]+)['"]/gm;
403
+ const reDynamic = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
404
+ const reRequire = /require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
405
+ let m;
406
+ while ((m = reStatic.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'import-statement' });
407
+ while ((m = reDynamic.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'dynamic-import' });
408
+ while ((m = reRequire.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'require-call' });
409
+ return imports;
410
+ }
411
+ }
412
+
290
413
  return {
291
414
  version: '1.1.8',
415
+ embeddedFiles: [],
292
416
  gc: typeof global.gc === 'function' ? () => global.gc() : () => {},
417
+ generateHeapSnapshot: () => Buffer.alloc(0),
293
418
  hash,
294
419
  listen,
295
420
  semver,
@@ -297,8 +422,11 @@ function createBunShim() {
297
422
  stdin: process.stdin,
298
423
  stripANSI,
299
424
  stringWidth,
425
+ Terminal: TerminalShim,
426
+ Transpiler,
300
427
  which,
301
428
  wrapAnsi: value => String(value ?? ''),
429
+ YAML,
302
430
  };
303
431
  }
304
432
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/claude-code",
3
- "version": "2.1.150-1",
3
+ "version": "2.1.150-3",
4
4
  "description": "Termux-native Claude Code wrapper with audited native replay",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -17,6 +17,6 @@
17
17
  "README.md"
18
18
  ],
19
19
  "engines": {
20
- "node": ">=18"
20
+ "node": ">=20"
21
21
  }
22
22
  }