diff --git a/anton/__init__.py b/anton/__init__.py index 3e2f46a..5becc17 100644 --- a/anton/__init__.py +++ b/anton/__init__.py @@ -1 +1 @@ -__version__ = "0.9.0" +__version__ = "1.0.0" diff --git a/anton/chat.py b/anton/chat.py index 677c9fb..e3737b7 100644 --- a/anton/chat.py +++ b/anton/chat.py @@ -56,7 +56,7 @@ from prompt_toolkit.formatted_text import HTML from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.styles import Style as PTStyle -from rich.prompt import Confirm +from rich.prompt import Confirm, Prompt if TYPE_CHECKING: from rich.console import Console @@ -1581,7 +1581,8 @@ def _print_choices(): _print_choices() while True: - choice = await _prompt_or_cancel("(anton) Choose LLM Provider", choices=["1", "2", "3", "q"], default="q") + choice = await _prompt_or_cancel("(anton) Choose LLM Provider", + choices=["1", "2", "q"], default="q") if choice is None or choice == "q": return session @@ -2189,13 +2190,12 @@ def _print_table() -> list[tuple[str, str, str, str]]: console.print() continue - scope = await _prompt_or_cancel( - "(anton) Store in", + scope = Prompt.ask( + "Store in", choices=["global", "project"], default="global", + console=console, ) - if scope is None: - scope = "global" target_ws = global_ws if scope == "global" else workspace scope_label = ( "~/.anton/.env" @@ -2404,8 +2404,8 @@ async def _handle_connect( "ANTHROPIC_API_KEY" ) if not has_anthropic: - anthropic_key = (await _prompt_or_cancel("(anton) Anthropic API key (for LLM)") or "").strip() - if anthropic_key: + anthropic_key = Prompt.ask("Anthropic API key (for LLM)", console=console) + if anthropic_key.strip(): anthropic_key = anthropic_key.strip() settings.anthropic_api_key = anthropic_key settings.planning_provider = "anthropic" @@ -4194,7 +4194,7 @@ def _bottom_toolbar(): _closing = _ClosingSpinner(console) _closing.start() try: - await session._scratchpads.cancel_all_running() + await session._scratchpads.close_all() finally: _closing.stop() else: diff --git a/anton/cli.py b/anton/cli.py index 365973a..3050efa 100644 --- a/anton/cli.py +++ b/anton/cli.py @@ -382,14 +382,13 @@ def _build_frame(mouth: str, typed_lines: list[str]) -> Text: console.print(f"[anton.glow] {'━' * 40}[/]") console.print() console.print(" [bold]1[/] [link=https://mdb.ai][anton.cyan]Minds-Cloud[/][/link] [anton.success](recommended)[/]") - console.print(" [bold]2[/] [anton.cyan]Minds-Enterprise Server[/]") - console.print(" [bold]3[/] [anton.cyan]Bring your own key[/] [anton.muted]Anthropic / OpenAI[/]") + console.print(" [bold]2[/] [anton.cyan]Bring your own key[/] [anton.muted]Anthropic / OpenAI[/]") console.print() while True: choice = Prompt.ask( "Choose LLM Provider", - choices=["1", "2", "3"], + choices=["1", "2"], default="1", console=console, ) @@ -398,15 +397,14 @@ def _build_frame(mouth: str, typed_lines: list[str]) -> Text: if choice == "1": _setup_minds(settings, ws) elif choice == "2": - _setup_minds(settings, ws, default_url=None) - else: _setup_other_provider(settings, ws) + else: + _setup_minds(settings, ws, default_url=None) break # success except _SetupRetry: console.print() console.print(" [bold]1[/] [link=https://mdb.ai][anton.cyan]Minds-Cloud[/][/link] [anton.success](recommended)[/]") - console.print(" [bold]2[/] [anton.cyan]Minds-Enterprise Server[/]") - console.print(" [bold]3[/] [anton.cyan]Bring your own key[/] [anton.muted]Anthropic / OpenAI[/]") + console.print(" [bold]2[/] [anton.cyan]Bring your own key[/] [anton.muted]Anthropic / OpenAI[/]") console.print() continue