janito 2.6.0__py3-none-any.whl → 2.7.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.
Files changed (33) hide show
  1. janito/__init__.py +1 -0
  2. janito/__main__.py +1 -0
  3. janito/_version.py +1 -0
  4. janito/agent/setup_agent.py +240 -230
  5. janito/agent/templates/profiles/{system_prompt_template_software_developer.txt.j2 → system_prompt_template_plain_software_developer.txt.j2} +39 -39
  6. janito/cli/__init__.py +1 -0
  7. janito/cli/chat_mode/bindings.py +1 -0
  8. janito/cli/chat_mode/chat_entry.py +1 -0
  9. janito/cli/chat_mode/prompt_style.py +1 -0
  10. janito/cli/chat_mode/script_runner.py +1 -0
  11. janito/cli/chat_mode/session.py +282 -282
  12. janito/cli/chat_mode/session_profile_select.py +5 -5
  13. janito/cli/single_shot_mode/handler.py +95 -95
  14. janito/drivers/driver_registry.py +27 -27
  15. janito/drivers/openai/driver.py +435 -435
  16. janito/provider_registry.py +178 -178
  17. janito/providers/__init__.py +1 -0
  18. janito/providers/anthropic/model_info.py +41 -41
  19. janito/providers/anthropic/provider.py +80 -80
  20. janito/providers/moonshotai/__init__.py +1 -0
  21. janito/providers/moonshotai/model_info.py +15 -0
  22. janito/providers/moonshotai/provider.py +82 -0
  23. janito/providers/openai/model_info.py +1 -0
  24. janito/providers/provider_static_info.py +21 -18
  25. janito/tools/adapters/local/__init__.py +66 -66
  26. janito/tools/adapters/local/move_file.py +3 -3
  27. janito/tools/adapters/local/read_files.py +40 -40
  28. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/METADATA +419 -412
  29. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/RECORD +33 -30
  30. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/WHEEL +0 -0
  31. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/entry_points.txt +0 -0
  32. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/licenses/LICENSE +0 -0
  33. {janito-2.6.0.dist-info → janito-2.7.0.dist-info}/top_level.txt +0 -0
janito/__init__.py CHANGED
@@ -4,3 +4,4 @@ Provides a CLI for credential management and an extensible driver system for LLM
4
4
  """
5
5
 
6
6
  from ._version import __version__
7
+
janito/__main__.py CHANGED
@@ -2,3 +2,4 @@ from .cli.main import main
2
2
 
3
3
  if __name__ == "__main__":
4
4
  main()
5
+
janito/_version.py CHANGED
@@ -55,3 +55,4 @@ except ImportError: # pragma: no cover – not available in editable installs
55
55
  __version__ = _resolve_version()
56
56
 
57
57
 
58
+
@@ -1,231 +1,241 @@
1
- import importlib.resources
2
- import re
3
- import sys
4
- import time
5
- import warnings
6
- import threading
7
- from pathlib import Path
8
- from jinja2 import Template
9
- from rich import print as rich_print
10
- from queue import Queue
11
- from janito.tools import get_local_tools_adapter
12
- from janito.llm.agent import LLMAgent
13
- from janito.drivers.driver_registry import get_driver_class
14
- from janito.platform_discovery import PlatformDiscovery
15
- from janito.tools.tool_base import ToolPermissions
16
- from janito.tools.permissions import get_global_allowed_permissions
17
-
18
-
19
- def _load_template_content(profile, templates_dir):
20
- """
21
- Loads the template content for the given profile from the specified directory or package resources.
22
- """
23
- template_filename = f"system_prompt_template_{profile}.txt.j2"
24
- template_path = templates_dir / template_filename
25
- if template_path.exists():
26
- with open(template_path, "r", encoding="utf-8") as file:
27
- return file.read(), template_path
28
- # Try package import fallback
29
- try:
30
- with importlib.resources.files("janito.agent.templates.profiles").joinpath(
31
- template_filename
32
- ).open("r", encoding="utf-8") as file:
33
- return file.read(), template_path
34
- except (FileNotFoundError, ModuleNotFoundError, AttributeError):
35
- raise FileNotFoundError(
36
- f"[janito] Could not find profile-specific template '{template_filename}' in {template_path} nor in janito.agent.templates.profiles package."
37
- )
38
-
39
-
40
- def _prepare_template_context(role, profile, allowed_permissions):
41
- """
42
- Prepares the context dictionary for Jinja2 template rendering.
43
- """
44
- context = {}
45
- context["role"] = role or "developer"
46
- context["profile"] = profile
47
- if allowed_permissions is None:
48
- allowed_permissions = get_global_allowed_permissions()
49
- # Convert ToolPermissions -> string like "rwx"
50
- if isinstance(allowed_permissions, ToolPermissions):
51
- perm_str = ""
52
- if allowed_permissions.read:
53
- perm_str += "r"
54
- if allowed_permissions.write:
55
- perm_str += "w"
56
- if allowed_permissions.execute:
57
- perm_str += "x"
58
- allowed_permissions = perm_str or None
59
- context["allowed_permissions"] = allowed_permissions
60
- # Inject platform info if execute permission is present
61
- if allowed_permissions and 'x' in allowed_permissions:
62
- pd = PlatformDiscovery()
63
- context["platform"] = pd.get_platform_name()
64
- context["python_version"] = pd.get_python_version()
65
- context["shell_info"] = pd.detect_shell()
66
- return context
67
-
68
-
69
- def _create_agent(provider_instance, tools_provider, role, system_prompt, input_queue, output_queue, verbose_agent, context, template_path, profile):
70
- """
71
- Creates and returns an LLMAgent instance with the provided parameters.
72
- """
73
- agent = LLMAgent(
74
- provider_instance,
75
- tools_provider,
76
- agent_name=role or "developer",
77
- system_prompt=system_prompt,
78
- input_queue=input_queue,
79
- output_queue=output_queue,
80
- verbose_agent=verbose_agent,
81
- )
82
- agent.template_vars["role"] = context["role"]
83
- agent.template_vars["profile"] = profile
84
- agent.system_prompt_template = str(template_path)
85
- agent._template_vars = context.copy()
86
- agent._original_template_vars = context.copy()
87
- return agent
88
-
89
-
90
- def setup_agent(
91
- provider_instance,
92
- llm_driver_config,
93
- role=None,
94
- templates_dir=None,
95
- zero_mode=False,
96
- input_queue=None,
97
- output_queue=None,
98
- verbose_tools=False,
99
- verbose_agent=False,
100
- allowed_permissions=None,
101
- profile=None,
102
- profile_system_prompt=None,
103
- ):
104
- """
105
- Creates an agent. A system prompt is rendered from a template only when a profile is specified.
106
- """
107
- tools_provider = get_local_tools_adapter()
108
- tools_provider.set_verbose_tools(verbose_tools)
109
-
110
- # If zero_mode is enabled or no profile is given we skip the system prompt.
111
- if zero_mode or (profile is None and profile_system_prompt is None):
112
- agent = LLMAgent(
113
- provider_instance,
114
- tools_provider,
115
- agent_name=role or "developer",
116
- system_prompt=None,
117
- input_queue=input_queue,
118
- output_queue=output_queue,
119
- verbose_agent=verbose_agent,
120
- )
121
- if role:
122
- agent.template_vars["role"] = role
123
- return agent
124
-
125
- # If profile_system_prompt is set, use it directly
126
- if profile_system_prompt is not None:
127
- agent = LLMAgent(
128
- provider_instance,
129
- tools_provider,
130
- agent_name=role or "developer",
131
- system_prompt=profile_system_prompt,
132
- input_queue=input_queue,
133
- output_queue=output_queue,
134
- verbose_agent=verbose_agent,
135
- )
136
- agent.template_vars["role"] = role or "developer"
137
- agent.template_vars["profile"] = None
138
- agent.template_vars["profile_system_prompt"] = profile_system_prompt
139
- return agent
140
-
141
- # Normal flow (profile-specific system prompt)
142
- if templates_dir is None:
143
- templates_dir = Path(__file__).parent / "templates" / "profiles"
144
- template_content, template_path = _load_template_content(profile, templates_dir)
145
-
146
- template = Template(template_content)
147
- context = _prepare_template_context(role, profile, allowed_permissions)
148
-
149
- # Debug output if requested
150
- debug_flag = False
151
- try:
152
- debug_flag = (hasattr(sys, 'argv') and ('--debug' in sys.argv or '--verbose' in sys.argv or '-v' in sys.argv))
153
- except Exception:
154
- pass
155
- if debug_flag:
156
- rich_print(f"[bold magenta][DEBUG][/bold magenta] Rendering system prompt template '[cyan]{template_path.name}[/cyan]' with allowed_permissions: [yellow]{context.get('allowed_permissions')}[/yellow]")
157
- rich_print(f"[bold magenta][DEBUG][/bold magenta] Template context: [green]{context}[/green]")
158
- start_render = time.time()
159
- rendered_prompt = template.render(**context)
160
- end_render = time.time()
161
- # Merge multiple empty lines into a single empty line
162
- rendered_prompt = re.sub(r'\n{3,}', '\n\n', rendered_prompt)
163
-
164
- return _create_agent(
165
- provider_instance,
166
- tools_provider,
167
- role,
168
- rendered_prompt,
169
- input_queue,
170
- output_queue,
171
- verbose_agent,
172
- context,
173
- template_path,
174
- profile,
175
- )
176
-
177
-
178
- def create_configured_agent(
179
- *,
180
- provider_instance=None,
181
- llm_driver_config=None,
182
- role=None,
183
- verbose_tools=False,
184
- verbose_agent=False,
185
- templates_dir=None,
186
- zero_mode=False,
187
- allowed_permissions=None,
188
- profile=None,
189
- profile_system_prompt=None,
190
- ):
191
- """
192
- Normalizes agent setup for all CLI modes.
193
-
194
- Args:
195
- provider_instance: Provider instance for the agent
196
- llm_driver_config: LLM driver configuration
197
- role: Optional role string
198
- verbose_tools: Optional, default False
199
- verbose_agent: Optional, default False
200
- templates_dir: Optional
201
- zero_mode: Optional, default False
202
-
203
- Returns:
204
- Configured agent instance
205
- """
206
- input_queue = None
207
- output_queue = None
208
- driver = None
209
- if hasattr(provider_instance, "create_driver"):
210
- driver = provider_instance.create_driver()
211
- driver.start() # Ensure the driver background thread is started
212
- input_queue = getattr(driver, "input_queue", None)
213
- output_queue = getattr(driver, "output_queue", None)
214
-
215
- agent = setup_agent(
216
- provider_instance=provider_instance,
217
- llm_driver_config=llm_driver_config,
218
- role=role,
219
- templates_dir=templates_dir,
220
- zero_mode=zero_mode,
221
- input_queue=input_queue,
222
- output_queue=output_queue,
223
- verbose_tools=verbose_tools,
224
- verbose_agent=verbose_agent,
225
- allowed_permissions=allowed_permissions,
226
- profile=profile,
227
- profile_system_prompt=profile_system_prompt,
228
- )
229
- if driver is not None:
230
- agent.driver = driver # Attach driver to agent for thread management
1
+ import importlib.resources
2
+ import re
3
+ import os
4
+ import sys
5
+ import time
6
+ import warnings
7
+ import threading
8
+ from pathlib import Path
9
+ from jinja2 import Template
10
+ from pathlib import Path
11
+ from queue import Queue
12
+ from rich import print as rich_print
13
+ from janito.tools import get_local_tools_adapter
14
+ from janito.llm.agent import LLMAgent
15
+ from janito.drivers.driver_registry import get_driver_class
16
+ from janito.platform_discovery import PlatformDiscovery
17
+ from janito.tools.tool_base import ToolPermissions
18
+ from janito.tools.permissions import get_global_allowed_permissions
19
+
20
+ def _load_template_content(profile, templates_dir):
21
+ """
22
+ Loads the template content for the given profile from the specified directory or package resources.
23
+ If the profile template is not found in the default locations, tries to load from the user profiles directory ~/.janito/profiles.
24
+ """
25
+
26
+
27
+ template_filename = f"system_prompt_template_{profile}.txt.j2"
28
+ template_path = templates_dir / template_filename
29
+ if template_path.exists():
30
+ with open(template_path, "r", encoding="utf-8") as file:
31
+ return file.read(), template_path
32
+ # Try package import fallback
33
+ try:
34
+ with importlib.resources.files("janito.agent.templates.profiles").joinpath(
35
+ template_filename
36
+ ).open("r", encoding="utf-8") as file:
37
+ return file.read(), template_path
38
+ except (FileNotFoundError, ModuleNotFoundError, AttributeError):
39
+ # Try user profiles directory
40
+ user_profiles_dir = Path(os.path.expanduser("~/.janito/profiles"))
41
+ user_template_path = user_profiles_dir / profile
42
+ if user_template_path.exists():
43
+ with open(user_template_path, "r", encoding="utf-8") as file:
44
+ return file.read(), user_template_path
45
+ raise FileNotFoundError(
46
+ f"[janito] Could not find profile-specific template '{template_filename}' in {template_path} nor in janito.agent.templates.profiles package nor in user profiles directory {user_template_path}."
47
+ )
48
+
49
+
50
+ def _prepare_template_context(role, profile, allowed_permissions):
51
+ """
52
+ Prepares the context dictionary for Jinja2 template rendering.
53
+ """
54
+ context = {}
55
+ context["role"] = role or "developer"
56
+ context["profile"] = profile
57
+ if allowed_permissions is None:
58
+ allowed_permissions = get_global_allowed_permissions()
59
+ # Convert ToolPermissions -> string like "rwx"
60
+ if isinstance(allowed_permissions, ToolPermissions):
61
+ perm_str = ""
62
+ if allowed_permissions.read:
63
+ perm_str += "r"
64
+ if allowed_permissions.write:
65
+ perm_str += "w"
66
+ if allowed_permissions.execute:
67
+ perm_str += "x"
68
+ allowed_permissions = perm_str or None
69
+ context["allowed_permissions"] = allowed_permissions
70
+ # Inject platform info if execute permission is present
71
+ if allowed_permissions and 'x' in allowed_permissions:
72
+ pd = PlatformDiscovery()
73
+ context["platform"] = pd.get_platform_name()
74
+ context["python_version"] = pd.get_python_version()
75
+ context["shell_info"] = pd.detect_shell()
76
+ return context
77
+
78
+
79
+ def _create_agent(provider_instance, tools_provider, role, system_prompt, input_queue, output_queue, verbose_agent, context, template_path, profile):
80
+ """
81
+ Creates and returns an LLMAgent instance with the provided parameters.
82
+ """
83
+ agent = LLMAgent(
84
+ provider_instance,
85
+ tools_provider,
86
+ agent_name=role or "developer",
87
+ system_prompt=system_prompt,
88
+ input_queue=input_queue,
89
+ output_queue=output_queue,
90
+ verbose_agent=verbose_agent,
91
+ )
92
+ agent.template_vars["role"] = context["role"]
93
+ agent.template_vars["profile"] = profile
94
+ agent.system_prompt_template = str(template_path)
95
+ agent._template_vars = context.copy()
96
+ agent._original_template_vars = context.copy()
97
+ return agent
98
+
99
+
100
+ def setup_agent(
101
+ provider_instance,
102
+ llm_driver_config,
103
+ role=None,
104
+ templates_dir=None,
105
+ zero_mode=False,
106
+ input_queue=None,
107
+ output_queue=None,
108
+ verbose_tools=False,
109
+ verbose_agent=False,
110
+ allowed_permissions=None,
111
+ profile=None,
112
+ profile_system_prompt=None,
113
+ ):
114
+ """
115
+ Creates an agent. A system prompt is rendered from a template only when a profile is specified.
116
+ """
117
+ tools_provider = get_local_tools_adapter()
118
+ tools_provider.set_verbose_tools(verbose_tools)
119
+
120
+ # If zero_mode is enabled or no profile is given we skip the system prompt.
121
+ if zero_mode or (profile is None and profile_system_prompt is None):
122
+ agent = LLMAgent(
123
+ provider_instance,
124
+ tools_provider,
125
+ agent_name=role or "developer",
126
+ system_prompt=None,
127
+ input_queue=input_queue,
128
+ output_queue=output_queue,
129
+ verbose_agent=verbose_agent,
130
+ )
131
+ if role:
132
+ agent.template_vars["role"] = role
133
+ return agent
134
+
135
+ # If profile_system_prompt is set, use it directly
136
+ if profile_system_prompt is not None:
137
+ agent = LLMAgent(
138
+ provider_instance,
139
+ tools_provider,
140
+ agent_name=role or "developer",
141
+ system_prompt=profile_system_prompt,
142
+ input_queue=input_queue,
143
+ output_queue=output_queue,
144
+ verbose_agent=verbose_agent,
145
+ )
146
+ agent.template_vars["role"] = role or "developer"
147
+ agent.template_vars["profile"] = None
148
+ agent.template_vars["profile_system_prompt"] = profile_system_prompt
149
+ return agent
150
+
151
+ # Normal flow (profile-specific system prompt)
152
+ if templates_dir is None:
153
+ templates_dir = Path(__file__).parent / "templates" / "profiles"
154
+ template_content, template_path = _load_template_content(profile, templates_dir)
155
+
156
+ template = Template(template_content)
157
+ context = _prepare_template_context(role, profile, allowed_permissions)
158
+
159
+ # Debug output if requested
160
+ debug_flag = False
161
+ try:
162
+ debug_flag = (hasattr(sys, 'argv') and ('--debug' in sys.argv or '--verbose' in sys.argv or '-v' in sys.argv))
163
+ except Exception:
164
+ pass
165
+ if debug_flag:
166
+ rich_print(f"[bold magenta][DEBUG][/bold magenta] Rendering system prompt template '[cyan]{template_path.name}[/cyan]' with allowed_permissions: [yellow]{context.get('allowed_permissions')}[/yellow]")
167
+ rich_print(f"[bold magenta][DEBUG][/bold magenta] Template context: [green]{context}[/green]")
168
+ start_render = time.time()
169
+ rendered_prompt = template.render(**context)
170
+ end_render = time.time()
171
+ # Merge multiple empty lines into a single empty line
172
+ rendered_prompt = re.sub(r'\n{3,}', '\n\n', rendered_prompt)
173
+
174
+ return _create_agent(
175
+ provider_instance,
176
+ tools_provider,
177
+ role,
178
+ rendered_prompt,
179
+ input_queue,
180
+ output_queue,
181
+ verbose_agent,
182
+ context,
183
+ template_path,
184
+ profile,
185
+ )
186
+
187
+
188
+ def create_configured_agent(
189
+ *,
190
+ provider_instance=None,
191
+ llm_driver_config=None,
192
+ role=None,
193
+ verbose_tools=False,
194
+ verbose_agent=False,
195
+ templates_dir=None,
196
+ zero_mode=False,
197
+ allowed_permissions=None,
198
+ profile=None,
199
+ profile_system_prompt=None,
200
+ ):
201
+ """
202
+ Normalizes agent setup for all CLI modes.
203
+
204
+ Args:
205
+ provider_instance: Provider instance for the agent
206
+ llm_driver_config: LLM driver configuration
207
+ role: Optional role string
208
+ verbose_tools: Optional, default False
209
+ verbose_agent: Optional, default False
210
+ templates_dir: Optional
211
+ zero_mode: Optional, default False
212
+
213
+ Returns:
214
+ Configured agent instance
215
+ """
216
+ input_queue = None
217
+ output_queue = None
218
+ driver = None
219
+ if hasattr(provider_instance, "create_driver"):
220
+ driver = provider_instance.create_driver()
221
+ driver.start() # Ensure the driver background thread is started
222
+ input_queue = getattr(driver, "input_queue", None)
223
+ output_queue = getattr(driver, "output_queue", None)
224
+
225
+ agent = setup_agent(
226
+ provider_instance=provider_instance,
227
+ llm_driver_config=llm_driver_config,
228
+ role=role,
229
+ templates_dir=templates_dir,
230
+ zero_mode=zero_mode,
231
+ input_queue=input_queue,
232
+ output_queue=output_queue,
233
+ verbose_tools=verbose_tools,
234
+ verbose_agent=verbose_agent,
235
+ allowed_permissions=allowed_permissions,
236
+ profile=profile,
237
+ profile_system_prompt=profile_system_prompt,
238
+ )
239
+ if driver is not None:
240
+ agent.driver = driver # Attach driver to agent for thread management
231
241
  return agent
@@ -1,39 +1,39 @@
1
- You are: software developer
2
-
3
- {# Improves tool selection and platform specific constrains, eg, path format, C:\ vs /path #}
4
- {% if allowed_permissions and 'x' in allowed_permissions %}
5
- You will be using the following environment:
6
- Platform: {{ platform }}
7
- Shell/Environment: {{ shell_info }}
8
- {% endif %}
9
-
10
-
11
- {% if allowed_permissions and 'r' in allowed_permissions %}
12
- Before answering map the questions to artifacts found in the current directory - the current project.
13
- {% endif %}
14
-
15
- Respond according to the following guidelines:
16
- {% if allowed_permissions %}
17
- - Before using the namespace tools provide a short reason
18
- {% endif %}
19
- {% if allowed_permissions and 'r' in allowed_permissions %}
20
- {# Exploratory hint #}
21
- - Before answering to the user, explore the content related to the question
22
- {# Reduces chunking roundtip #}
23
- - When exploring full files content, provide empty range to read the entire files instead of chunked reads
24
- {% endif %}
25
- {% if allowed_permissions and 'w' in allowed_permissions %}
26
- {# Reduce unrequest code verbosity overhead #}
27
- - Use the namespace functions to deliver the code changes instead of showing the code.
28
- {# Drive edit mode, place holders critical as shown to be crucial to avoid corruption with code placeholders #}
29
- - Prefer making localized edits using string replacements. If the required change is extensive, replace the entire file instead, provide full content without placeholders.
30
- {# Without this, the LLM choses to create files from a literal interpretation of the purpose and intention #}
31
- - Before creating files search the code for the location related to the file purpose
32
- {# This will trigger a search for the old names/locations to be updates #}
33
- - 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.
34
- {# Keeping docstrings update is key to have semanatic match between prompts and code #}
35
- - Once development or updates are finished, ensure that new or updated packages, modules, functions are properly documented.
36
- {# Trying to prevent surrogates generation, found this frequently in gpt4.1/windows #}
37
- - 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.
38
- {% endif %}
39
-
1
+ You are: software developer
2
+
3
+ {# Improves tool selection and platform specific constrains, eg, path format, C:\ vs /path #}
4
+ {% if allowed_permissions and 'x' in allowed_permissions %}
5
+ You will be using the following environment:
6
+ Platform: {{ platform }}
7
+ Shell/Environment: {{ shell_info }}
8
+ {% endif %}
9
+
10
+
11
+ {% if allowed_permissions and 'r' in allowed_permissions %}
12
+ Before answering map the questions to artifacts found in the current directory - the current project.
13
+ {% endif %}
14
+
15
+ Respond according to the following guidelines:
16
+ {% if allowed_permissions %}
17
+ - Before using the namespace tools provide a short reason
18
+ {% endif %}
19
+ {% if allowed_permissions and 'r' in allowed_permissions %}
20
+ {# Exploratory hint #}
21
+ - Before answering to the user, explore the content related to the question
22
+ {# Reduces chunking roundtip #}
23
+ - When exploring full files content, provide empty range to read the entire files instead of chunked reads
24
+ {% endif %}
25
+ {% if allowed_permissions and 'w' in allowed_permissions %}
26
+ {# Reduce unrequest code verbosity overhead #}
27
+ - Use the namespace functions to deliver the code changes instead of showing the code.
28
+ {# Drive edit mode, place holders critical as shown to be crucial to avoid corruption with code placeholders #}
29
+ - Prefer making localized edits using string replacements. If the required change is extensive, replace the entire file instead, provide full content without placeholders.
30
+ {# Without this, the LLM choses to create files from a literal interpretation of the purpose and intention #}
31
+ - Before creating files search the code for the location related to the file purpose
32
+ {# This will trigger a search for the old names/locations to be updates #}
33
+ - 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.
34
+ {# Keeping docstrings update is key to have semanatic match between prompts and code #}
35
+ - Once development or updates are finished, ensure that new or updated packages, modules, functions are properly documented.
36
+ {# Trying to prevent surrogates generation, found this frequently in gpt4.1/windows #}
37
+ - 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.
38
+ {% endif %}
39
+
janito/cli/__init__.py CHANGED
@@ -7,3 +7,4 @@ __all__ = [
7
7
  "format_tokens",
8
8
  "format_generation_time",
9
9
  ]
10
+
@@ -35,3 +35,4 @@ class KeyBindingsFactory:
35
35
  buf.validate_and_handle()
36
36
 
37
37
  return bindings
38
+
@@ -20,3 +20,4 @@ def main(args=None):
20
20
 
21
21
  if __name__ == "__main__":
22
22
  main()
23
+
@@ -22,3 +22,4 @@ chat_shell_style = Style.from_dict(
22
22
  "cmd-label": "bg:#ff9500 fg:#232323 bold",
23
23
  }
24
24
  )
25
+
@@ -151,3 +151,4 @@ class ChatScriptRunner:
151
151
 
152
152
  # Convenience alias so tests can simply call *runner()*
153
153
  __call__ = run
154
+