kiwi-code 0.0.31__tar.gz → 0.0.32__tar.gz

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 (52) hide show
  1. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/PKG-INFO +1 -1
  2. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/pyproject.toml +1 -1
  3. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/dashboard.py +53 -16
  4. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/uv.lock +1 -1
  5. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/.github/workflows/publish.yml +0 -0
  6. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/.github/workflows/test.yml +0 -0
  7. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/.gitignore +0 -0
  8. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/.python-version +0 -0
  9. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/CLAUDE.md +0 -0
  10. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/Makefile +0 -0
  11. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/README.md +0 -0
  12. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/__init__.py +0 -0
  13. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/auth.py +0 -0
  14. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/cli.py +0 -0
  15. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/client.py +0 -0
  16. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/commands.py +0 -0
  17. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/logger.py +0 -0
  18. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/models.py +0 -0
  19. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/runtime_manager.py +0 -0
  20. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_cli/server.py +0 -0
  21. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_runtime/__init__.py +0 -0
  22. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_runtime/__main__.py +0 -0
  23. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_runtime/main.py +0 -0
  24. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_runtime/snake_game/.gitignore +0 -0
  25. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_runtime/snake_game/requirements.txt +0 -0
  26. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/__init__.py +0 -0
  27. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/inline_file_picker.py +0 -0
  28. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/main.py +0 -0
  29. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/random_words.py +0 -0
  30. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/runtime_agent.py +0 -0
  31. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/__init__.py +0 -0
  32. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/attach_content.py +0 -0
  33. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/command_result.py +0 -0
  34. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/file_browser.py +0 -0
  35. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/help.py +0 -0
  36. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/id_picker.py +0 -0
  37. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/login.py +0 -0
  38. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/runtime_cleanup.py +0 -0
  39. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/runtime_logs.py +0 -0
  40. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/screens/slash_picker.py +0 -0
  41. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/slash_commands.py +0 -0
  42. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/status_words.py +0 -0
  43. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/src/kiwi_tui/widgets.py +0 -0
  44. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/test_hello.py +0 -0
  45. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/__init__.py +0 -0
  46. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/conftest.py +0 -0
  47. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_cli_help.py +0 -0
  48. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_imports.py +0 -0
  49. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_reexec_kiwi.py +0 -0
  50. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_runtime_log_trimming.py +0 -0
  51. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_tokens.py +0 -0
  52. {kiwi_code-0.0.31 → kiwi_code-0.0.32}/tests/test_tui_headless.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kiwi-code
3
- Version: 0.0.31
3
+ Version: 0.0.32
4
4
  Summary: A textual-based terminal user interface application
5
5
  Project-URL: Homepage, https://meetkiwi.ai
6
6
  Project-URL: Repository, https://github.com/jetoslabs/kiwi-code
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kiwi-code"
3
- version = "0.0.31"
3
+ version = "0.0.32"
4
4
  description = "A textual-based terminal user interface application"
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  requires-python = ">=3.11,<4.0"
@@ -721,6 +721,36 @@ class DashboardScreen(Screen):
721
721
  def show(body: str, *, is_error: bool = False, title: str | None = None) -> None:
722
722
  self._show_command_result(title or command, body, is_error=is_error)
723
723
 
724
+ def toast(
725
+ message: str,
726
+ *,
727
+ severity: "SeverityLevel" = "information",
728
+ title: str = "",
729
+ timeout: float | None = 2.5,
730
+ ) -> None:
731
+ """Show a non-blocking toast notification.
732
+
733
+ Preferred for slash commands where the user doesn't need a full modal
734
+ (e.g. /new, /use, /continue).
735
+ """
736
+ try:
737
+ # Screen inherits Widget, which provides notify() (delegates to App.notify).
738
+ self.notify(
739
+ message,
740
+ title=title,
741
+ severity=severity,
742
+ timeout=timeout,
743
+ markup=False,
744
+ )
745
+ except Exception:
746
+ # If toast notifications fail for any reason, fall back to the modal so
747
+ # the user still gets feedback.
748
+ self._show_command_result(
749
+ title or command, message, is_error=severity == "error"
750
+ )
751
+
752
+
753
+
724
754
  # --- TUI-specific commands ---
725
755
 
726
756
  if cmd == "/upload":
@@ -871,11 +901,11 @@ class DashboardScreen(Screen):
871
901
  self.current_run_kind = None
872
902
  self._update_run_status_bar()
873
903
  self._clear_chat_messages()
874
- show(f"Starting new conversation with default action ({self.DEFAULT_ACTION_ID}).")
904
+ toast("Started a new conversation.", title="/new")
875
905
  return
876
906
  if cmd == "/use":
877
907
  if not args:
878
- show("Usage: /use <action_id>")
908
+ toast("Usage: /use <action_id>", title="/use", severity="warning")
879
909
  return
880
910
  action_id = args[0]
881
911
  from kiwi_cli.commands import actions_get
@@ -885,19 +915,19 @@ class DashboardScreen(Screen):
885
915
  if lines is None:
886
916
  return
887
917
  if lines and lines[0].startswith("Error"):
888
- show(f"Action not found: {action_id}", is_error=True)
918
+ toast(f"Action not found: {action_id}", title="/use", severity="error")
889
919
  return
890
920
  self.current_action_id = action_id
891
921
  self.current_run_id = None
892
922
  self.current_run_kind = None
893
923
  self._update_run_status_bar()
894
924
  self._clear_chat_messages()
895
- show("\n".join(["Switched to action:"] + lines))
925
+ toast(f"Switched to action {action_id}.", title="/use")
896
926
  return
897
927
 
898
928
  if cmd == "/continue":
899
929
  if not args:
900
- show("Usage: /continue <run_id>")
930
+ toast("Usage: /continue <run_id>", title="/continue", severity="warning")
901
931
  return
902
932
  run_id = args[0]
903
933
  from kiwi_cli.commands import runs_get
@@ -907,24 +937,26 @@ class DashboardScreen(Screen):
907
937
  if lines is None:
908
938
  return
909
939
  if lines and lines[0].startswith("Error"):
910
- show(f"Run not found: {run_id}", is_error=True)
940
+ toast(f"Run not found: {run_id}", title="/continue", severity="error")
911
941
  return
912
942
  self.current_run_id = run_id
913
943
  self.current_run_kind = "action"
914
944
  self._update_run_status_bar()
915
- show("\n".join(["Continuing run:"] + lines))
945
+ toast(f"Continuing run {run_id}...", title="/continue")
916
946
  await self._load_conversation_history_async(run_id)
917
947
  return
918
948
 
919
949
  if cmd == "/name":
920
950
  new_name = " ".join(args).strip()
921
951
  if not new_name:
922
- show("Usage: /name <new name>")
952
+ toast("Usage: /name <new name>", title="/name", severity="warning")
923
953
  return
924
954
  if not self.current_run_id:
925
- show(
926
- "Error: no run id yet. Start a conversation (send a message), or use /continue <run_id>, or pick one from /runs list.",
927
- is_error=True,
955
+ toast(
956
+ "No run id yet. Send a message to start a run, or use /continue <run_id> (or pick one from /runs list).",
957
+ title="/name",
958
+ severity="error",
959
+ timeout=4,
928
960
  )
929
961
  return
930
962
 
@@ -990,10 +1022,15 @@ class DashboardScreen(Screen):
990
1022
 
991
1023
  if status_code != 200:
992
1024
  details = err or ""
993
- show(
994
- f"Error: failed to rename run {run_id}. Tried: {', '.join(tried)}. HTTP {status_code}. {details}",
995
- is_error=True,
996
- )
1025
+ # Keep this as a toast (non-blocking). Truncate details to avoid huge toasts.
1026
+ details_short = (details or "").strip().replace("\n", " ")
1027
+ if len(details_short) > 160:
1028
+ details_short = details_short[:157] + "..."
1029
+ msg = f"Failed to rename run {run_id} (HTTP {status_code})."
1030
+ if details_short:
1031
+ msg += f" {details_short}"
1032
+ toast(msg, title="/name", severity="error", timeout=5)
1033
+
997
1034
  return
998
1035
 
999
1036
  # Best-effort: update local cached run name (used by the quit-time cleanup prompt).
@@ -1009,7 +1046,7 @@ class DashboardScreen(Screen):
1009
1046
  except Exception:
1010
1047
  pass
1011
1048
 
1012
- show(f"Renamed run {run_id} to: {new_name}")
1049
+ toast(f"Renamed run {run_id} to: {new_name}", title="/name", timeout=4)
1013
1050
  return
1014
1051
 
1015
1052
  if cmd == "/status":
@@ -397,7 +397,7 @@ wheels = [
397
397
 
398
398
  [[package]]
399
399
  name = "kiwi-code"
400
- version = "0.0.31"
400
+ version = "0.0.32"
401
401
  source = { editable = "." }
402
402
  dependencies = [
403
403
  { name = "autobots-client" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes