@mmmbuto/qwen-code-termux 0.6.403-termux → 0.6.405-termux

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
@@ -1,7 +1,7 @@
1
1
  # 🤖 Qwen Code – Termux Edition
2
2
 
3
3
  Android/Termux optimized fork of Qwen Code CLI. Installs cleanly on Termux
4
- by skipping native modules and using mobile‑friendly fallbacks.
4
+ with a native ARM64 PTY prebuild and mobile‑friendly fallbacks.
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/@mmmbuto/qwen-code-termux?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mmmbuto/qwen-code-termux)
7
7
  [![downloads](https://img.shields.io/npm/dt/@mmmbuto/qwen-code-termux?style=flat-square)](https://www.npmjs.com/package/@mmmbuto/qwen-code-termux)
@@ -14,7 +14,7 @@ by skipping native modules and using mobile‑friendly fallbacks.
14
14
  **Optimized Termux edition** of `QwenLM/qwen-code`.
15
15
 
16
16
  - **Termux‑First:** Android filesystem and shell fallbacks.
17
- - **Lightweight:** No native PTY/keychain deps.
17
+ - **Lightweight:** PTY via `@mmmbuto/node-pty-android-arm64`, no keychain deps.
18
18
  - **Up‑to‑Date:** Tracks upstream Qwen Code.
19
19
 
20
20
  ## Installation (Termux)
@@ -24,7 +24,7 @@ pkg update && pkg upgrade -y
24
24
  pkg install nodejs-lts -y
25
25
  npm install -g @mmmbuto/qwen-code-termux
26
26
 
27
- qwen --version # expected: 0.6.403-termux
27
+ qwen --version # expected: 0.6.405-termux
28
28
  ```
29
29
 
30
30
  Build from source:
@@ -32,7 +32,7 @@ Build from source:
32
32
  ```bash
33
33
  git clone https://github.com/DioNanos/qwen-code-termux.git
34
34
  cd qwen-code-termux
35
- npm install --ignore-optional --ignore-scripts
35
+ npm install
36
36
  npm run build && npm run bundle
37
37
  node dist/cli.js --version
38
38
  ```
@@ -78,11 +78,13 @@ export OPENAI_MODEL="gpt-4o" # optional
78
78
  - **OAuth:** browser launch via `termux-open-url` with Android fallback.
79
79
  - **Clean UX:** desktop‑centric warnings suppressed on Termux.
80
80
  - **Defaults:** banner hidden by default on Termux (toggle in settings).
81
+ - **PTY:** prebuilt `@mmmbuto/node-pty-android-arm64` for interactive shells.
81
82
 
82
83
  ## Documentation & Fixes
83
84
 
84
85
  - **Test Suite**: [`QWEN_TEST_SUITE.md`](./QWEN_TEST_SUITE.md)
85
- - **Test Report**: [`QWEN_TEST_REPORT_v0.6.403-termux.md`](./QWEN_TEST_REPORT_v0.6.403-termux.md)
86
+ - **Test Report**: [`QWEN_TEST_REPORT_v0.6.405-termux.md`](./QWEN_TEST_REPORT_v0.6.405-termux.md)
87
+ (latest report; 0.6.405-termux)
86
88
  - **Patches**: [`docs/patches/README.md`](./docs/patches/README.md)
87
89
  - **Termux Fixes**: [`docs/patches/TERMUX_FIXES.md`](./docs/patches/TERMUX_FIXES.md)
88
90
 
@@ -153,7 +155,7 @@ npm install -g @mmmbuto/qwen-code-termux@latest
153
155
 
154
156
  ### Versions
155
157
 
156
- - **latest / stable**: 0.6.403-termux
158
+ - **latest / stable**: 0.6.405-termux
157
159
 
158
160
  ## Benchmark Results
159
161
 
package/dist/cli.js CHANGED
@@ -155008,7 +155008,7 @@ __export(geminiContentGenerator_exports, {
155008
155008
  createGeminiContentGenerator: () => createGeminiContentGenerator
155009
155009
  });
155010
155010
  function createGeminiContentGenerator(config2, gcConfig) {
155011
- const version2 = "0.6.403-termux";
155011
+ const version2 = "0.6.405-termux";
155012
155012
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
155013
155013
  const baseHeaders = {
155014
155014
  "User-Agent": userAgent2
@@ -160084,18 +160084,16 @@ var init_getPty = __esm({
160084
160084
  "use strict";
160085
160085
  init_esbuild_shims();
160086
160086
  getPty = /* @__PURE__ */ __name(async () => {
160087
+ const isAndroid2 = process.platform === "android" || process.env["PREFIX"]?.includes("com.termux");
160088
+ if (!isAndroid2) {
160089
+ return null;
160090
+ }
160087
160091
  try {
160088
- const lydell = "@lydell/node-pty";
160089
- const module2 = await import(lydell);
160090
- return { module: module2, name: "lydell-node-pty" };
160092
+ const mmmbuto = "@mmmbuto/node-pty-android-arm64";
160093
+ const module2 = await import(mmmbuto);
160094
+ return { module: module2, name: "mmmbuto-node-pty" };
160091
160095
  } catch (_e2) {
160092
- try {
160093
- const nodePty = "node-pty";
160094
- const module2 = await import(nodePty);
160095
- return { module: module2, name: "node-pty" };
160096
- } catch (_e22) {
160097
- return null;
160098
- }
160096
+ return null;
160099
160097
  }
160100
160098
  }, "getPty");
160101
160099
  }
@@ -170278,7 +170276,7 @@ var init_shellExecutionService = __esm({
170278
170276
  error: error2,
170279
170277
  aborted: abortSignal.aborted,
170280
170278
  pid: ptyProcess.pid,
170281
- executionMethod: ptyInfo?.name ?? "node-pty"
170279
+ executionMethod: ptyInfo?.name ?? "mmmbuto-node-pty"
170282
170280
  });
170283
170281
  });
170284
170282
  });
@@ -334936,6 +334934,36 @@ var require_ansi_align = __commonJS({
334936
334934
  // packages/cli/index.ts
334937
334935
  init_esbuild_shims();
334938
334936
 
334937
+ // packages/cli/src/patches/termux-runtime.ts
334938
+ init_esbuild_shims();
334939
+ if (typeof Uint8Array.fromBase64 !== "function") {
334940
+ Uint8Array.fromBase64 = (base642) => {
334941
+ const buf = Buffer.from(base642, "base64");
334942
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
334943
+ };
334944
+ }
334945
+ if (typeof Uint8Array.prototype.toBase64 !== "function") {
334946
+ Uint8Array.prototype.toBase64 = function() {
334947
+ return Buffer.from(this).toString("base64");
334948
+ };
334949
+ }
334950
+ if (process.platform === "android") {
334951
+ if (process.env["PREFIX"] && !process.env["TERMUX__PREFIX"]) {
334952
+ process.env["TERMUX__PREFIX"] = process.env["PREFIX"];
334953
+ }
334954
+ const origEmit = process.emit.bind(process);
334955
+ process.emit = (...args) => {
334956
+ const name3 = args[0];
334957
+ const warning = args[1];
334958
+ if (name3 === "warning") {
334959
+ if (warning?.name === "DeprecationWarning" && warning.message?.includes("punycode")) {
334960
+ return false;
334961
+ }
334962
+ }
334963
+ return origEmit(...args);
334964
+ };
334965
+ }
334966
+
334939
334967
  // packages/cli/src/gemini.tsx
334940
334968
  init_esbuild_shims();
334941
334969
 
@@ -356998,7 +357026,7 @@ __name(getPackageJson, "getPackageJson");
356998
357026
  // packages/cli/src/utils/version.ts
356999
357027
  async function getCliVersion() {
357000
357028
  const pkgJson = await getPackageJson();
357001
- return "0.6.403-termux";
357029
+ return "0.6.405-termux";
357002
357030
  }
357003
357031
  __name(getCliVersion, "getCliVersion");
357004
357032
 
@@ -365081,7 +365109,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
365081
365109
 
365082
365110
  // packages/cli/src/generated/git-commit.ts
365083
365111
  init_esbuild_shims();
365084
- var GIT_COMMIT_INFO2 = "7bfdc96f";
365112
+ var GIT_COMMIT_INFO2 = "cac3a692";
365085
365113
 
365086
365114
  // packages/cli/src/utils/systemInfo.ts
365087
365115
  async function getNpmVersion() {
@@ -416299,7 +416327,7 @@ var GeminiAgent = class {
416299
416327
  name: APPROVAL_MODE_INFO[mode].name,
416300
416328
  description: APPROVAL_MODE_INFO[mode].description
416301
416329
  }));
416302
- const version2 = "0.6.403-termux";
416330
+ const version2 = "0.6.405-termux";
416303
416331
  return {
416304
416332
  protocolVersion: PROTOCOL_VERSION,
416305
416333
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/qwen-code-termux",
3
- "version": "0.6.403-termux",
3
+ "version": "0.6.405-termux",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/DioNanos/qwen-code-termux.git"
14
14
  },
15
15
  "config": {
16
- "sandboxImageUri": "ghcr.io/mmmbuto/qwen-code-termux:0.6.403-termux"
16
+ "sandboxImageUri": "ghcr.io/mmmbuto/qwen-code-termux:0.6.405-termux"
17
17
  },
18
18
  "scripts": {
19
19
  "start": "cross-env node scripts/start.js",
@@ -49,7 +49,7 @@
49
49
  "typecheck": "npm run typecheck --workspaces --if-present",
50
50
  "check-i18n": "npm run check-i18n --workspace=packages/cli",
51
51
  "preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
52
- "prepare": "husky && npm run bundle",
52
+ "prepare": "node scripts/prepare-termux.cjs",
53
53
  "prepare:package": "node scripts/prepare-package.js",
54
54
  "release:version": "node scripts/version.js",
55
55
  "telemetry": "node scripts/telemetry.js",
@@ -116,13 +116,7 @@
116
116
  "simple-git": "^3.28.0"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@lydell/node-pty": "1.1.0",
120
- "@lydell/node-pty-darwin-arm64": "1.1.0",
121
- "@lydell/node-pty-darwin-x64": "1.1.0",
122
- "@lydell/node-pty-linux-x64": "1.1.0",
123
- "@lydell/node-pty-win32-arm64": "1.1.0",
124
- "@lydell/node-pty-win32-x64": "1.1.0",
125
- "@lydell/node-pty-linux-arm64": "1.2.0-beta.2"
119
+ "@mmmbuto/node-pty-android-arm64": "1.1.0"
126
120
  },
127
121
  "lint-staged": {
128
122
  "*.{js,jsx,ts,tsx}": [
@@ -9,5 +9,6 @@ const os = require('node:os');
9
9
 
10
10
  if (os.platform() === 'android' || process.env.PREFIX?.includes('com.termux')) {
11
11
  console.log('✓ qwen-code-termux installed');
12
+ console.log(' PTY: @mmmbuto/node-pty-android-arm64');
12
13
  console.log(' Run: qwen');
13
14
  }
@@ -114,16 +114,10 @@ const isTermuxBuild =
114
114
  !!process.env['TERMUX_VERSION'] ||
115
115
  !!(process.env['PREFIX'] && process.env['PREFIX'].includes('com.termux'));
116
116
  const optionalDependencies = isTermuxBuild
117
- ? undefined
118
- : {
119
- '@lydell/node-pty': '1.1.0',
120
- '@lydell/node-pty-darwin-arm64': '1.1.0',
121
- '@lydell/node-pty-darwin-x64': '1.1.0',
122
- '@lydell/node-pty-linux-x64': '1.1.0',
123
- '@lydell/node-pty-win32-arm64': '1.1.0',
124
- '@lydell/node-pty-win32-x64': '1.1.0',
125
- 'node-pty': '^1.0.0',
126
- };
117
+ ? {
118
+ '@mmmbuto/node-pty-android-arm64': '1.1.0',
119
+ }
120
+ : undefined;
127
121
 
128
122
  // Create a clean package.json for the published package
129
123
  const distPackageJson = {
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ const os = require('node:os');
8
+ const { spawnSync } = require('node:child_process');
9
+
10
+ const isTermux =
11
+ os.platform() === 'android' ||
12
+ process.env.TERMUX_VERSION ||
13
+ (process.env.PREFIX && process.env.PREFIX.includes('com.termux'));
14
+
15
+ if (isTermux) {
16
+ process.exit(0);
17
+ }
18
+
19
+ const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
20
+
21
+ let result = spawnSync(npmCmd, ['exec', 'husky'], {
22
+ stdio: 'inherit',
23
+ env: process.env,
24
+ });
25
+ if (result.status !== 0) {
26
+ process.exit(result.status === null ? 1 : result.status);
27
+ }
28
+
29
+ result = spawnSync(npmCmd, ['run', 'bundle'], {
30
+ stdio: 'inherit',
31
+ env: process.env,
32
+ });
33
+ process.exit(result.status === null ? 1 : result.status);