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.
- {nanocode_cli-0.5.1/nanocode_cli.egg-info → nanocode_cli-0.5.2}/PKG-INFO +1 -1
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode.py +17 -6
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2/nanocode_cli.egg-info}/PKG-INFO +1 -1
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/pyproject.toml +1 -1
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/LICENSE +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/MANIFEST.in +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/README.md +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode_cli.egg-info/SOURCES.txt +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode_cli.egg-info/dependency_links.txt +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode_cli.egg-info/entry_points.txt +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode_cli.egg-info/requires.txt +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/nanocode_cli.egg-info/top_level.txt +0 -0
- {nanocode_cli-0.5.1 → nanocode_cli-0.5.2}/setup.cfg +0 -0
|
@@ -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.
|
|
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
|
|
1150
|
+
def finish() -> None:
|
|
1151
|
+
worker.join()
|
|
1146
1152
|
try:
|
|
1147
|
-
|
|
1148
|
-
self.
|
|
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=
|
|
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
|
|
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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|