janito 1.0.0__tar.gz → 1.1.0__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.
Files changed (60) hide show
  1. janito-1.1.0/PKG-INFO +84 -0
  2. janito-1.1.0/README.md +63 -0
  3. janito-1.1.0/janito/__init__.py +1 -0
  4. {janito-1.0.0 → janito-1.1.0}/janito/agent/tool_handler.py +4 -1
  5. {janito-1.0.0 → janito-1.1.0}/janito/cli/_print_config.py +1 -1
  6. {janito-1.0.0 → janito-1.1.0}/janito/cli/arg_parser.py +8 -2
  7. {janito-1.0.0 → janito-1.1.0}/janito/cli/config_commands.py +1 -1
  8. {janito-1.0.0 → janito-1.1.0}/janito/cli/runner.py +30 -50
  9. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/chat_loop.py +2 -1
  10. {janito-1.0.0 → janito-1.1.0}/janito/templates/system_instructions.j2 +2 -0
  11. janito-1.1.0/janito.egg-info/PKG-INFO +84 -0
  12. {janito-1.0.0 → janito-1.1.0}/pyproject.toml +1 -1
  13. janito-1.0.0/PKG-INFO +0 -144
  14. janito-1.0.0/README.md +0 -123
  15. janito-1.0.0/janito/__init__.py +0 -1
  16. janito-1.0.0/janito.egg-info/PKG-INFO +0 -144
  17. {janito-1.0.0 → janito-1.1.0}/LICENSE +0 -0
  18. {janito-1.0.0 → janito-1.1.0}/janito/__main__.py +0 -0
  19. {janito-1.0.0 → janito-1.1.0}/janito/agent/__init__.py +0 -0
  20. {janito-1.0.0 → janito-1.1.0}/janito/agent/agent.py +0 -0
  21. {janito-1.0.0 → janito-1.1.0}/janito/agent/config.py +0 -0
  22. {janito-1.0.0 → janito-1.1.0}/janito/agent/config_defaults.py +0 -0
  23. {janito-1.0.0 → janito-1.1.0}/janito/agent/conversation.py +0 -0
  24. {janito-1.0.0 → janito-1.1.0}/janito/agent/queued_tool_handler.py +0 -0
  25. {janito-1.0.0 → janito-1.1.0}/janito/agent/runtime_config.py +0 -0
  26. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/__init__.py +0 -0
  27. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/ask_user.py +0 -0
  28. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/bash_exec.py +0 -0
  29. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/create_directory.py +0 -0
  30. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/create_file.py +0 -0
  31. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/fetch_url.py +0 -0
  32. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/file_str_replace.py +0 -0
  33. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/find_files.py +0 -0
  34. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/gitignore_utils.py +0 -0
  35. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/move_file.py +0 -0
  36. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/remove_file.py +0 -0
  37. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/rich_live.py +0 -0
  38. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/rich_utils.py +0 -0
  39. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/search_text.py +0 -0
  40. {janito-1.0.0 → janito-1.1.0}/janito/agent/tools/view_file.py +0 -0
  41. {janito-1.0.0 → janito-1.1.0}/janito/cli/__init__.py +0 -0
  42. {janito-1.0.0 → janito-1.1.0}/janito/cli/_utils.py +0 -0
  43. {janito-1.0.0 → janito-1.1.0}/janito/cli/logging_setup.py +0 -0
  44. {janito-1.0.0 → janito-1.1.0}/janito/cli/main.py +0 -0
  45. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/__init__.py +0 -0
  46. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/commands.py +0 -0
  47. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/config_shell.py +0 -0
  48. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/load_prompt.py +0 -0
  49. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/session_manager.py +0 -0
  50. {janito-1.0.0 → janito-1.1.0}/janito/cli_chat_shell/ui.py +0 -0
  51. {janito-1.0.0 → janito-1.1.0}/janito/render_prompt.py +0 -0
  52. {janito-1.0.0 → janito-1.1.0}/janito/web/__init__.py +0 -0
  53. {janito-1.0.0 → janito-1.1.0}/janito/web/__main__.py +0 -0
  54. {janito-1.0.0 → janito-1.1.0}/janito/web/app.py +0 -0
  55. {janito-1.0.0 → janito-1.1.0}/janito.egg-info/SOURCES.txt +0 -0
  56. {janito-1.0.0 → janito-1.1.0}/janito.egg-info/dependency_links.txt +0 -0
  57. {janito-1.0.0 → janito-1.1.0}/janito.egg-info/entry_points.txt +0 -0
  58. {janito-1.0.0 → janito-1.1.0}/janito.egg-info/requires.txt +0 -0
  59. {janito-1.0.0 → janito-1.1.0}/janito.egg-info/top_level.txt +0 -0
  60. {janito-1.0.0 → janito-1.1.0}/setup.cfg +0 -0
janito-1.1.0/PKG-INFO ADDED
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: janito
3
+ Version: 1.1.0
4
+ Summary: An agent framework with built-in tools.
5
+ Author-email: João Pinto <joao.pinto@gmail.com>
6
+ License: MIT
7
+ Project-URL: homepage, https://github.com/joaompinto/janito
8
+ Project-URL: repository, https://github.com/joaompinto/janito
9
+ Keywords: agent,framework,tools,automation
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: rich
17
+ Requires-Dist: openai
18
+ Requires-Dist: flask
19
+ Requires-Dist: pathspec
20
+ Dynamic: license-file
21
+
22
+ # 🚀 Janito: Natural Language Code Editing Agent
23
+
24
+ ## ⚡ Quick Start
25
+
26
+ Run a one-off prompt:
27
+ ```bash
28
+ python -m janito "Refactor the data processing module to improve readability."
29
+ ```
30
+
31
+ Or start the interactive chat shell:
32
+ ```bash
33
+ python -m janito
34
+ ```
35
+
36
+ Launch the web UI:
37
+ ```bash
38
+ python -m janito.web
39
+ ```
40
+
41
+ ---
42
+
43
+ Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
44
+
45
+ ---
46
+
47
+ ## ✨ Key Features
48
+ - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
49
+ - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
50
+ - 🧠 **Context-Aware:** Understands your project structure for precise edits.
51
+ - 💬 **Interactive User Prompts:** Asks for clarification when needed.
52
+ - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
53
+ - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
54
+
55
+ ---
56
+
57
+ ## 📦 Installation
58
+
59
+ ### Requirements
60
+ - Python 3.8+
61
+
62
+ ...
63
+
64
+ ### Configurable Options
65
+
66
+ | Key | Description | How to set | Default |
67
+ |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
68
+ | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
69
+ | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
70
+ | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
71
+ | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
72
+ | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
73
+ | `system_prompt_file`| Use a plain text file as the system prompt (no template rendering, takes precedence over `system_prompt`). | CLI `--system-file` | _None_ |
74
+ | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
75
+ | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
76
+ | `disable_tools` | Disable tool use (no tools passed to agent) | CLI `--disable-tools` | _False_ |
77
+
78
+ #### System Prompt Precedence
79
+
80
+ - If `--system-file` is provided, the file's content is used as the system prompt (no template rendering).
81
+ - Otherwise, if `--system-prompt` or the config value is set, that string is used.
82
+ - Otherwise, a default template is rendered using the current role.
83
+
84
+ ...
janito-1.1.0/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # 🚀 Janito: Natural Language Code Editing Agent
2
+
3
+ ## ⚡ Quick Start
4
+
5
+ Run a one-off prompt:
6
+ ```bash
7
+ python -m janito "Refactor the data processing module to improve readability."
8
+ ```
9
+
10
+ Or start the interactive chat shell:
11
+ ```bash
12
+ python -m janito
13
+ ```
14
+
15
+ Launch the web UI:
16
+ ```bash
17
+ python -m janito.web
18
+ ```
19
+
20
+ ---
21
+
22
+ Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
23
+
24
+ ---
25
+
26
+ ## ✨ Key Features
27
+ - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
28
+ - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
29
+ - 🧠 **Context-Aware:** Understands your project structure for precise edits.
30
+ - 💬 **Interactive User Prompts:** Asks for clarification when needed.
31
+ - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
32
+ - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
33
+
34
+ ---
35
+
36
+ ## 📦 Installation
37
+
38
+ ### Requirements
39
+ - Python 3.8+
40
+
41
+ ...
42
+
43
+ ### Configurable Options
44
+
45
+ | Key | Description | How to set | Default |
46
+ |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
47
+ | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
48
+ | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
49
+ | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
50
+ | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
51
+ | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
52
+ | `system_prompt_file`| Use a plain text file as the system prompt (no template rendering, takes precedence over `system_prompt`). | CLI `--system-file` | _None_ |
53
+ | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
54
+ | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
55
+ | `disable_tools` | Disable tool use (no tools passed to agent) | CLI `--disable-tools` | _False_ |
56
+
57
+ #### System Prompt Precedence
58
+
59
+ - If `--system-file` is provided, the file's content is used as the system prompt (no template rendering).
60
+ - Otherwise, if `--system-prompt` or the config value is set, that string is used.
61
+ - Otherwise, a default template is rendered using the current role.
62
+
63
+ ...
@@ -0,0 +1 @@
1
+ __version__ = "1.1.0"
@@ -45,9 +45,10 @@ class ToolHandler:
45
45
  }
46
46
  return func
47
47
 
48
- def __init__(self, verbose=False):
48
+ def __init__(self, verbose=False, enable_tools=True):
49
49
  self.verbose = verbose
50
50
  self.tools = []
51
+ self.enable_tools = enable_tools
51
52
 
52
53
  def register(self, func):
53
54
  self.tools.append(func)
@@ -57,6 +58,8 @@ class ToolHandler:
57
58
  return self.tools
58
59
 
59
60
  def get_tool_schemas(self):
61
+ if not getattr(self, 'enable_tools', True):
62
+ return []
60
63
  schemas = []
61
64
  for name, entry in self._tool_registry.items():
62
65
  schemas.append({
@@ -62,7 +62,7 @@ def print_full_config(local_config, global_config, unified_config, config_defaul
62
62
  template_path = Path(__file__).parent.parent / "templates" / "system_instructions.j2"
63
63
  for key, value in default_items.items():
64
64
  if key == "system_prompt" and value is None:
65
- out(f"{key} = file: {home_shorten(str(template_path))}")
65
+ out(f"{key} = (default template path: {home_shorten(str(template_path))})")
66
66
  else:
67
67
  out(f"{key} = {value}")
68
68
  out("")
@@ -5,14 +5,20 @@ def create_parser():
5
5
  parser = argparse.ArgumentParser(description="OpenRouter API call using OpenAI Python SDK")
6
6
  parser.add_argument("prompt", type=str, nargs="?", help="Prompt to send to the model")
7
7
  parser.add_argument("--max-tokens", type=int, default=None, help="Maximum tokens for model response (overrides config, default: 200000)")
8
- parser.add_argument("-s", "--system-prompt", type=str, default=None, help="Optional system prompt")
9
- parser.add_argument("-r", "--role", type=str, default=None, help="Role description for the system prompt")
8
+
9
+ # Mutually exclusive group for system prompt options
10
+ group = parser.add_mutually_exclusive_group()
11
+ group.add_argument("-s", "--system-prompt", type=str, default=None, help="Optional system prompt as a raw string.")
12
+ group.add_argument("--system-file", type=str, default=None, help="Path to a plain text file to use as the system prompt (no template rendering, takes precedence over --system-prompt)")
13
+
14
+ parser.add_argument("-r", "--role", type=str, default=None, help="Role description for the default system prompt")
10
15
  parser.add_argument("-t", "--temperature", type=float, default=None, help="Sampling temperature (e.g., 0.0 - 2.0)")
11
16
  parser.add_argument("--verbose-http", action="store_true", help="Enable verbose HTTP logging")
12
17
  parser.add_argument("--verbose-http-raw", action="store_true", help="Enable raw HTTP wire-level logging")
13
18
  parser.add_argument("--verbose-response", action="store_true", help="Pretty print the full response object")
14
19
  parser.add_argument("--show-system", action="store_true", help="Show model, parameters, system prompt, and tool definitions, then exit")
15
20
  parser.add_argument("--verbose-tools", action="store_true", help="Print tool call parameters and results")
21
+ parser.add_argument("--disable-tools", action="store_true", default=False, help="Disable tool use (default: enabled)")
16
22
  parser.add_argument("--set-local-config", type=str, default=None, help='Set a local config key-value pair, format "key=val"')
17
23
  parser.add_argument("--set-global-config", type=str, default=None, help='Set a global config key-value pair, format "key=val"')
18
24
  parser.add_argument("--show-config", action="store_true", help="Show effective configuration and exit")
@@ -103,7 +103,7 @@ def handle_config_commands(args):
103
103
  if key == "system_prompt" and value is None:
104
104
  from pathlib import Path
105
105
  template_path = Path(__file__).parent.parent / "templates" / "system_instructions.j2"
106
- print(f"{key} = file: {home_shorten(str(template_path))}")
106
+ print(f"{key} = (default template path: {home_shorten(str(template_path))})")
107
107
  else:
108
108
  print(f"{key} = {value}")
109
109
  print()
@@ -31,11 +31,26 @@ def run_cli(args):
31
31
  sys.exit(0)
32
32
 
33
33
  role = args.role or unified_config.get("role", "software engineer")
34
- # if args.role:
35
- # runtime_config.set('role', args.role)
36
- system_prompt = args.system_prompt or unified_config.get("system_prompt")
37
- if system_prompt is None:
38
- system_prompt = render_system_prompt(role)
34
+ # Ensure runtime_config is updated so chat shell sees the role
35
+ if args.role:
36
+ runtime_config.set('role', args.role)
37
+
38
+ # New logic for --system-file
39
+ system_prompt = None
40
+ if getattr(args, 'system_file', None):
41
+ try:
42
+ with open(args.system_file, 'r', encoding='utf-8') as f:
43
+ system_prompt = f.read()
44
+ runtime_config.set('system_prompt_file', args.system_file)
45
+ except Exception as e:
46
+ print(f"[red]Failed to read system prompt file:[/red] {e}")
47
+ sys.exit(1)
48
+ else:
49
+ system_prompt = args.system_prompt or unified_config.get("system_prompt")
50
+ if args.system_prompt:
51
+ runtime_config.set('system_prompt', system_prompt)
52
+ if system_prompt is None:
53
+ system_prompt = render_system_prompt(role)
39
54
 
40
55
  if args.show_system:
41
56
  api_key = get_api_key()
@@ -51,35 +66,17 @@ def run_cli(args):
51
66
 
52
67
  model = unified_config.get('model')
53
68
  base_url = unified_config.get('base_url', 'https://openrouter.ai/api/v1')
54
- agent = Agent(api_key=api_key, model=model, system_prompt=system_prompt, verbose_tools=args.verbose_tools, base_url=base_url)
69
+ # Handle --enable-tools flag
70
+ from janito.agent.tool_handler import ToolHandler
71
+ tool_handler = ToolHandler(verbose=args.verbose_tools, enable_tools=not getattr(args, 'disable_tools', False))
72
+ agent = Agent(api_key=api_key, model=model, system_prompt=system_prompt, verbose_tools=args.verbose_tools, base_url=base_url, tool_handler=tool_handler)
55
73
 
56
74
  # Save runtime max_tokens override if provided
57
75
  if args.max_tokens is not None:
58
76
  runtime_config.set('max_tokens', args.max_tokens)
59
- if not args.prompt:
60
- console = Console()
61
-
62
- if not getattr(args, 'continue_session', False):
63
- save_path = os.path.join('.janito', 'last_conversation.json')
64
- if os.path.exists(save_path):
65
- try:
66
- with open(save_path, 'r', encoding='utf-8') as f:
67
- data = json.load(f)
68
- messages = data.get('messages', [])
69
- num_messages = len(messages)
70
- console.print(f"[bold yellow]A previous conversation with {num_messages} messages was found.[/bold yellow]")
71
-
72
- last_usage_info = data.get('last_usage_info')
73
- if last_usage_info:
74
- prompt_tokens = last_usage_info.get('prompt_tokens', 0)
75
- completion_tokens = last_usage_info.get('completion_tokens', 0)
76
- total_tokens = prompt_tokens + completion_tokens
77
- console.print(Rule(f"Token usage - Prompt: {format_tokens(prompt_tokens)}, Completion: {format_tokens(completion_tokens)}, Total: {format_tokens(total_tokens)}"))
78
-
79
- console.print("You can resume it anytime by typing [bold]/continue[/bold].")
80
- except Exception:
81
- pass # Fail silently if file is corrupt or unreadable
82
77
 
78
+ # If no prompt is provided, enter shell loop mode
79
+ if not getattr(args, 'prompt', None):
83
80
  from janito.cli_chat_shell.chat_loop import start_chat_shell
84
81
  start_chat_shell(agent, continue_session=getattr(args, 'continue_session', False))
85
82
  sys.exit(0)
@@ -88,14 +85,8 @@ def run_cli(args):
88
85
 
89
86
  console = Console()
90
87
 
91
- waiting_displayed = [True]
92
-
93
88
  def on_content(data):
94
89
  content = data.get("content", "")
95
- if waiting_displayed[0]:
96
- # Clear the waiting message
97
- sys.stdout.flush()
98
- waiting_displayed[0] = False
99
90
  console.print(Markdown(content))
100
91
 
101
92
  messages = []
@@ -114,22 +105,11 @@ def run_cli(args):
114
105
  if args.verbose_response:
115
106
  import json
116
107
  console.print_json(json.dumps(response))
117
-
118
- usage = response.get('usage')
119
- if usage:
120
- prompt_tokens = usage.get('prompt_tokens')
121
- completion_tokens = usage.get('completion_tokens')
122
- total_tokens = usage.get('total_tokens')
123
- console.print(Rule(f"Token usage - Prompt: {format_tokens(prompt_tokens)}, Completion: {format_tokens(completion_tokens)}, Total: {format_tokens(total_tokens)}"))
124
108
  except MaxRoundsExceededError:
125
- print("[Error] Conversation exceeded maximum rounds.")
126
- sys.exit(1)
109
+ print("[red]Max conversation rounds exceeded.[/red]")
127
110
  except ProviderError as e:
128
- print(f"[Error] Provider error: {e}")
129
- sys.exit(1)
111
+ print(f"[red]Provider error:[/red] {e}")
130
112
  except EmptyResponseError as e:
131
- print(f"[Error] {e}")
132
- sys.exit(1)
113
+ print(f"[red]Error:[/red] {e}")
133
114
  except KeyboardInterrupt:
134
- print("\n[Interrupted by user]")
135
- sys.exit(1)
115
+ print("[yellow]Interrupted by user.[/yellow]")
@@ -6,6 +6,7 @@ from .ui import print_welcome, get_toolbar_func, get_prompt_session
6
6
  from janito import __version__
7
7
  from .commands import handle_command
8
8
  from janito.agent.config import effective_config
9
+ from janito.agent.runtime_config import runtime_config
9
10
  from janito.agent.conversation import EmptyResponseError, ProviderError
10
11
 
11
12
 
@@ -68,7 +69,7 @@ def start_chat_shell(agent, continue_session=False):
68
69
  session = get_prompt_session(
69
70
  get_toolbar_func(
70
71
  get_messages, get_usage, get_elapsed, model_name=model_name,
71
- role_ref=lambda: effective_config.get('role')
72
+ role_ref=lambda: ("*using custom system prompt*" if (runtime_config.get('system_prompt') or runtime_config.get('system_prompt_file')) else (runtime_config.get('role') or effective_config.get('role')))
72
73
  ),
73
74
  mem_history
74
75
  )
@@ -1,5 +1,7 @@
1
1
  You are a helpful {{ role }}.
2
2
 
3
+ You will start every response with a concise plan on how to gather additional information.
4
+
3
5
  <context>
4
6
  Always review `docs/structure.md` before conducting file-specific searches.
5
7
  Unless specified otherwise, look for the files that match the questions context.
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: janito
3
+ Version: 1.1.0
4
+ Summary: An agent framework with built-in tools.
5
+ Author-email: João Pinto <joao.pinto@gmail.com>
6
+ License: MIT
7
+ Project-URL: homepage, https://github.com/joaompinto/janito
8
+ Project-URL: repository, https://github.com/joaompinto/janito
9
+ Keywords: agent,framework,tools,automation
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: rich
17
+ Requires-Dist: openai
18
+ Requires-Dist: flask
19
+ Requires-Dist: pathspec
20
+ Dynamic: license-file
21
+
22
+ # 🚀 Janito: Natural Language Code Editing Agent
23
+
24
+ ## ⚡ Quick Start
25
+
26
+ Run a one-off prompt:
27
+ ```bash
28
+ python -m janito "Refactor the data processing module to improve readability."
29
+ ```
30
+
31
+ Or start the interactive chat shell:
32
+ ```bash
33
+ python -m janito
34
+ ```
35
+
36
+ Launch the web UI:
37
+ ```bash
38
+ python -m janito.web
39
+ ```
40
+
41
+ ---
42
+
43
+ Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
44
+
45
+ ---
46
+
47
+ ## ✨ Key Features
48
+ - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
49
+ - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
50
+ - 🧠 **Context-Aware:** Understands your project structure for precise edits.
51
+ - 💬 **Interactive User Prompts:** Asks for clarification when needed.
52
+ - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
53
+ - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
54
+
55
+ ---
56
+
57
+ ## 📦 Installation
58
+
59
+ ### Requirements
60
+ - Python 3.8+
61
+
62
+ ...
63
+
64
+ ### Configurable Options
65
+
66
+ | Key | Description | How to set | Default |
67
+ |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
68
+ | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
69
+ | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
70
+ | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
71
+ | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
72
+ | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
73
+ | `system_prompt_file`| Use a plain text file as the system prompt (no template rendering, takes precedence over `system_prompt`). | CLI `--system-file` | _None_ |
74
+ | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
75
+ | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
76
+ | `disable_tools` | Disable tool use (no tools passed to agent) | CLI `--disable-tools` | _False_ |
77
+
78
+ #### System Prompt Precedence
79
+
80
+ - If `--system-file` is provided, the file's content is used as the system prompt (no template rendering).
81
+ - Otherwise, if `--system-prompt` or the config value is set, that string is used.
82
+ - Otherwise, a default template is rendered using the current role.
83
+
84
+ ...
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "janito"
3
- version = "1.0.0"
3
+ version = "1.1.0"
4
4
  description = "An agent framework with built-in tools."
5
5
  authors = [
6
6
  { name = "João Pinto", email = "joao.pinto@gmail.com" }
janito-1.0.0/PKG-INFO DELETED
@@ -1,144 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: janito
3
- Version: 1.0.0
4
- Summary: An agent framework with built-in tools.
5
- Author-email: João Pinto <joao.pinto@gmail.com>
6
- License: MIT
7
- Project-URL: homepage, https://github.com/joaompinto/janito
8
- Project-URL: repository, https://github.com/joaompinto/janito
9
- Keywords: agent,framework,tools,automation
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.8
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
- Requires-Dist: rich
17
- Requires-Dist: openai
18
- Requires-Dist: flask
19
- Requires-Dist: pathspec
20
- Dynamic: license-file
21
-
22
- # 🚀 Janito: Natural Language Code Editing Agent
23
-
24
- ## ⚡ Quick Start
25
-
26
- Run a one-off prompt:
27
- ```bash
28
- python -m janito "Refactor the data processing module to improve readability."
29
- ```
30
-
31
- Or start the interactive chat shell:
32
- ```bash
33
- python -m janito
34
- ```
35
-
36
- Launch the web UI:
37
- ```bash
38
- python -m janito.web
39
- ```
40
-
41
- ---
42
-
43
- Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
44
-
45
- ---
46
-
47
- ## ✨ Key Features
48
- - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
49
- - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
50
- - 🧠 **Context-Aware:** Understands your project structure for precise edits.
51
- - 💬 **Interactive User Prompts:** Asks for clarification when needed.
52
- - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
53
- - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
54
-
55
- ---
56
-
57
- ## 📦 Installation
58
-
59
- ### Requirements
60
- - Python 3.8+
61
-
62
- ### Install dependencies
63
- ```bash
64
- pip install -e .
65
- ```
66
-
67
- ### Set your API key
68
- Janito uses OpenAI-compatible APIs (default: `openrouter/optimus-alpha`). Set your API key using the CLI:
69
- ```bash
70
- python -m janito --set-api-key your_api_key_here
71
- ```
72
-
73
- ### Obtain an API key from openrouter.io
74
- 1. Visit [https://openrouter.io/](https://openrouter.io/)
75
- 2. Sign in or create a free account.
76
- 3. Navigate to **API Keys** in your account dashboard.
77
- 4. Click **Create new key**, provide a name, and save the generated key.
78
- 5. Save it using the CLI:
79
- ```bash
80
- python -m janito --set-api-key your_api_key_here
81
- ```
82
-
83
- ---
84
-
85
- ## ⚙️ Configuration
86
-
87
- Janito supports multiple ways to configure API access, model, and behavior:
88
-
89
- ### API Key
90
-
91
- - Set via CLI:
92
- ```bash
93
- python -m janito --set-api-key your_api_key_here
94
- ```
95
-
96
- ### Configurable Options
97
-
98
- | Key | Description | How to set | Default |
99
- |-----------------|-----------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
100
- | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
101
- | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
102
- | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
103
- | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
104
- | `system_prompt` | Override the entire system prompt | CLI `--system-prompt` or config | _Template-generated prompt_ |
105
- | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
106
- | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
107
-
108
- ### Config files
109
-
110
- - **Local config:** `.janito/config.json` (project-specific)
111
- - **Global config:** `~/.config/janito/config.json` (user-wide)
112
-
113
- Set values via:
114
-
115
- ```bash
116
- python -m janito --set-local-config key=value
117
- python -m janito --set-global-config key=value
118
- ```
119
-
120
- ---
121
-
122
- ## 🚀 Build and Release
123
-
124
- Janito provides scripts for automated build and release to PyPI:
125
-
126
- ### Bash (Linux/macOS)
127
-
128
- ```bash
129
- ./tools/release.sh
130
- ```
131
-
132
- ### PowerShell (Windows)
133
-
134
- ```powershell
135
- ./tools/release.ps1
136
- ```
137
-
138
- These scripts will:
139
- - Check for required tools (`hatch`, `twine`)
140
- - Validate the version in `pyproject.toml` against PyPI and git tags
141
- - Build the package
142
- - Upload to PyPI
143
-
144
- ---
janito-1.0.0/README.md DELETED
@@ -1,123 +0,0 @@
1
- # 🚀 Janito: Natural Language Code Editing Agent
2
-
3
- ## ⚡ Quick Start
4
-
5
- Run a one-off prompt:
6
- ```bash
7
- python -m janito "Refactor the data processing module to improve readability."
8
- ```
9
-
10
- Or start the interactive chat shell:
11
- ```bash
12
- python -m janito
13
- ```
14
-
15
- Launch the web UI:
16
- ```bash
17
- python -m janito.web
18
- ```
19
-
20
- ---
21
-
22
- Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
23
-
24
- ---
25
-
26
- ## ✨ Key Features
27
- - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
28
- - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
29
- - 🧠 **Context-Aware:** Understands your project structure for precise edits.
30
- - 💬 **Interactive User Prompts:** Asks for clarification when needed.
31
- - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
32
- - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
33
-
34
- ---
35
-
36
- ## 📦 Installation
37
-
38
- ### Requirements
39
- - Python 3.8+
40
-
41
- ### Install dependencies
42
- ```bash
43
- pip install -e .
44
- ```
45
-
46
- ### Set your API key
47
- Janito uses OpenAI-compatible APIs (default: `openrouter/optimus-alpha`). Set your API key using the CLI:
48
- ```bash
49
- python -m janito --set-api-key your_api_key_here
50
- ```
51
-
52
- ### Obtain an API key from openrouter.io
53
- 1. Visit [https://openrouter.io/](https://openrouter.io/)
54
- 2. Sign in or create a free account.
55
- 3. Navigate to **API Keys** in your account dashboard.
56
- 4. Click **Create new key**, provide a name, and save the generated key.
57
- 5. Save it using the CLI:
58
- ```bash
59
- python -m janito --set-api-key your_api_key_here
60
- ```
61
-
62
- ---
63
-
64
- ## ⚙️ Configuration
65
-
66
- Janito supports multiple ways to configure API access, model, and behavior:
67
-
68
- ### API Key
69
-
70
- - Set via CLI:
71
- ```bash
72
- python -m janito --set-api-key your_api_key_here
73
- ```
74
-
75
- ### Configurable Options
76
-
77
- | Key | Description | How to set | Default |
78
- |-----------------|-----------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
79
- | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
80
- | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
81
- | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
82
- | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
83
- | `system_prompt` | Override the entire system prompt | CLI `--system-prompt` or config | _Template-generated prompt_ |
84
- | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
85
- | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
86
-
87
- ### Config files
88
-
89
- - **Local config:** `.janito/config.json` (project-specific)
90
- - **Global config:** `~/.config/janito/config.json` (user-wide)
91
-
92
- Set values via:
93
-
94
- ```bash
95
- python -m janito --set-local-config key=value
96
- python -m janito --set-global-config key=value
97
- ```
98
-
99
- ---
100
-
101
- ## 🚀 Build and Release
102
-
103
- Janito provides scripts for automated build and release to PyPI:
104
-
105
- ### Bash (Linux/macOS)
106
-
107
- ```bash
108
- ./tools/release.sh
109
- ```
110
-
111
- ### PowerShell (Windows)
112
-
113
- ```powershell
114
- ./tools/release.ps1
115
- ```
116
-
117
- These scripts will:
118
- - Check for required tools (`hatch`, `twine`)
119
- - Validate the version in `pyproject.toml` against PyPI and git tags
120
- - Build the package
121
- - Upload to PyPI
122
-
123
- ---
@@ -1 +0,0 @@
1
- __version__ = "1.0.0"
@@ -1,144 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: janito
3
- Version: 1.0.0
4
- Summary: An agent framework with built-in tools.
5
- Author-email: João Pinto <joao.pinto@gmail.com>
6
- License: MIT
7
- Project-URL: homepage, https://github.com/joaompinto/janito
8
- Project-URL: repository, https://github.com/joaompinto/janito
9
- Keywords: agent,framework,tools,automation
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.8
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
- Requires-Dist: rich
17
- Requires-Dist: openai
18
- Requires-Dist: flask
19
- Requires-Dist: pathspec
20
- Dynamic: license-file
21
-
22
- # 🚀 Janito: Natural Language Code Editing Agent
23
-
24
- ## ⚡ Quick Start
25
-
26
- Run a one-off prompt:
27
- ```bash
28
- python -m janito "Refactor the data processing module to improve readability."
29
- ```
30
-
31
- Or start the interactive chat shell:
32
- ```bash
33
- python -m janito
34
- ```
35
-
36
- Launch the web UI:
37
- ```bash
38
- python -m janito.web
39
- ```
40
-
41
- ---
42
-
43
- Janito is a command-line and web-based AI agent designed to **edit code and manage files** using natural language instructions.
44
-
45
- ---
46
-
47
- ## ✨ Key Features
48
- - 📝 **Code Editing via Natural Language:** Modify, create, or delete code files simply by describing the changes.
49
- - 📁 **File & Directory Management:** Navigate, create, move, or remove files and folders.
50
- - 🧠 **Context-Aware:** Understands your project structure for precise edits.
51
- - 💬 **Interactive User Prompts:** Asks for clarification when needed.
52
- - 🧩 **Extensible Tooling:** Built-in tools for file operations, shell commands, and more.
53
- - 🌐 **Web Interface (In Development):** Upcoming simple web UI for streaming responses and tool progress.
54
-
55
- ---
56
-
57
- ## 📦 Installation
58
-
59
- ### Requirements
60
- - Python 3.8+
61
-
62
- ### Install dependencies
63
- ```bash
64
- pip install -e .
65
- ```
66
-
67
- ### Set your API key
68
- Janito uses OpenAI-compatible APIs (default: `openrouter/optimus-alpha`). Set your API key using the CLI:
69
- ```bash
70
- python -m janito --set-api-key your_api_key_here
71
- ```
72
-
73
- ### Obtain an API key from openrouter.io
74
- 1. Visit [https://openrouter.io/](https://openrouter.io/)
75
- 2. Sign in or create a free account.
76
- 3. Navigate to **API Keys** in your account dashboard.
77
- 4. Click **Create new key**, provide a name, and save the generated key.
78
- 5. Save it using the CLI:
79
- ```bash
80
- python -m janito --set-api-key your_api_key_here
81
- ```
82
-
83
- ---
84
-
85
- ## ⚙️ Configuration
86
-
87
- Janito supports multiple ways to configure API access, model, and behavior:
88
-
89
- ### API Key
90
-
91
- - Set via CLI:
92
- ```bash
93
- python -m janito --set-api-key your_api_key_here
94
- ```
95
-
96
- ### Configurable Options
97
-
98
- | Key | Description | How to set | Default |
99
- |-----------------|-----------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
100
- | `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
101
- | `model` | Model name to use | `--set-local-config model=...` or `--set-global-config` | `openrouter/optimus-alpha` |
102
- | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
103
- | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
104
- | `system_prompt` | Override the entire system prompt | CLI `--system-prompt` or config | _Template-generated prompt_ |
105
- | `temperature` | Sampling temperature (float, e.g., 0.0 - 2.0) | CLI `--temperature` or config | 0.2 |
106
- | `max_tokens` | Maximum tokens for model response | CLI `--max-tokens` or config | 200000 |
107
-
108
- ### Config files
109
-
110
- - **Local config:** `.janito/config.json` (project-specific)
111
- - **Global config:** `~/.config/janito/config.json` (user-wide)
112
-
113
- Set values via:
114
-
115
- ```bash
116
- python -m janito --set-local-config key=value
117
- python -m janito --set-global-config key=value
118
- ```
119
-
120
- ---
121
-
122
- ## 🚀 Build and Release
123
-
124
- Janito provides scripts for automated build and release to PyPI:
125
-
126
- ### Bash (Linux/macOS)
127
-
128
- ```bash
129
- ./tools/release.sh
130
- ```
131
-
132
- ### PowerShell (Windows)
133
-
134
- ```powershell
135
- ./tools/release.ps1
136
- ```
137
-
138
- These scripts will:
139
- - Check for required tools (`hatch`, `twine`)
140
- - Validate the version in `pyproject.toml` against PyPI and git tags
141
- - Build the package
142
- - Upload to PyPI
143
-
144
- ---
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
File without changes
File without changes
File without changes
File without changes