@emend-ai/utim 1.46.10 → 1.46.13

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 +42 -32
  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 (_) {
@@ -130,33 +137,36 @@ function installEngine(python) {
130
137
  '\nšŸ’” Termux detected. Preparing Android-compatible dependencies...\n\n'
131
138
  );
132
139
 
133
- // Step 1: upgrade pkg repo list
134
- spawnSync('pkg', ['update', '-y'], { stdio: 'pipe', shell: false, timeout: 30000 });
140
+ // Step 1: Install python-cryptography via pkg to avoid heavy cryptography C/Rust compilation
141
+ process.stderr.write('āš™ Installing python-cryptography via Termux package manager...\n\n');
142
+ spawnSync('pkg', ['install', '-y', 'python-cryptography'], {
143
+ stdio: 'inherit',
144
+ shell: false,
145
+ });
135
146
 
136
- // Step 2: install pydantic via Termux's own compiled package.
137
- // This is the ONLY reliable way to get pydantic-core on Android without
138
- // a Rust toolchain. pkg ships a prebuilt binary for aarch64-linux-android.
139
- process.stderr.write('āš™ Installing pydantic via Termux package manager...\n\n');
140
- const pkgResult = spawnSync(
141
- 'pkg', ['install', '-y', 'python-pydantic', 'python-cryptography'],
142
- { stdio: 'inherit', shell: false, timeout: 120000 }
147
+ // Step 2: Install pydantic-core using the Eutalix community shell installer script.
148
+ // This is the only bulletproof way to download the pre-compiled Android aarch64 wheel
149
+ // for Python 3.13+ without triggering compiling from Rust source.
150
+ process.stderr.write('\nāš™ Running precompiled pydantic-core Android wheel installer...\n\n');
151
+ spawnSync(
152
+ 'sh',
153
+ ['-c', 'curl -sL https://raw.githubusercontent.com/Eutalix/android-pydantic-core/main/install_pydantic_core.sh | bash'],
154
+ { stdio: 'inherit', shell: false, timeout: 180000 }
143
155
  );
144
156
 
145
- if (pkgResult.status !== 0) {
146
- process.stderr.write(
147
- '\n⚠ pkg install failed — will try pip with prebuilt wheel index as fallback...\n\n'
148
- );
149
- // Fallback: Eutalix prebuilt wheels (works for Python 3.11/3.12)
150
- spawnSync(
151
- python,
152
- ['-m', 'pip', 'install', '--upgrade', '--quiet',
153
- 'pydantic-core', 'pydantic',
154
- '--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/'],
155
- { stdio: 'inherit', shell: false, timeout: 120000 }
156
- );
157
- }
157
+ // Step 3: Install pydantic v2 from the extra index (WITHOUT --upgrade, so it uses the local pre-built wheel)
158
+ process.stderr.write('\nāš™ Installing pydantic v2 (pre-compiled wheel)...\n\n');
159
+ spawnSync(
160
+ python,
161
+ [
162
+ '-m', 'pip', 'install',
163
+ 'pydantic',
164
+ '--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
165
+ ],
166
+ { stdio: 'inherit', shell: false, timeout: 120000 }
167
+ );
158
168
 
159
- // Step 3: upgrade pip/setuptools/wheel
169
+ // Step 4: Upgrade pip/setuptools/wheel
160
170
  spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
161
171
  stdio: 'pipe', shell: false, timeout: 60000,
162
172
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emend-ai/utim",
3
- "version": "1.46.10",
3
+ "version": "1.46.13",
4
4
  "description": "UTIM – Universal Terminal Intelligence Manager. An agentic AI coding assistant for your terminal.",
5
5
  "keywords": [
6
6
  "ai",