karnel-termux 4.16.3 → 4.16.4

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.
@@ -0,0 +1 @@
1
+ a752d0efbec23e962487065c86fd1b87d276f8dd
@@ -156,6 +156,10 @@ _run_ai_tool_action() {
156
156
  local id="$2"
157
157
  local func_name="${action}_${id//-/_}"
158
158
 
159
+ # A specific --<tool> was requested: skip nested interactive menus and
160
+ # auto-select the recommended installation method.
161
+ export KARNEL_NONINTERACTIVE=1
162
+
159
163
  _ai_tool_registered "$id" || return 127
160
164
 
161
165
  if [[ "$action" != "reinstall" ]]; then
@@ -352,6 +352,22 @@ read_select() {
352
352
  local var="$2"
353
353
  shift 2
354
354
  local -a options=("$@")
355
+
356
+ # Non-interactive mode: a specific --<tool> was requested, so auto-pick
357
+ # the recommended (first) option instead of prompting. This also covers
358
+ # piped/non-TTY input. Tools can still override via KARNEL_INSTALL_METHOD.
359
+ local _auto="${KARNEL_INSTALL_METHOD:-0}"
360
+ if [[ -n "${KARNEL_NONINTERACTIVE:-}" ]] || [[ ! -t 0 ]]; then
361
+ if [[ "$_auto" != "0" ]] && (( _auto < ${#options[@]} )); then
362
+ selected="$_auto"
363
+ else
364
+ selected=0
365
+ fi
366
+ read -r "$var" <<<"${options[$selected]}"
367
+ echo -e " ${GRAY}└─${D_CYAN}▶ ${D_NC}${options[$selected]}${D_NC}" >&2
368
+ return 0
369
+ fi
370
+
355
371
  local selected=0
356
372
  local total=${#options[@]}
357
373
  local cols
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karnel-termux",
3
- "version": "4.16.3",
3
+ "version": "4.16.4",
4
4
  "description": "Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command",
5
5
  "bin": {
6
6
  "karnel": "karnel/bin/karnel"