codegpt-ai 1.21.0 → 1.23.0
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/chat.py +51 -1
- package/package.json +1 -1
package/chat.py
CHANGED
|
@@ -471,9 +471,15 @@ class SlashCompleter(Completer):
|
|
|
471
471
|
text = document.text_before_cursor.lstrip()
|
|
472
472
|
if text.startswith("/"):
|
|
473
473
|
typed = text.lower()
|
|
474
|
-
|
|
474
|
+
on_termux = os.path.exists("/data/data/com.termux")
|
|
475
|
+
|
|
476
|
+
# Main commands — hide unsupported tool commands on Termux
|
|
475
477
|
for cmd, desc in COMMANDS.items():
|
|
476
478
|
if cmd.startswith(typed):
|
|
479
|
+
# Skip tool commands that don't work on Termux
|
|
480
|
+
tool_name = cmd[1:]
|
|
481
|
+
if on_termux and tool_name in AI_TOOLS and not AI_TOOLS[tool_name].get("termux", True):
|
|
482
|
+
continue
|
|
477
483
|
yield Completion(
|
|
478
484
|
cmd,
|
|
479
485
|
start_position=-len(text),
|
|
@@ -5736,6 +5742,50 @@ def main():
|
|
|
5736
5742
|
tool_key = cmd[1:] # strip /
|
|
5737
5743
|
tool = AI_TOOLS[tool_key]
|
|
5738
5744
|
tool_bin = tool["bin"]
|
|
5745
|
+
|
|
5746
|
+
# Block unsupported tools on Termux — explain why
|
|
5747
|
+
is_termux = os.path.exists("/data/data/com.termux")
|
|
5748
|
+
if is_termux and not tool.get("termux", True):
|
|
5749
|
+
reasons = {
|
|
5750
|
+
"opencode": "OpenCode needs Bun runtime and native x86/x64 binaries that aren't available for ARM processors.",
|
|
5751
|
+
"codex": "Codex requires native binaries that don't compile on ARM/Android.",
|
|
5752
|
+
"gpt4all": "GPT4All needs a C++ backend (llama.cpp) that requires desktop-level hardware to run.",
|
|
5753
|
+
}
|
|
5754
|
+
reason = reasons.get(tool_key, "This tool requires native binaries that aren't available for ARM/Android.")
|
|
5755
|
+
|
|
5756
|
+
# Suggest alternatives
|
|
5757
|
+
alternatives = {
|
|
5758
|
+
"opencode": "/cline or /gemini",
|
|
5759
|
+
"codex": "/gemini or /cline",
|
|
5760
|
+
"gpt4all": "/ollama (if available) or /connect PC_IP",
|
|
5761
|
+
}
|
|
5762
|
+
alt = alternatives.get(tool_key, "Check /tools for available alternatives")
|
|
5763
|
+
|
|
5764
|
+
compact = is_compact()
|
|
5765
|
+
if compact:
|
|
5766
|
+
console.print(Panel(
|
|
5767
|
+
Text.from_markup(
|
|
5768
|
+
f"[bold red]{tool['name']}[/]\n\n"
|
|
5769
|
+
f" [dim]{reason[:60]}[/]\n\n"
|
|
5770
|
+
f" Try: [bright_cyan]{alt}[/]"
|
|
5771
|
+
),
|
|
5772
|
+
title="[bold red]Not Available[/]",
|
|
5773
|
+
border_style="red", padding=(0, 1), width=tw(),
|
|
5774
|
+
))
|
|
5775
|
+
else:
|
|
5776
|
+
console.print(Panel(
|
|
5777
|
+
Text.from_markup(
|
|
5778
|
+
f"[bold red]{tool['name']} is not available on Termux[/]\n\n"
|
|
5779
|
+
f" [bold]Why:[/]\n"
|
|
5780
|
+
f" {reason}\n\n"
|
|
5781
|
+
f" [bold]Alternatives:[/]\n"
|
|
5782
|
+
f" [bright_cyan]{alt}[/]\n\n"
|
|
5783
|
+
f" [dim]Or use this tool on your PC instead.[/]"
|
|
5784
|
+
),
|
|
5785
|
+
title="[bold red]Not Supported[/]",
|
|
5786
|
+
border_style="red", padding=(1, 2), width=tw(),
|
|
5787
|
+
))
|
|
5788
|
+
continue
|
|
5739
5789
|
tool_args = user_input[len(cmd):].strip()
|
|
5740
5790
|
|
|
5741
5791
|
if shutil.which(tool_bin):
|