@bash0816/claude-code 2.1.153 → 2.1.154

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.
@@ -146,6 +146,41 @@
146
146
  "entry_js_offset": 222525028,
147
147
  "entry_end_offset": 237958345,
148
148
  "status": "termux_verified"
149
+ },
150
+ "2.1.153-1": {
151
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.153",
152
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.153",
153
+ "entry_js_offset": 222525028,
154
+ "entry_end_offset": 237958345,
155
+ "status": "termux_verified"
156
+ },
157
+ "2.1.153-2": {
158
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.153",
159
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.153",
160
+ "entry_js_offset": 222525028,
161
+ "entry_end_offset": 237958345,
162
+ "status": "termux_verified"
163
+ },
164
+ "2.1.153-3": {
165
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.153",
166
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.153",
167
+ "entry_js_offset": 222525028,
168
+ "entry_end_offset": 237958345,
169
+ "status": "termux_verified"
170
+ },
171
+ "2.1.153-4": {
172
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.153",
173
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.153",
174
+ "entry_js_offset": 222525028,
175
+ "entry_end_offset": 237958345,
176
+ "status": "termux_verified"
177
+ },
178
+ "2.1.154": {
179
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.154",
180
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.154",
181
+ "entry_js_offset": 222957396,
182
+ "entry_end_offset": 238482842,
183
+ "status": "termux_verified"
149
184
  }
150
185
  }
151
186
  }
@@ -4,10 +4,10 @@
4
4
  "canonical_package_name": "@bash0816/claude-code",
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
- "bridge_package_version": "2.1.123",
8
- "default_native_version": "2.1.153",
9
- "latest_audited_version": "2.1.153",
10
- "latest_candidate_version": "2.1.153",
11
- "previous_stable_version": "2.1.150-3",
12
- "manifest_url": "https://raw.githubusercontent.com/bash0816/CluadeCode-Termux/main/config/claude-termux-release-manifest.json"
7
+ "bridge_package_version": "2.1.154",
8
+ "default_native_version": "2.1.154",
9
+ "latest_audited_version": "2.1.154",
10
+ "latest_candidate_version": "2.1.154",
11
+ "previous_stable_version": "2.1.126",
12
+ "manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json"
13
13
  }
@@ -24,8 +24,14 @@ const canonicalPackageName = process.env.CLAUDE_TERMUX_CANONICAL_PACKAGE_NAME ||
24
24
  const canonicalRepositoryUrl = process.env.CLAUDE_TERMUX_CANONICAL_REPOSITORY_URL || localManifest.canonical_repository_url || '';
25
25
 
26
26
  function compareVersions(a, b) {
27
- const aParts = String(a).split('.').map(Number);
28
- const bParts = String(b).split('.').map(Number);
27
+ const parse = v => {
28
+ const [main, patch] = String(v).split('-');
29
+ const parts = main.split('.').map(Number);
30
+ parts.push(patch !== undefined ? Number(patch) : 0);
31
+ return parts;
32
+ };
33
+ const aParts = parse(a);
34
+ const bParts = parse(b);
29
35
  const len = Math.max(aParts.length, bParts.length);
30
36
  for (let index = 0; index < len; index += 1) {
31
37
  const diff = (aParts[index] || 0) - (bParts[index] || 0);
@@ -75,6 +75,38 @@ function ensureEntryFile() {
75
75
 
76
76
  function createFakeRequire(realRequire) {
77
77
  const realChild = realRequire('child_process');
78
+ const realVm = realRequire('vm');
79
+
80
+ function injectBunIntoContext(context) {
81
+ if (!context || typeof context !== 'object') return context;
82
+ try {
83
+ if (!Object.prototype.hasOwnProperty.call(context, 'Bun')) {
84
+ Object.defineProperty(context, 'Bun', {
85
+ value: globalThis.Bun,
86
+ configurable: true,
87
+ writable: true,
88
+ });
89
+ }
90
+ } catch {}
91
+ return context;
92
+ }
93
+
94
+ if (!realVm.__bunShimPatched) {
95
+ const origCreateContext = realVm.createContext.bind(realVm);
96
+ const origRunInNewContext = realVm.runInNewContext.bind(realVm);
97
+ realVm.createContext = (ctx, ...rest) => origCreateContext(injectBunIntoContext(ctx), ...rest);
98
+ realVm.runInNewContext = (code, ctx, ...rest) => origRunInNewContext(code, injectBunIntoContext(ctx), ...rest);
99
+ const ScriptProto = realVm.Script && realVm.Script.prototype;
100
+ if (ScriptProto && !ScriptProto.__bunShimPatched) {
101
+ const origRunInContext = ScriptProto.runInContext;
102
+ const origRunInNewCtx = ScriptProto.runInNewContext;
103
+ ScriptProto.runInContext = function(ctx, ...rest) { return origRunInContext.call(this, injectBunIntoContext(ctx), ...rest); };
104
+ ScriptProto.runInNewContext = function(ctx, ...rest) { return origRunInNewCtx.call(this, injectBunIntoContext(ctx), ...rest); };
105
+ Object.defineProperty(ScriptProto, '__bunShimPatched', { value: true });
106
+ }
107
+ Object.defineProperty(realVm, '__bunShimPatched', { value: true });
108
+ }
109
+
78
110
  function rewriteArgs(args) {
79
111
  if (
80
112
  Array.isArray(args) &&
@@ -88,6 +120,8 @@ function createFakeRequire(realRequire) {
88
120
  }
89
121
 
90
122
  return function fakeRequire(id) {
123
+ if (id === 'vm') return realVm;
124
+
91
125
  if (id === 'ws') {
92
126
  class WS {
93
127
  on() {}
@@ -277,6 +311,7 @@ function createBunShim() {
277
311
  }
278
312
  write(data) {
279
313
  if (this._closed) return;
314
+ if (this._options.data) this._options.data(this, Buffer.isBuffer(data) ? data : Buffer.from(data));
280
315
  }
281
316
  resize(cols, rows) {
282
317
  this._cols = cols;
@@ -433,7 +468,6 @@ function createBunShim() {
433
468
  async function main() {
434
469
  const extractedFile = ensureEntryFile();
435
470
  const code = fs.readFileSync(extractedFile, 'utf8');
436
- const fn = eval('(' + code);
437
471
 
438
472
  const originalArgv = process.argv.slice();
439
473
  const originalExit = process.exit;
@@ -442,7 +476,6 @@ async function main() {
442
476
  const originalGlobalBun = globalThis.Bun;
443
477
  const asyncErrors = [];
444
478
 
445
- const fakeRequire = createFakeRequire(require);
446
479
  function onAsyncError(error) {
447
480
  asyncErrors.push(error);
448
481
  }
@@ -452,11 +485,13 @@ async function main() {
452
485
  process.once('unhandledRejection', onAsyncError);
453
486
  Object.defineProperty(process.versions, 'bun', { value: '1.1.8', configurable: true });
454
487
  globalThis.Bun = createBunShim();
488
+ const fakeRequire = createFakeRequire(require);
455
489
  process.argv = ['node', extractedFile, ...argv];
456
490
  process.exit = code => {
457
491
  throw new RequestedExit(code);
458
492
  };
459
493
 
494
+ const fn = eval('(' + code);
460
495
  const moduleLike = { exports: {} };
461
496
  const maybePromise = fn(moduleLike.exports, fakeRequire, moduleLike, extractedFile, workdir);
462
497
  if (maybePromise && typeof maybePromise.then === 'function') await maybePromise;
@@ -480,8 +515,10 @@ async function main() {
480
515
  Object.defineProperty(process.versions, 'bun', { value: originalBun, configurable: true });
481
516
  }
482
517
  } catch {}
483
- if (hadGlobalBun) globalThis.Bun = originalGlobalBun;
484
- else delete globalThis.Bun;
518
+ try {
519
+ if (hadGlobalBun) globalThis.Bun = originalGlobalBun;
520
+ else delete globalThis.Bun;
521
+ } catch {}
485
522
  }
486
523
  }
487
524
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/claude-code",
3
- "version": "2.1.153",
3
+ "version": "2.1.154",
4
4
  "description": "Termux-native Claude Code wrapper with audited native replay",
5
5
  "license": "MIT",
6
6
  "bin": {