@emend-ai/utim 1.46.9 → 1.46.12

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.
Files changed (2) hide show
  1. package/bin/utim.js +37 -41
  2. package/package.json +1 -1
package/bin/utim.js CHANGED
@@ -107,15 +107,22 @@ function runPip(python, extraFlags) {
107
107
  return isUtimInstalled(python);
108
108
  } else {
109
109
  // Linux / Termux fallback: run in current terminal
110
- const r = spawnSync(
111
- python,
112
- ['-m', 'pip', 'install', '--upgrade', ...extraFlags, 'utim-cli'],
113
- {
114
- stdio: 'inherit',
115
- shell: false,
116
- timeout: 300000,
117
- }
118
- );
110
+ const pipArgs = ['-m', 'pip', 'install'];
111
+ if (isTermux) {
112
+ // On Termux: do NOT use --upgrade to prevent pip from pulling newer
113
+ // versions of pydantic-core from PyPI and trying to compile from source.
114
+ // Instead, use --upgrade-strategy only-if-needed to keep the pre-compiled version.
115
+ pipArgs.push('--upgrade-strategy', 'only-if-needed');
116
+ } else {
117
+ pipArgs.push('--upgrade');
118
+ }
119
+ pipArgs.push(...extraFlags, 'utim-cli');
120
+
121
+ const r = spawnSync(python, pipArgs, {
122
+ stdio: 'inherit',
123
+ shell: false,
124
+ timeout: 300000,
125
+ });
119
126
  return r.status === 0;
120
127
  }
121
128
  } catch (_) {
@@ -127,52 +134,41 @@ function installEngine(python) {
127
134
  let termuxFlags = [];
128
135
  if (isTermux) {
129
136
  process.stderr.write(
130
- '\nšŸ’” Termux detected. Installing prebuilt system packages...\n\n'
137
+ '\nšŸ’” Termux detected. Preparing Android-compatible dependencies...\n\n'
131
138
  );
132
139
 
133
- // Step 1: install prebuilt system-level cryptography to avoid Rust/C compilation
134
- spawnSync('pkg', ['install', '-y', 'python-cryptography'], {
135
- stdio: 'inherit',
136
- shell: false,
137
- });
138
-
139
- // Step 2: upgrade pip/setuptools/wheel first
140
- spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
141
- stdio: 'pipe',
142
- shell: false,
143
- timeout: 60000,
144
- });
140
+ // Step 1: upgrade pkg repo list
141
+ spawnSync('pkg', ['update', '-y'], { stdio: 'pipe', shell: false, timeout: 30000 });
145
142
 
146
- // Step 3: pre-install pydantic-core from the Android pre-built wheel index
147
- // BEFORE installing utim-cli, so pip never tries to compile it from Rust source.
148
- process.stderr.write('\nāš™ Pre-installing pydantic-core (Android prebuilt wheel)...\n\n');
149
- const pydanticInstall = spawnSync(
150
- python,
151
- [
152
- '-m', 'pip', 'install', '--upgrade', '--quiet',
153
- 'pydantic-core',
154
- '--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
155
- ],
143
+ // Step 2: install pydantic via Termux's own compiled package.
144
+ // This is the ONLY reliable way to get pydantic-core on Android without
145
+ // a Rust toolchain. pkg ships a prebuilt binary for aarch64-linux-android.
146
+ process.stderr.write('āš™ Installing pydantic via Termux package manager...\n\n');
147
+ const pkgResult = spawnSync(
148
+ 'pkg', ['install', '-y', 'python-pydantic', 'python-cryptography'],
156
149
  { stdio: 'inherit', shell: false, timeout: 120000 }
157
150
  );
158
151
 
159
- if (pydanticInstall.status !== 0) {
152
+ if (pkgResult.status !== 0) {
160
153
  process.stderr.write(
161
- '\n⚠ pydantic-core prebuilt install failed. Will try Termux repository fallback...\n\n'
154
+ '\n⚠ pkg install failed — will try pip with prebuilt wheel index as fallback...\n\n'
162
155
  );
163
- // Fallback: Termux user repository
156
+ // Fallback: Eutalix prebuilt wheels (works for Python 3.11/3.12)
164
157
  spawnSync(
165
158
  python,
166
- [
167
- '-m', 'pip', 'install', '--upgrade', '--quiet',
168
- 'pydantic-core',
169
- '--extra-index-url', 'https://termux-user-repository.github.io/pypi/',
170
- ],
159
+ ['-m', 'pip', 'install', '--upgrade', '--quiet',
160
+ 'pydantic-core', 'pydantic',
161
+ '--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/'],
171
162
  { stdio: 'inherit', shell: false, timeout: 120000 }
172
163
  );
173
164
  }
174
165
 
175
- // Extra index flags for the main utim-cli install (catches any remaining Rust deps)
166
+ // Step 3: upgrade pip/setuptools/wheel
167
+ spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
168
+ stdio: 'pipe', shell: false, timeout: 60000,
169
+ });
170
+
171
+ // Extra index as safety net for any remaining Rust-based transitive deps
176
172
  termuxFlags = [
177
173
  '--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
178
174
  '--extra-index-url', 'https://termux-user-repository.github.io/pypi/',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emend-ai/utim",
3
- "version": "1.46.9",
3
+ "version": "1.46.12",
4
4
  "description": "UTIM – Universal Terminal Intelligence Manager. An agentic AI coding assistant for your terminal.",
5
5
  "keywords": [
6
6
  "ai",