janito 1.13.0__py3-none-any.whl → 1.14.0__py3-none-any.whl

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.
janito/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.13.0"
1
+ __version__ = "1.13.1"
janito/agent/config.py CHANGED
@@ -39,9 +39,15 @@ class FileConfig(BaseConfig):
39
39
  def load(self):
40
40
  if self.path.exists():
41
41
  with open(self.path, "r", encoding="utf-8") as f:
42
- self._data = json.load(f)
43
- # Remove keys with value None (null in JSON)
44
- self._data = {k: v for k, v in self._data.items() if v is not None}
42
+ try:
43
+ self._data = json.load(f)
44
+ # Remove keys with value None (null in JSON)
45
+ self._data = {k: v for k, v in self._data.items() if v is not None}
46
+ except json.JSONDecodeError as e:
47
+ print(
48
+ f"⚠️ Warning: The config file '{self.path}' is corrupted (invalid JSON): {e}. Using empty config."
49
+ )
50
+ self._data = {}
45
51
 
46
52
  else:
47
53
  self._data = {}
@@ -3,11 +3,15 @@
3
3
  #}
4
4
  You are: {{ role }}
5
5
 
6
+ You will answer following a pattern of: discovery, description, implementation (when a change was request) and validation.
7
+
6
8
  {# Improves tool selection and platform specific constrains, eg, path format, C:\ vs /path #}
7
- You will be developing and testing in the following environment:
9
+ You will be using the following environment:
8
10
  Platform: {{ platform }}
9
11
  Python version: {{ python_version }}
10
12
  Shell/Environment: {{ shell_info }}
13
+
14
+ Before answering map the questions to artifacts found in the current directory - the current project.
11
15
 
12
16
  Respond according to the following guidelines:
13
17
  {# Exploratory hint #}
@@ -20,11 +24,12 @@ Respond according to the following guidelines:
20
24
  - Use the namespace functions to deliver the code changes instead of showing the code.
21
25
  {# Drive edit mode, place holders critical as shown to be crucial to avoid corruption with code placeholders #}
22
26
  - Prefer making localized edits using string replacements. If the required change is extensive, replace the entire file instead, provide full content without placeholders.
23
- {# Trying to prevent surrogates generation, found this frequently in gpt4.1/windows #}
27
+ {# Trying to prevent surrogates generation, found this frequently in gpt4.1/windows #}
24
28
  - While writing code, if you need an emoji or special Unicode character in a string, then insert the actual character (e.g., 📖) directly instead of using surrogate pairs or escape sequences.
25
29
  {# Without this, the LLM choses to create files from a literal interpretation of the purpose and intention #}
26
30
  - Before creating files search the code for the location related to the file purpose
27
- {# This will trigger a search for the old names/locations to be updates #}
31
+ {# This will trigger a search for the old names/locations to be updates #}
28
32
  - After moving, removing or renaming functions or classes to different modules, update all imports, references, tests, and documentation to reflect the new locations, then verify functionality.
29
33
  {# Keeping docstrings update is key to have semanatic match between prompts and code #}
30
- - Once development or updates are finished, ensure that new or updated packages, modules, functions are properly documented.
34
+ - Once development or updates are finished, ensure that new or updated packages, modules, functions are properly documented.
35
+
@@ -44,6 +44,7 @@ def setup_prompt_session(
44
44
  )
45
45
  else (runtime_config.get("role") or effective_config.get("role"))
46
46
  ),
47
+ version=__version__,
47
48
  session_id=session_id,
48
49
  history_ref=history_ref,
49
50
  ),
@@ -36,7 +36,8 @@ def format_tokens(n, tag=None):
36
36
  return f"<{tag}>{val}</{tag}>" if tag else val
37
37
 
38
38
 
39
- def assemble_first_line(model_name, role_ref, style_ref):
39
+ def assemble_first_line(model_name, role_ref, style_ref, version=None):
40
+ version_part = f" Janito v{version}" if version else ""
40
41
  model_part = f" {tr('Model')}: <model>{model_name}</model>" if model_name else ""
41
42
  role_part = ""
42
43
  vanilla_mode = runtime_config.get("vanilla_mode", False)
@@ -50,6 +51,8 @@ def assemble_first_line(model_name, role_ref, style_ref):
50
51
  if style:
51
52
  style_part = f"{tr('Style')}: <b>{style}</b>"
52
53
  first_line_parts = []
54
+ if version_part:
55
+ first_line_parts.append(version_part)
53
56
  if model_part:
54
57
  first_line_parts.append(model_part)
55
58
  if role_part:
@@ -102,11 +105,11 @@ def assemble_second_line(
102
105
 
103
106
  def assemble_bindings_line():
104
107
  return (
105
- f"<b> F12</b>: {tr('Quick Action')} | "
108
+ f" <b>F1</b>: {tr('Restart Conversation')} | "
109
+ f"<b>F12</b>: {tr('Do It')} | "
106
110
  f"<b>Ctrl-Y</b>: {tr('Yes')} | "
107
111
  f"<b>Ctrl-N</b>: {tr('No')} | "
108
- f"<b>/help</b>: {tr('Help')} | "
109
- f"<b>/restart</b>: {tr('Reset Conversation')}"
112
+ f"<b>/help</b>: {tr('Help')}"
110
113
  )
111
114
 
112
115
 
@@ -125,7 +128,9 @@ def get_toolbar_func(
125
128
 
126
129
  def get_toolbar():
127
130
  width = get_app().output.get_size().columns
128
- first_line = assemble_first_line(model_name, role_ref, style_ref)
131
+ first_line = assemble_first_line(
132
+ model_name, role_ref, style_ref, version=version
133
+ )
129
134
  second_line = assemble_second_line(
130
135
  width,
131
136
  last_usage_info_ref,
@@ -149,21 +154,17 @@ def get_toolbar_func(
149
154
  def get_custom_key_bindings():
150
155
  """
151
156
  Returns prompt_toolkit KeyBindings for custom CLI shortcuts:
152
- - F12: Cycles through quick action phrases and submits.
157
+ - F12: Inserts 'Do It' and submits.
153
158
  - Ctrl-Y: Inserts 'Yes' and submits (for confirmation prompts).
154
159
  - Ctrl-N: Inserts 'No' and submits (for confirmation prompts).
155
160
  """
156
161
  bindings = KeyBindings()
157
- _f12_instructions = ["proceed", "go ahead", "continue", "next", "okay"]
158
- _f12_index = {"value": 0}
159
162
 
160
163
  @bindings.add("f12")
161
164
  def _(event):
162
165
  buf = event.app.current_buffer
163
- idx = _f12_index["value"]
164
- buf.text = _f12_instructions[idx]
166
+ buf.text = "Do It"
165
167
  buf.validate_and_handle()
166
- _f12_index["value"] = (idx + 1) % len(_f12_instructions)
167
168
 
168
169
  @bindings.add("c-y")
169
170
  def _(event):
@@ -177,6 +178,12 @@ def get_custom_key_bindings():
177
178
  buf.text = "No"
178
179
  buf.validate_and_handle()
179
180
 
181
+ @bindings.add("f1")
182
+ def _(event):
183
+ buf = event.app.current_buffer
184
+ buf.text = "/restart"
185
+ buf.validate_and_handle()
186
+
180
187
  return bindings
181
188
 
182
189
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janito
3
- Version: 1.13.0
4
- Summary: Natural Language Coding Agent,
3
+ Version: 1.14.0
4
+ Summary: Natural Language Programming Agent,
5
5
  Author-email: João Pinto <joao.pinto@gmail.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: homepage, https://janito.dev
@@ -13,7 +13,6 @@ Requires-Python: >=3.10
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: beautifulsoup4
16
- Requires-Dist: docstring-parser
17
16
  Requires-Dist: flask
18
17
  Requires-Dist: jinja2
19
18
  Requires-Dist: openai
@@ -21,17 +20,22 @@ Requires-Dist: pathspec
21
20
  Requires-Dist: prompt_toolkit
22
21
  Requires-Dist: requests
23
22
  Requires-Dist: rich
24
- Requires-Dist: toml
25
23
  Requires-Dist: lxml
24
+ Requires-Dist: PyYAML
25
+ Requires-Dist: quart
26
+ Requires-Dist: questionary
26
27
  Provides-Extra: docs
27
28
  Requires-Dist: mkdocs>=1.5.3; extra == "docs"
28
29
  Requires-Dist: mkdocs-material>=9.4.8; extra == "docs"
29
30
  Dynamic: license-file
30
31
 
31
- # 🚀 Janito: Natural Language Coding Agent
32
+ # 🚀 Janito: Natural Language Programming Agent
32
33
 
33
34
  Janito is an AI-powered assistant for the command line and web that interprets natural language system_prompt_template to edit code, manage files, and analyze projects using patterns and tools designed by experienced software engineers. It prioritizes transparency, interactive clarification, and precise, reviewable changes.
34
35
 
36
+ ![Janito Terminal Shell Screenshot](https://github.com/joaompinto/janito/raw/main/docs/imgs/terminal_shell.png)
37
+
38
+
35
39
  For a technical overview, see the [Architecture Guide](docs/reference/architecture.md).
36
40
 
37
41
  ## 📖 Full Documentation & Overview
@@ -1,9 +1,9 @@
1
- janito/__init__.py,sha256=3Vxl6FAJt_13oY3p4Zx-Yd9-94VF7otXCDoEarA5jhA,24
1
+ janito/__init__.py,sha256=B1AK9YV1itFsVaGDvnQIKlFZOLc6ZAzK0Pma9tDW1jM,24
2
2
  janito/__main__.py,sha256=KKIoPBE9xPcb54PRYO2UOt0ti04iAwLeJlg8YY36vew,76
3
3
  janito/rich_utils.py,sha256=x7OsZdwtAOtUu_HYbrAMga0LElFMPbQL8GZ62vw5Jh8,1825
4
4
  janito/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  janito/agent/api_exceptions.py,sha256=TAz3FTE4soqUgKPqei2Jod9LOpA37g3s2-S3G5WGw4E,84
6
- janito/agent/config.py,sha256=dO64nxiiHj-tLJLN8sfY10GUuIaOmWu-NX73n9zVHfg,4609
6
+ janito/agent/config.py,sha256=1XqNEsltsF_4BiZ7rtyLhNndWmj7pDuTl2UpIi_U9fQ,4910
7
7
  janito/agent/config_defaults.py,sha256=22MxI84GF8YL5avIjAWxHlvARxu4A2wD0oou_lqNCeA,460
8
8
  janito/agent/config_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  janito/agent/content_handler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -33,7 +33,7 @@ janito/agent/tool_base.py,sha256=KKWmMKyjxpWNukgdImLwZqs9cnS_tVzBt6cpQ532-KM,202
33
33
  janito/agent/tool_executor.py,sha256=yizyu88QteTHtJ_ktj679IqsaMyS-TQYR7rXnWI6lOg,5114
34
34
  janito/agent/tool_registry.py,sha256=AjxYgQTeG9wUTyi0h128AG7INCyziF0z3zux12BlXnE,1673
35
35
  janito/agent/tool_use_tracker.py,sha256=bEHirQX79u1uHnkmXO7t3JrBt2tHaQhaOzII7Nqiq5A,2874
36
- janito/agent/templates/profiles/system_prompt_template_base.txt.j2,sha256=0w1aN27wd6lo556Hq5a2CJkA80lLkugEdKONE2_THRM,2283
36
+ janito/agent/templates/profiles/system_prompt_template_base.txt.j2,sha256=iWE0xGOdfLgomNFA7e8j6DzdsN17NJV8QITSuxHYtqY,2496
37
37
  janito/agent/templates/profiles/system_prompt_template_base_pt.txt.j2,sha256=FX8piXbR9XNOEKkOSMt4ieZ2wn5fzQlffeQFf8d7gIc,723
38
38
  janito/agent/tests/__init__.py,sha256=QuXHKEzUJ_DooaKqenv_tKuNH-HabuIVZhvW5JNaeIc,52
39
39
  janito/agent/tools/__init__.py,sha256=LASzm6aHwqAtcDZnQFk9BW8HMn7s6yHDf4c5B4SXqs4,1248
@@ -123,11 +123,11 @@ janito/shell/commands/utility.py,sha256=DKcEbBIDmtxxZgWtT9-qBUVmFbCbRUILDo0kecmG
123
123
  janito/shell/commands/verbose.py,sha256=mg7BlsWTkNwbUBN2p_GME4ep3zzAp0jMSc6N4BT3Ebg,980
124
124
  janito/shell/prompt/completer.py,sha256=6gNu0DNNSbUUVgjk8Y0hWwJwk-jbN8Lm6Y4u0mRu930,755
125
125
  janito/shell/prompt/load_prompt.py,sha256=gHedc5TtaFBKiGgwRM_u9nVnBuLHDTSa8VPlPOtoMEA,2125
126
- janito/shell/prompt/session_setup.py,sha256=ry4TqiXYyw3JmZfGRGIpvAgNMXGeWltCwz56NoiBqSY,1531
126
+ janito/shell/prompt/session_setup.py,sha256=WHnQfhd71lfXkxp5Imjgq7PdmNHkydKl_y6T1VKMwCA,1565
127
127
  janito/shell/session/config.py,sha256=5hBgPeYDrgxtVEyVaR8nmw1DYNmSqY8ilyuNyUXnnpQ,3684
128
128
  janito/shell/session/history.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
129
  janito/shell/session/manager.py,sha256=LGf2x9mprGOHAJhq7_OfIZM8Z2bmAEJ_KakaZr1XqXc,3116
130
- janito/shell/ui/interactive.py,sha256=sD7z_kXKDW4sMVA3dZ9RslThuaJfLJh1mURgIsiTmVk,7716
130
+ janito/shell/ui/interactive.py,sha256=icfo1QborKUk2YAvIJHRW2EjQHoY3g2p7aRWgkYv7Cw,7798
131
131
  janito/termweb/app.py,sha256=co4a7cw6pC2P79dMZaNxjPJrP_B9suTGRIWTgqK5ccw,3322
132
132
  janito/termweb/static/editor.css,sha256=71xpzRL993GPKKJPfTVcPI6iHhjnUg2U5-z33EAuTWA,3185
133
133
  janito/termweb/static/editor.css.bak,sha256=S7tMjZFtcDZyx4asRf-WNclyuK9_rnemwOc6JpzSwdQ,2908
@@ -154,9 +154,9 @@ janito/tests/test_rich_utils.py,sha256=S_mGVynekAP0DM4A_ZaY-SseJGtdlBJxOlzc-v8lJ
154
154
  janito/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
155
  janito/web/__main__.py,sha256=5Ck6okOZmxKYkQ-ir4mxXDH7XWMNR-9szgsm0UyQLE0,734
156
156
  janito/web/app.py,sha256=-zUBA1zlnrZdYbI421CSAgFZXOisLmIznNzUJrkSLQQ,4762
157
- janito-1.13.0.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
158
- janito-1.13.0.dist-info/METADATA,sha256=er7ySO_CJRytKqwmORgEU7zFtTJqyt4bGPxms4to_RE,12879
159
- janito-1.13.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
160
- janito-1.13.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
161
- janito-1.13.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
162
- janito-1.13.0.dist-info/RECORD,,
157
+ janito-1.14.0.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
158
+ janito-1.14.0.dist-info/METADATA,sha256=Z0nWc-NXBTGqKdbtH5dEETxkEAjo1w0my41CbeewL_I,13025
159
+ janito-1.14.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
160
+ janito-1.14.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
161
+ janito-1.14.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
162
+ janito-1.14.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5