karnel-termux 4.16.5 → 4.16.6

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.
@@ -1 +1 @@
1
- dec504491f5db85829b3a0aacb805faf843795cc
1
+ 8fe9d579a4a8d7fbcab5a8495b1bba025dc684a9
@@ -204,6 +204,9 @@ _install_specific_tools() {
204
204
  done
205
205
 
206
206
  for tool in "${tools[@]}"; do
207
+ # Accept the binary/command name (e.g. --agy) or display name as an
208
+ # alias for the canonical install flag (e.g. --antigravity-cli).
209
+ tool="$(_ai_tool_resolve "$tool")"
207
210
  local func_name="install_${tool//-/_}"
208
211
 
209
212
  if [[ -z "${_tool_binaries[$tool]+registered}" ]]; then
@@ -151,9 +151,34 @@ _ai_tool_registered() {
151
151
  return 1
152
152
  }
153
153
 
154
+ # Resolve a user token (install flag, binary name, or display name,
155
+ # case-insensitive) to the canonical registry id. Echoes the id and
156
+ # returns 0 when a match is found, otherwise echoes the token unchanged
157
+ # and returns 1.
158
+ _ai_tool_resolve() {
159
+ local token="$1" entry id name bins
160
+ for entry in "${AI_TOOLS_REGISTRY[@]}"; do
161
+ IFS=':' read -r id name bins <<< "$entry"
162
+ [[ "$id" == "$token" ]] && { echo "$id"; return 0; }
163
+ [[ "$name" == "$token" ]] && { echo "$id"; return 0; }
164
+ [[ "${name,,}" == "${token,,}" ]] && { echo "$id"; return 0; }
165
+ local IFS=',' b
166
+ for b in $bins; do
167
+ [[ "$b" == "$token" ]] && { echo "$id"; return 0; }
168
+ done
169
+ done
170
+ echo "$token"
171
+ return 1
172
+ }
173
+
154
174
  _run_ai_tool_action() {
155
175
  local action="$1"
156
176
  local id="$2"
177
+
178
+ # Accept the binary/command name (e.g. --agy) or display name as aliases
179
+ # for the canonical install flag (e.g. --antigravity-cli).
180
+ id="$(_ai_tool_resolve "$id")"
181
+
157
182
  local func_name="${action}_${id//-/_}"
158
183
 
159
184
  # A specific --<tool> was requested: skip nested interactive menus and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karnel-termux",
3
- "version": "4.16.5",
3
+ "version": "4.16.6",
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"