@bash0816/claude-code 2.1.150-2 → 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.
@@ -132,6 +132,13 @@
132
132
  "entry_js_offset": 221278436,
133
133
  "entry_end_offset": 236586147,
134
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"
135
142
  }
136
143
  }
137
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-2",
9
- "latest_audited_version": "2.1.150-2",
10
- "latest_candidate_version": "2.1.150-2",
11
- "previous_stable_version": "2.1.150-1",
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,16 +201,55 @@ 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) => resolve(code ?? 0));
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
  });
252
+
214
253
  function makeTextReader(stream) {
215
254
  return {
216
255
  text() {
@@ -224,9 +263,9 @@ function createBunShim() {
224
263
  },
225
264
  };
226
265
  }
227
- if (child.stdout) Object.assign(child.stdout, makeTextReader(child.stdout));
228
- if (child.stderr) Object.assign(child.stderr, makeTextReader(child.stderr));
229
- return child;
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;
230
269
  }
231
270
 
232
271
  class TerminalShim {
@@ -238,7 +277,6 @@ function createBunShim() {
238
277
  }
239
278
  write(data) {
240
279
  if (this._closed) return;
241
- if (this._options.data) this._options.data(this, Buffer.isBuffer(data) ? data : Buffer.from(data));
242
280
  }
243
281
  resize(cols, rows) {
244
282
  this._cols = cols;
@@ -356,16 +394,21 @@ function createBunShim() {
356
394
  },
357
395
  };
358
396
 
359
- const Transpiler = {
360
- transformSync(code) { return typeof code === 'string' ? code : ''; },
397
+ class Transpiler {
398
+ constructor(_options) {}
399
+ transformSync(code) { return typeof code === 'string' ? code : ''; }
361
400
  scanImports(code) {
362
401
  const imports = [];
363
- const re = /(?:import|require)\s*\(?['"]([^'"]+)['"]\)?/g;
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;
364
405
  let m;
365
- while ((m = re.exec(String(code))) !== null) imports.push({ path: m[1] });
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' });
366
409
  return imports;
367
- },
368
- };
410
+ }
411
+ }
369
412
 
370
413
  return {
371
414
  version: '1.1.8',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/claude-code",
3
- "version": "2.1.150-2",
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
  }