@bash0816/claude-code 2.1.197 → 2.1.200

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.
package/README.md CHANGED
@@ -37,7 +37,7 @@ npm が `claude` bin link を管理する状態になれば、通常の `npm ins
37
37
  Latest audited version / 最新監査済み版:
38
38
 
39
39
  ```sh
40
- npm install -g @bash0816/claude-code@2.1.195
40
+ npm install -g @bash0816/claude-code@2.1.198
41
41
  ```
42
42
 
43
43
  ## Update / 更新
@@ -391,6 +391,24 @@
391
391
  "entry_end_offset": 240507229,
392
392
  "tarball_integrity": "sha512-sx6SoGj3MNR5CV+YDkNtbLHXa1tn3G8qcYFgm1gnvOi9ODQUKbhiPfankJfkTMDVekOvnKJhm6i9hGFIPzp7cQ==",
393
393
  "tarball_sha256": "61b142bb8d6c86e627ac7289739ee38150f598374474de696f3e1cebe112fa41",
394
+ "status": "termux_verified"
395
+ },
396
+ "2.1.198": {
397
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.198",
398
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.198",
399
+ "entry_js_offset": 225462420,
400
+ "entry_end_offset": 243892947,
401
+ "tarball_integrity": "sha512-+7i3CtYtmrcnJQpxP0Jh98Tj6bo2EV98Ip3HViVPPPrf3ZRoseXvacafjlrw8IB0vOYGhp65wKuQ6li4iKLN3A==",
402
+ "tarball_sha256": "83155e7b37846627c91118176996ee7e43bf6aa8a81df55745eb193c7929db62",
403
+ "status": "termux_verified"
404
+ },
405
+ "2.1.200": {
406
+ "wrapper_spec": "@anthropic-ai/claude-code@2.1.200",
407
+ "native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.200",
408
+ "entry_js_offset": 227601092,
409
+ "entry_end_offset": 246293109,
410
+ "tarball_integrity": "sha512-FG0hXbPLzsmmtpbWwc1t1mbZ2HsrBNmn/QLkVMvYXAzxf4vXrHgM7AIZU1cCBNycufXwPAnyzOwO886kkBle7Q==",
411
+ "tarball_sha256": "d7010d06bae10be2dca703633c730d52c5c1391165e8eccd49ff6e7c2571c244",
394
412
  "status": "offset_discovered"
395
413
  }
396
414
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "manifest_version": 1,
3
3
  "package_name": "@bash0816/claude-code",
4
- "latest_audited_version": "2.1.195",
5
- "latest_candidate_version": "2.1.197",
6
- "previous_stable_version": "2.1.193",
4
+ "latest_audited_version": "2.1.198",
5
+ "latest_candidate_version": "2.1.200",
6
+ "previous_stable_version": "2.1.197",
7
7
  "stable_pinned_version": "2.1.176",
8
8
  "manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json"
9
9
  }
@@ -114,7 +114,8 @@ function shouldNotify(cache, latestVersion) {
114
114
 
115
115
  function installTarget(packageName, targetVersion) {
116
116
  const spec = `${packageName}@${targetVersion}`;
117
- const command = `npm install -g ${spec}`;
117
+ const prefix = path.resolve(packageDir, '..', '..', '..', '..');
118
+ const command = `npm install -g --prefix ${prefix} ${spec}`;
118
119
 
119
120
  if (dryRun) {
120
121
  console.log(command);
@@ -122,7 +123,7 @@ function installTarget(packageName, targetVersion) {
122
123
  }
123
124
 
124
125
  console.error(`Updating to audited version ${targetVersion}`);
125
- const result = cp.spawnSync('npm', ['install', '-g', spec], {
126
+ const result = cp.spawnSync('npm', ['install', '-g', '--prefix', prefix, spec], {
126
127
  stdio: 'inherit',
127
128
  env: process.env,
128
129
  });
@@ -553,12 +553,18 @@ function rewriteNativeChunkSource(source) {
553
553
  'module wrapper prefix',
554
554
  1,
555
555
  );
556
+ const _typeofBunExpected = (() => {
557
+ const _ver = String(process.env.CURRENT_CLAUDE_VERSION || '');
558
+ const _m = _ver.match(/^(\d+)\.(\d+)\.(\d+)/);
559
+ if (_m && (Number(_m[1]) > 2 || Number(_m[2]) > 1 || Number(_m[3]) >= 200)) return 7;
560
+ return 6;
561
+ })();
556
562
  patched = replaceRequired(
557
563
  patched,
558
564
  /\btypeof Bun\b/g,
559
565
  'typeof __claudeBun',
560
566
  'typeof Bun',
561
- 6,
567
+ _typeofBunExpected,
562
568
  );
563
569
  patched = replaceRequired(
564
570
  patched,
@@ -574,12 +580,18 @@ function rewriteNativeChunkSource(source) {
574
580
  'globalThis.Bun',
575
581
  1,
576
582
  );
583
+ const _bunPropertyAccessExpected = (() => {
584
+ const _ver = String(process.env.CURRENT_CLAUDE_VERSION || '');
585
+ const _m = _ver.match(/^(\d+)\.(\d+)\.(\d+)/);
586
+ if (_m && (Number(_m[1]) > 2 || Number(_m[2]) > 1 || Number(_m[3]) >= 200)) return 40;
587
+ return 37;
588
+ })();
577
589
  patched = replaceRequired(
578
590
  patched,
579
591
  /\bBun\./g,
580
592
  '__claudeBun.',
581
593
  'Bun property access',
582
- 38,
594
+ _bunPropertyAccessExpected,
583
595
  );
584
596
  patched = replaceRequired(
585
597
  patched,
@@ -1224,12 +1236,18 @@ function rewriteNativeChunkSource(source) {
1224
1236
  'module wrapper prefix',
1225
1237
  1,
1226
1238
  );
1239
+ const _typeofBunExpected = (() => {
1240
+ const _ver = String(process.env.CURRENT_CLAUDE_VERSION || '');
1241
+ const _m = _ver.match(/^(\d+)\.(\d+)\.(\d+)/);
1242
+ if (_m && (Number(_m[1]) > 2 || Number(_m[2]) > 1 || Number(_m[3]) >= 200)) return 7;
1243
+ return 6;
1244
+ })();
1227
1245
  patched = replaceRequired(
1228
1246
  patched,
1229
1247
  /\btypeof Bun\b/g,
1230
1248
  'typeof __claudeBun',
1231
1249
  'typeof Bun',
1232
- 6,
1250
+ _typeofBunExpected,
1233
1251
  );
1234
1252
  patched = replaceRequired(
1235
1253
  patched,
@@ -1245,12 +1263,18 @@ function rewriteNativeChunkSource(source) {
1245
1263
  'globalThis.Bun',
1246
1264
  1,
1247
1265
  );
1266
+ const _bunPropertyAccessExpected = (() => {
1267
+ const _ver = String(process.env.CURRENT_CLAUDE_VERSION || '');
1268
+ const _m = _ver.match(/^(\d+)\.(\d+)\.(\d+)/);
1269
+ if (_m && (Number(_m[1]) > 2 || Number(_m[2]) > 1 || Number(_m[3]) >= 200)) return 40;
1270
+ return 37;
1271
+ })();
1248
1272
  patched = replaceRequired(
1249
1273
  patched,
1250
1274
  /\bBun\./g,
1251
1275
  '__claudeBun.',
1252
1276
  'Bun property access',
1253
- 38,
1277
+ _bunPropertyAccessExpected,
1254
1278
  );
1255
1279
  patched = replaceRequired(
1256
1280
  patched,
@@ -78,7 +78,7 @@ function loadHelperApi() {
78
78
  '\n\nasync function main() {',
79
79
  );
80
80
 
81
- const context = vm.createContext({ module: { exports: {} }, exports: {}, fs, path });
81
+ const context = vm.createContext({ module: { exports: {} }, exports: {}, fs, path, process });
82
82
  vm.runInContext(
83
83
  `${replaceSource}\n${cleanupSource}\n${fullWidthSource}\n${graphemeWidthSource}\n${stripAnsiSource}\n${stringWidthSource}\n${wrapAnsiSource}\n${stableHashSource}\n${rewriteSource}\nmodule.exports = { replaceRequired, cleanupStaleEntryFiles, isFullWidthCodePoint, graphemeWidth, stripANSI, stringWidth, wrapAnsi, stableHash, rewriteNativeChunkSource };`,
84
84
  context,
@@ -279,22 +279,48 @@ test('cleanupStaleEntryFiles removes only stale extracted files for the same off
279
279
 
280
280
  function buildSyntheticBundleSource() {
281
281
  const typeofBun = Array.from({ length: 6 }, () => 'typeof Bun').join('; ');
282
- const bunProps = Array.from({ length: 38 }, (_, index) => `Bun.p${index}`).join('; ');
282
+ const bunProps = Array.from({ length: 37 }, (_, index) => `Bun.p${index}`).join('; ');
283
283
  return `function(exports, require, module, __filename, __dirname) { ${typeofBun}; typeof globalThis.Bun; globalThis.Bun; ${bunProps}; npmInstallDeprecated:!0 }`;
284
284
  }
285
285
 
286
- test('rewriteNativeChunkSource rewrites the synthetic bundle slice', () => {
287
- const { rewriteNativeChunkSource } = loadHelperApi();
288
- const source = buildSyntheticBundleSource();
289
- const patched = rewriteNativeChunkSource(source);
290
-
291
- assert.match(patched, /var __claudeBun = globalThis\.__claudeBunShim;/);
292
- assert.match(patched, /typeof __claudeBun/);
293
- assert.match(patched, /typeof globalThis\.__claudeBun/);
294
- assert.match(patched, /globalThis\.__claudeBun/);
295
- assert.match(patched, /__claudeBun\./);
296
- assert.match(patched, /npmInstallDeprecated:!1/);
297
- assert.doesNotMatch(patched, /npmInstallDeprecated:!0/);
286
+ test('rewriteNativeChunkSource rewrites the synthetic bundle slice (version 2.1.198)', () => {
287
+ process.env.CURRENT_CLAUDE_VERSION = '2.1.198';
288
+ try {
289
+ const { rewriteNativeChunkSource } = loadHelperApi();
290
+ const source = buildSyntheticBundleSource();
291
+ const patched = rewriteNativeChunkSource(source);
292
+
293
+ assert.match(patched, /var __claudeBun = globalThis\.__claudeBunShim;/);
294
+ assert.match(patched, /typeof __claudeBun/);
295
+ assert.match(patched, /typeof globalThis\.__claudeBun/);
296
+ assert.match(patched, /globalThis\.__claudeBun/);
297
+ assert.match(patched, /__claudeBun\./);
298
+ assert.match(patched, /npmInstallDeprecated:!1/);
299
+ assert.doesNotMatch(patched, /npmInstallDeprecated:!0/);
300
+ } finally {
301
+ delete process.env.CURRENT_CLAUDE_VERSION;
302
+ }
303
+ });
304
+
305
+ test('rewriteNativeChunkSource rewrites the synthetic bundle slice (version 2.1.200)', () => {
306
+ process.env.CURRENT_CLAUDE_VERSION = '2.1.200';
307
+ try {
308
+ const { rewriteNativeChunkSource } = loadHelperApi();
309
+ const typeofBun = Array.from({ length: 7 }, () => 'typeof Bun').join('; ');
310
+ const bunProps = Array.from({ length: 40 }, (_, index) => `Bun.p${index}`).join('; ');
311
+ const source = `function(exports, require, module, __filename, __dirname) { ${typeofBun}; typeof globalThis.Bun; globalThis.Bun; ${bunProps}; npmInstallDeprecated:!0 }`;
312
+ const patched = rewriteNativeChunkSource(source);
313
+
314
+ assert.match(patched, /var __claudeBun = globalThis\.__claudeBunShim;/);
315
+ assert.match(patched, /typeof __claudeBun/);
316
+ assert.match(patched, /typeof globalThis\.__claudeBun/);
317
+ assert.match(patched, /globalThis\.__claudeBun/);
318
+ assert.match(patched, /__claudeBun\./);
319
+ assert.match(patched, /npmInstallDeprecated:!1/);
320
+ assert.doesNotMatch(patched, /npmInstallDeprecated:!0/);
321
+ } finally {
322
+ delete process.env.CURRENT_CLAUDE_VERSION;
323
+ }
298
324
  });
299
325
 
300
326
  test('rewriteNativeChunkSource rejects unexpected replacement counts', () => {
@@ -303,7 +329,7 @@ test('rewriteNativeChunkSource rejects unexpected replacement counts', () => {
303
329
 
304
330
  assert.throws(
305
331
  () => rewriteNativeChunkSource(source),
306
- /unexpected Bun property access count 37/,
332
+ /unexpected Bun property access count 36/,
307
333
  );
308
334
  });
309
335
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/claude-code",
3
- "version": "2.1.197",
3
+ "version": "2.1.200",
4
4
  "description": "Unofficial Termux-native Claude Code wrapper with audited native replay",
5
5
  "license": "GPL-3.0-only",
6
6
  "bin": {