nanocode-cli 0.5.1__tar.gz → 0.5.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nanocode-cli
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: A small terminal coding agent written in Python
5
5
  Author-email: hit9 <hit9@icloud.com>
6
6
  License-Expression: BSD-3-Clause
@@ -54,7 +54,7 @@ from prompt_toolkit.widgets import SearchToolbar
54
54
  from rich.console import Console
55
55
  from rich.markdown import Markdown
56
56
 
57
- __version__ = "0.5.1"
57
+ __version__ = "0.5.2"
58
58
 
59
59
  Json = dict[str, Any]
60
60
  HTTP_USER_AGENT = "nanocode/" + __version__
@@ -1141,15 +1141,22 @@ class CodeIndex:
1141
1141
  if status not in {"ready", "stale"}:
1142
1142
  return False
1143
1143
  self.notice("syncing", refreshing=True)
1144
+ try:
1145
+ worker = csi.refresh_async(self.session.cwd)
1146
+ except Exception as error:
1147
+ self.fail(error)
1148
+ return False
1144
1149
 
1145
- def refresh() -> None:
1150
+ def finish() -> None:
1151
+ worker.join()
1146
1152
  try:
1147
- csi.index(self.session.cwd)
1148
- self.finish()
1153
+ self.session.state.code_index_refreshing = False
1154
+ self.session.state.code_index_notice = ""
1155
+ self.status(check=True)
1149
1156
  except Exception as error:
1150
1157
  self.fail(error)
1151
1158
 
1152
- threading.Thread(target=refresh, daemon=True).start()
1159
+ threading.Thread(target=finish, daemon=True).start()
1153
1160
  return True
1154
1161
 
1155
1162
  def update_paths(self, paths: list[str]) -> list[str]:
@@ -2964,6 +2971,7 @@ class ModelRetryShortcut:
2964
2971
 
2965
2972
  class StatusBar:
2966
2973
  INTERVAL: ClassVar[float] = 0.2
2974
+ INDEX_SPINNER: ClassVar[tuple[str, ...]] = ("~", "/", "-", "\\", "|")
2967
2975
 
2968
2976
  def __init__(self, session: Session):
2969
2977
  self.session = session
@@ -3095,9 +3103,12 @@ class StatusBar:
3095
3103
  return CodeIndex.label("error")
3096
3104
  if self.session.state.code_index_refreshing:
3097
3105
  notice = self.session.state.code_index_notice or "syncing"
3098
- return CodeIndex.label("syncing") if notice in {"syncing", "updating"} else notice
3106
+ return self.index_spinner() if notice in {"syncing", "updating"} else notice
3099
3107
  return CodeIndex.label(self.session.state.code_index_status)
3100
3108
 
3109
+ def index_spinner(self) -> str:
3110
+ return self.INDEX_SPINNER[int(time.monotonic() / self.INTERVAL) % len(self.INDEX_SPINNER)]
3111
+
3101
3112
  def stress_after(self) -> float:
3102
3113
  return max(30.0, self.session.config.provider.timeout * 0.5)
3103
3114
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nanocode-cli
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: A small terminal coding agent written in Python
5
5
  Author-email: hit9 <hit9@icloud.com>
6
6
  License-Expression: BSD-3-Clause
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nanocode-cli"
7
- version = "0.5.1"
7
+ version = "0.5.2"
8
8
  description = "A small terminal coding agent written in Python"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes
File without changes
File without changes
File without changes