@bash0816/claude-code 2.1.153-2 → 2.1.153-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.
@@ -160,6 +160,13 @@
160
160
  "entry_js_offset": 222525028,
161
161
  "entry_end_offset": 237958345,
162
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"
163
170
  }
164
171
  }
165
172
  }
@@ -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.153-2",
9
- "latest_audited_version": "2.1.153-2",
10
- "latest_candidate_version": "2.1.153-2",
11
- "previous_stable_version": "2.1.153-1",
8
+ "default_native_version": "2.1.153-3",
9
+ "latest_audited_version": "2.1.153-3",
10
+ "latest_candidate_version": "2.1.153-3",
11
+ "previous_stable_version": "2.1.153-2",
12
12
  "manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json"
13
13
  }
@@ -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() {}
@@ -434,7 +468,6 @@ function createBunShim() {
434
468
  async function main() {
435
469
  const extractedFile = ensureEntryFile();
436
470
  const code = fs.readFileSync(extractedFile, 'utf8');
437
- const fn = eval('(' + code);
438
471
 
439
472
  const originalArgv = process.argv.slice();
440
473
  const originalExit = process.exit;
@@ -443,7 +476,6 @@ async function main() {
443
476
  const originalGlobalBun = globalThis.Bun;
444
477
  const asyncErrors = [];
445
478
 
446
- const fakeRequire = createFakeRequire(require);
447
479
  function onAsyncError(error) {
448
480
  asyncErrors.push(error);
449
481
  }
@@ -453,11 +485,13 @@ async function main() {
453
485
  process.once('unhandledRejection', onAsyncError);
454
486
  Object.defineProperty(process.versions, 'bun', { value: '1.1.8', configurable: true });
455
487
  globalThis.Bun = createBunShim();
488
+ const fakeRequire = createFakeRequire(require);
456
489
  process.argv = ['node', extractedFile, ...argv];
457
490
  process.exit = code => {
458
491
  throw new RequestedExit(code);
459
492
  };
460
493
 
494
+ const fn = eval('(' + code);
461
495
  const moduleLike = { exports: {} };
462
496
  const maybePromise = fn(moduleLike.exports, fakeRequire, moduleLike, extractedFile, workdir);
463
497
  if (maybePromise && typeof maybePromise.then === 'function') await maybePromise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/claude-code",
3
- "version": "2.1.153-2",
3
+ "version": "2.1.153-3",
4
4
  "description": "Termux-native Claude Code wrapper with audited native replay",
5
5
  "license": "MIT",
6
6
  "bin": {