nanocode-cli 0.2.5__tar.gz → 0.2.6__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.2.5
3
+ Version: 0.2.6
4
4
  Summary: A lightweight terminal-based AI coding assistant
5
5
  Author-email: hit9 <hit9@icloud.com>
6
6
  License-Expression: BSD-3-Clause
@@ -41,7 +41,7 @@ from prompt_toolkit.patch_stdout import patch_stdout
41
41
 
42
42
  JsonValue: TypeAlias = Any
43
43
  Json: TypeAlias = dict[str, JsonValue]
44
- __version__ = "0.2.5"
44
+ __version__ = "0.2.6"
45
45
 
46
46
 
47
47
  class Error(Exception): ...
@@ -820,6 +820,7 @@ class SearchTool(Tool):
820
820
  return [
821
821
  "Search files or directories before Read; default is fixed text.",
822
822
  "Prefix pattern with re: for regex search.",
823
+ "Search is line-oriented; regex patterns must not contain newlines.",
823
824
  "Use A|B|C for literal OR search in fixed mode.",
824
825
  "Optional context=N or N sets nearby context lines.",
825
826
  "Optional glob matches file basename or path relative to cwd.",
@@ -827,7 +828,7 @@ class SearchTool(Tool):
827
828
 
828
829
  @classmethod
829
830
  def signature(cls) -> str:
830
- return "Search(pattern, path[, glob_pattern][, context=N|N]) -> SearchToolResult<matches>"
831
+ return "Search(pattern, path[, option...]) -> SearchToolResult<matches>; option is context=N|N or glob_pattern"
831
832
 
832
833
  @classmethod
833
834
  def example(cls) -> list[str]:
@@ -850,6 +851,8 @@ class SearchTool(Tool):
850
851
  pattern = raw_pattern[3:] if regex else raw_pattern
851
852
  if not pattern:
852
853
  raise ToolCallError("pattern cannot be empty")
854
+ if regex and "\n" in pattern:
855
+ raise ToolCallError("multiline regex is not supported; Search is line-oriented. Search each line separately or Read a nearby range.")
853
856
  glob_pattern = ""
854
857
  context_lines = cls.CONTEXT_LINES
855
858
  for raw_option in args[2:]:
@@ -1968,6 +1971,7 @@ class ModelClient:
1968
1971
  "model": self.session.model,
1969
1972
  "messages": messages,
1970
1973
  "temperature": self.session.temperature,
1974
+ "response_format": {"type": "json_object"},
1971
1975
  }
1972
1976
  extra_params = self._reasoning_params()
1973
1977
  payload.update(extra_params)
@@ -2809,7 +2813,11 @@ class Agent:
2809
2813
  return headline
2810
2814
 
2811
2815
  def step(self) -> Json:
2812
- response = self.request(self.build_system_prompt(), self.build_user_prompt(), activity="main")
2816
+ response = self.request(self.build_system_prompt(), self.build_user_prompt(consume_latest_tool_results=False), activity="main")
2817
+ if _json_str(response.get("_format_error")):
2818
+ return response
2819
+ self.latest_tool_call_results = ""
2820
+ self.latest_agent_feedback = ""
2813
2821
  self.state_updater.apply_tool_call_summaries(response)
2814
2822
  return response
2815
2823
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nanocode-cli
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: A lightweight terminal-based AI coding assistant
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.2.5"
7
+ version = "0.2.6"
8
8
  description = "A lightweight terminal-based AI coding assistant"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes
File without changes
File without changes
File without changes