janito 1.1.0__tar.gz → 1.2.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 (57) hide show
  1. {janito-1.1.0 → janito-1.2.0}/PKG-INFO +3 -2
  2. {janito-1.1.0 → janito-1.2.0}/README.md +1 -1
  3. janito-1.2.0/janito/__init__.py +1 -0
  4. {janito-1.1.0 → janito-1.2.0}/janito/agent/config.py +1 -1
  5. {janito-1.1.0 → janito-1.2.0}/janito/agent/config_defaults.py +1 -1
  6. {janito-1.1.0 → janito-1.2.0}/janito/agent/conversation.py +6 -0
  7. {janito-1.1.0 → janito-1.2.0}/janito/cli/arg_parser.py +1 -0
  8. {janito-1.1.0 → janito-1.2.0}/janito/cli/runner.py +7 -1
  9. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/PKG-INFO +3 -2
  10. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/requires.txt +1 -0
  11. {janito-1.1.0 → janito-1.2.0}/pyproject.toml +3 -2
  12. janito-1.1.0/janito/__init__.py +0 -1
  13. {janito-1.1.0 → janito-1.2.0}/LICENSE +0 -0
  14. {janito-1.1.0 → janito-1.2.0}/janito/__main__.py +0 -0
  15. {janito-1.1.0 → janito-1.2.0}/janito/agent/__init__.py +0 -0
  16. {janito-1.1.0 → janito-1.2.0}/janito/agent/agent.py +0 -0
  17. {janito-1.1.0 → janito-1.2.0}/janito/agent/queued_tool_handler.py +0 -0
  18. {janito-1.1.0 → janito-1.2.0}/janito/agent/runtime_config.py +0 -0
  19. {janito-1.1.0 → janito-1.2.0}/janito/agent/tool_handler.py +0 -0
  20. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/__init__.py +0 -0
  21. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/ask_user.py +0 -0
  22. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/bash_exec.py +0 -0
  23. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/create_directory.py +0 -0
  24. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/create_file.py +0 -0
  25. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/fetch_url.py +0 -0
  26. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/file_str_replace.py +0 -0
  27. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/find_files.py +0 -0
  28. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/gitignore_utils.py +0 -0
  29. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/move_file.py +0 -0
  30. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/remove_file.py +0 -0
  31. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/rich_live.py +0 -0
  32. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/rich_utils.py +0 -0
  33. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/search_text.py +0 -0
  34. {janito-1.1.0 → janito-1.2.0}/janito/agent/tools/view_file.py +0 -0
  35. {janito-1.1.0 → janito-1.2.0}/janito/cli/__init__.py +0 -0
  36. {janito-1.1.0 → janito-1.2.0}/janito/cli/_print_config.py +0 -0
  37. {janito-1.1.0 → janito-1.2.0}/janito/cli/_utils.py +0 -0
  38. {janito-1.1.0 → janito-1.2.0}/janito/cli/config_commands.py +0 -0
  39. {janito-1.1.0 → janito-1.2.0}/janito/cli/logging_setup.py +0 -0
  40. {janito-1.1.0 → janito-1.2.0}/janito/cli/main.py +0 -0
  41. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/__init__.py +0 -0
  42. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/chat_loop.py +0 -0
  43. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/commands.py +0 -0
  44. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/config_shell.py +0 -0
  45. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/load_prompt.py +0 -0
  46. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/session_manager.py +0 -0
  47. {janito-1.1.0 → janito-1.2.0}/janito/cli_chat_shell/ui.py +0 -0
  48. {janito-1.1.0 → janito-1.2.0}/janito/render_prompt.py +0 -0
  49. {janito-1.1.0 → janito-1.2.0}/janito/templates/system_instructions.j2 +0 -0
  50. {janito-1.1.0 → janito-1.2.0}/janito/web/__init__.py +0 -0
  51. {janito-1.1.0 → janito-1.2.0}/janito/web/__main__.py +0 -0
  52. {janito-1.1.0 → janito-1.2.0}/janito/web/app.py +0 -0
  53. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/SOURCES.txt +0 -0
  54. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/dependency_links.txt +0 -0
  55. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/entry_points.txt +0 -0
  56. {janito-1.1.0 → janito-1.2.0}/janito.egg-info/top_level.txt +0 -0
  57. {janito-1.1.0 → janito-1.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janito
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: An agent framework with built-in tools.
5
5
  Author-email: João Pinto <joao.pinto@gmail.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Requires-Dist: rich
17
17
  Requires-Dist: openai
18
18
  Requires-Dist: flask
19
19
  Requires-Dist: pathspec
20
+ Requires-Dist: beautifulsoup4
20
21
  Dynamic: license-file
21
22
 
22
23
  # 🚀 Janito: Natural Language Code Editing Agent
@@ -66,7 +67,7 @@ Janito is a command-line and web-based AI agent designed to **edit code and mana
66
67
  | Key | Description | How to set | Default |
67
68
  |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
68
69
  | `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
+ | `model` | Model name to use | `--model` (session only), `--set-local-config model=...`, or `--set-global-config` | `openai/gpt-4.1` |
70
71
  | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
71
72
  | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
72
73
  | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
@@ -45,7 +45,7 @@ Janito is a command-line and web-based AI agent designed to **edit code and mana
45
45
  | Key | Description | How to set | Default |
46
46
  |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
47
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` |
48
+ | `model` | Model name to use | `--model` (session only), `--set-local-config model=...`, or `--set-global-config` | `openai/gpt-4.1` |
49
49
  | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
50
50
  | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
51
51
  | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
@@ -0,0 +1 @@
1
+ __version__ = "1.2.0"
@@ -59,7 +59,7 @@ class FileConfig(BaseConfig):
59
59
 
60
60
  CONFIG_OPTIONS = {
61
61
  "api_key": "API key for OpenAI-compatible service (required)",
62
- "model": "Model name to use (e.g., 'openrouter/optimus-alpha')",
62
+ "model": "Model name to use (e.g., 'openai/gpt-4.1')",
63
63
  "base_url": "API base URL (OpenAI-compatible endpoint)",
64
64
  "role": "Role description for the system prompt (e.g., 'software engineer')",
65
65
  "system_prompt": "Override the entire system prompt text",
@@ -1,7 +1,7 @@
1
1
  # Centralized config defaults for Janito
2
2
  CONFIG_DEFAULTS = {
3
3
  "api_key": None, # Must be set by user
4
- "model": "openrouter/optimus-alpha", # Default model
4
+ "model": "openai/gpt-4.1", # Default model
5
5
  "base_url": "https://openrouter.ai/api/v1",
6
6
  "role": "software engineer",
7
7
  "system_prompt": None, # None means auto-generate from role
@@ -31,6 +31,12 @@ class ConversationHandler:
31
31
  if resolved_max_tokens is None:
32
32
  resolved_max_tokens = unified_config.get('max_tokens', 200000)
33
33
 
34
+ # Ensure max_tokens is always an int (handles config/CLI string values)
35
+ try:
36
+ resolved_max_tokens = int(resolved_max_tokens)
37
+ except (TypeError, ValueError):
38
+ raise ValueError(f"max_tokens must be an integer, got: {resolved_max_tokens!r}")
39
+
34
40
  for _ in range(max_rounds):
35
41
  if spinner:
36
42
  # Calculate word count for all messages
@@ -5,6 +5,7 @@ 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("--model", type=str, default=None, help="Model name to use for this session (overrides config, does not persist)")
8
9
 
9
10
  # Mutually exclusive group for system prompt options
10
11
  group = parser.add_mutually_exclusive_group()
@@ -35,6 +35,10 @@ def run_cli(args):
35
35
  if args.role:
36
36
  runtime_config.set('role', args.role)
37
37
 
38
+ # Set runtime_config['model'] if --model is provided (highest priority, session only)
39
+ if getattr(args, 'model', None):
40
+ runtime_config.set('model', args.model)
41
+
38
42
  # New logic for --system-file
39
43
  system_prompt = None
40
44
  if getattr(args, 'system_file', None):
@@ -54,6 +58,7 @@ def run_cli(args):
54
58
 
55
59
  if args.show_system:
56
60
  api_key = get_api_key()
61
+ # Always get model from unified_config (which checks runtime_config first)
57
62
  model = unified_config.get('model')
58
63
  agent = Agent(api_key=api_key, model=model)
59
64
  print("Model:", agent.model)
@@ -64,6 +69,7 @@ def run_cli(args):
64
69
 
65
70
  api_key = get_api_key()
66
71
 
72
+ # Always get model from unified_config (which checks runtime_config first)
67
73
  model = unified_config.get('model')
68
74
  base_url = unified_config.get('base_url', 'https://openrouter.ai/api/v1')
69
75
  # Handle --enable-tools flag
@@ -112,4 +118,4 @@ def run_cli(args):
112
118
  except EmptyResponseError as e:
113
119
  print(f"[red]Error:[/red] {e}")
114
120
  except KeyboardInterrupt:
115
- print("[yellow]Interrupted by user.[/yellow]")
121
+ console.print("[yellow]Interrupted by user.[/yellow]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janito
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: An agent framework with built-in tools.
5
5
  Author-email: João Pinto <joao.pinto@gmail.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Requires-Dist: rich
17
17
  Requires-Dist: openai
18
18
  Requires-Dist: flask
19
19
  Requires-Dist: pathspec
20
+ Requires-Dist: beautifulsoup4
20
21
  Dynamic: license-file
21
22
 
22
23
  # 🚀 Janito: Natural Language Code Editing Agent
@@ -66,7 +67,7 @@ Janito is a command-line and web-based AI agent designed to **edit code and mana
66
67
  | Key | Description | How to set | Default |
67
68
  |---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
68
69
  | `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
+ | `model` | Model name to use | `--model` (session only), `--set-local-config model=...`, or `--set-global-config` | `openai/gpt-4.1` |
70
71
  | `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
71
72
  | `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
72
73
  | `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
@@ -2,3 +2,4 @@ rich
2
2
  openai
3
3
  flask
4
4
  pathspec
5
+ beautifulsoup4
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "janito"
3
- version = "1.1.0"
3
+ version = "1.2.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" }
@@ -10,7 +10,8 @@ dependencies = [
10
10
  "rich",
11
11
  "openai",
12
12
  "flask",
13
- "pathspec"
13
+ "pathspec",
14
+ "beautifulsoup4"
14
15
  ]
15
16
  license = { text = "MIT" }
16
17
  readme = "README.md"
@@ -1 +0,0 @@
1
- __version__ = "1.1.0"
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