janito 2.3.1__py3-none-any.whl → 2.4.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 +1 -1
- janito/_version.py +57 -0
- janito/agent/setup_agent.py +92 -18
- janito/agent/templates/profiles/system_prompt_template_developer.txt.j2 +44 -0
- janito/cli/chat_mode/bindings.py +21 -2
- janito/cli/chat_mode/chat_entry.py +2 -3
- janito/cli/chat_mode/prompt_style.py +5 -0
- janito/cli/chat_mode/session.py +80 -94
- janito/cli/chat_mode/session_profile_select.py +80 -0
- janito/cli/chat_mode/shell/commands/__init__.py +13 -7
- janito/cli/chat_mode/shell/commands/_priv_check.py +5 -0
- janito/cli/chat_mode/shell/commands/conversation_restart.py +30 -0
- janito/cli/chat_mode/shell/commands/execute.py +42 -0
- janito/cli/chat_mode/shell/commands/help.py +6 -3
- janito/cli/chat_mode/shell/commands/model.py +28 -0
- janito/cli/chat_mode/shell/commands/read.py +37 -0
- janito/cli/chat_mode/shell/commands/tools.py +45 -18
- janito/cli/chat_mode/shell/commands/write.py +37 -0
- janito/cli/chat_mode/shell/commands.bak.zip +0 -0
- janito/cli/chat_mode/shell/session.bak.zip +0 -0
- janito/cli/chat_mode/toolbar.py +44 -27
- janito/cli/cli_commands/list_tools.py +44 -11
- janito/cli/cli_commands/model_utils.py +95 -95
- janito/cli/cli_commands/show_system_prompt.py +57 -14
- janito/cli/config.py +5 -6
- janito/cli/core/getters.py +33 -33
- janito/cli/core/runner.py +25 -18
- janito/cli/core/setters.py +10 -1
- janito/cli/main_cli.py +28 -5
- janito/cli/prompt_core.py +18 -2
- janito/cli/prompt_setup.py +56 -0
- janito/cli/single_shot_mode/handler.py +14 -73
- janito/cli/verbose_output.py +1 -1
- janito/config_manager.py +125 -112
- janito/drivers/dashscope.bak.zip +0 -0
- janito/drivers/openai/README.md +20 -0
- janito/drivers/openai_responses.bak.zip +0 -0
- janito/event_bus/event.py +2 -2
- janito/i18n/pt.py +0 -1
- janito/llm/README.md +23 -0
- janito/llm/agent.py +80 -16
- janito/llm/auth.py +63 -63
- janito/llm/driver.py +8 -0
- janito/provider_registry.py +178 -176
- janito/providers/azure_openai/model_info.py +16 -16
- janito/providers/dashscope.bak.zip +0 -0
- janito/providers/registry.py +26 -26
- janito/shell.bak.zip +0 -0
- janito/tools/DOCSTRING_STANDARD.txt +33 -0
- janito/tools/README.md +3 -0
- janito/tools/__init__.py +20 -6
- janito/tools/adapters/local/__init__.py +65 -62
- janito/tools/adapters/local/adapter.py +18 -35
- janito/tools/adapters/local/ask_user.py +3 -4
- janito/tools/adapters/local/copy_file.py +2 -2
- janito/tools/adapters/local/create_directory.py +2 -2
- janito/tools/adapters/local/create_file.py +2 -2
- janito/tools/adapters/local/delete_text_in_file.py +2 -2
- janito/tools/adapters/local/fetch_url.py +2 -2
- janito/tools/adapters/local/find_files.py +2 -1
- janito/tools/adapters/local/get_file_outline/core.py +2 -2
- janito/tools/adapters/local/get_file_outline/search_outline.py +2 -2
- janito/tools/adapters/local/move_file.py +2 -2
- janito/tools/adapters/local/open_html_in_browser.py +2 -1
- janito/tools/adapters/local/open_url.py +2 -2
- janito/tools/adapters/local/python_code_run.py +3 -3
- janito/tools/adapters/local/python_command_run.py +3 -3
- janito/tools/adapters/local/python_file_run.py +3 -3
- janito/tools/adapters/local/remove_directory.py +2 -2
- janito/tools/adapters/local/remove_file.py +2 -2
- janito/tools/adapters/local/replace_text_in_file.py +2 -2
- janito/tools/adapters/local/run_bash_command.py +3 -3
- janito/tools/adapters/local/run_powershell_command.py +3 -3
- janito/tools/adapters/local/search_text/core.py +2 -2
- janito/tools/adapters/local/validate_file_syntax/core.py +2 -2
- janito/tools/adapters/local/view_file.py +2 -1
- janito/tools/outline_file.bak.zip +0 -0
- janito/tools/permissions.py +45 -0
- janito/tools/permissions_parse.py +12 -0
- janito/tools/tool_base.py +14 -1
- janito/tools/tool_utils.py +4 -6
- janito/tools/tools_adapter.py +25 -20
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/METADATA +51 -16
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/RECORD +88 -74
- janito/agent/templates/profiles/system_prompt_template_base_pt.txt.j2 +0 -13
- janito/agent/templates/profiles/system_prompt_template_main.txt.j2 +0 -37
- janito/cli/chat_mode/shell/commands/edit.py +0 -25
- janito/cli/chat_mode/shell/commands/exec.py +0 -27
- janito/cli/chat_mode/shell/commands/termweb_log.py +0 -92
- janito/cli/termweb_starter.py +0 -122
- janito/termweb/app.py +0 -95
- janito/version.py +0 -4
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/WHEEL +0 -0
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/entry_points.txt +0 -0
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/licenses/LICENSE +0 -0
- {janito-2.3.1.dist-info → janito-2.4.0.dist-info}/top_level.txt +0 -0
janito/termweb/app.py
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
from quart import Quart, send_from_directory, request, jsonify, websocket
|
2
|
-
import os
|
3
|
-
|
4
|
-
app = Quart(__name__)
|
5
|
-
|
6
|
-
BASE_DIR = os.getcwd()
|
7
|
-
|
8
|
-
|
9
|
-
@app.route("/")
|
10
|
-
async def index():
|
11
|
-
static_dir = os.path.join(os.path.dirname(__file__), "static")
|
12
|
-
file_path = request.args.get("path")
|
13
|
-
if file_path:
|
14
|
-
return await send_from_directory(static_dir, "editor.html")
|
15
|
-
return await send_from_directory(static_dir, "index.html")
|
16
|
-
|
17
|
-
|
18
|
-
@app.route("/static/<path:filepath>")
|
19
|
-
async def server_static(filepath):
|
20
|
-
static_dir = os.path.join(os.path.dirname(__file__), "static")
|
21
|
-
return await send_from_directory(static_dir, filepath)
|
22
|
-
|
23
|
-
|
24
|
-
@app.route("/api/explorer/")
|
25
|
-
async def api_explorer_root():
|
26
|
-
return await api_explorer(".")
|
27
|
-
|
28
|
-
|
29
|
-
@app.route("/api/explorer/<path:path>", methods=["GET", "POST"])
|
30
|
-
async def api_explorer(path="."):
|
31
|
-
abs_path = os.path.abspath(os.path.join(BASE_DIR, path))
|
32
|
-
# Security: Only allow files/dirs within BASE_DIR
|
33
|
-
if not abs_path.startswith(BASE_DIR):
|
34
|
-
return jsonify({"error": "Acesso negado."}), 403
|
35
|
-
|
36
|
-
if request.method == "POST":
|
37
|
-
# Gravação de arquivo
|
38
|
-
if os.path.isdir(abs_path):
|
39
|
-
return jsonify({"error": "Não é possível gravar em um diretório."}), 400
|
40
|
-
try:
|
41
|
-
data = await request.get_json()
|
42
|
-
content = data.get("content", "")
|
43
|
-
with open(abs_path, "w", encoding="utf-8") as f:
|
44
|
-
f.write(content)
|
45
|
-
return jsonify({"success": True})
|
46
|
-
except Exception as e:
|
47
|
-
return jsonify({"error": str(e)}), 500
|
48
|
-
|
49
|
-
# GET: comportamento actual
|
50
|
-
if os.path.isdir(abs_path):
|
51
|
-
entries = []
|
52
|
-
walker = walk_dir_with_gitignore(abs_path, max_depth=1)
|
53
|
-
for root, dirs, files in walker:
|
54
|
-
for entry in sorted(dirs):
|
55
|
-
entries.append({"name": entry, "is_dir": True})
|
56
|
-
for entry in sorted(files):
|
57
|
-
entries.append({"name": entry, "is_dir": False})
|
58
|
-
return jsonify({"type": "dir", "path": path, "entries": entries})
|
59
|
-
elif os.path.isfile(abs_path):
|
60
|
-
with open(abs_path, "r", encoding="utf-8", errors="replace") as f:
|
61
|
-
content = f.read()
|
62
|
-
return jsonify({"type": "file", "path": path, "content": content})
|
63
|
-
else:
|
64
|
-
return jsonify({"error": "Não encontrado."}), 404
|
65
|
-
|
66
|
-
|
67
|
-
# Example WebSocket endpoint
|
68
|
-
@app.websocket("/ws")
|
69
|
-
async def ws():
|
70
|
-
while True:
|
71
|
-
data = await websocket.receive()
|
72
|
-
await websocket.send(f"Echo: {data}")
|
73
|
-
|
74
|
-
|
75
|
-
# Catch-all route for SPA navigation (excluding /static and /api)
|
76
|
-
@app.route("/<path:catchall>")
|
77
|
-
async def spa_catch_all(catchall):
|
78
|
-
static_dir = os.path.join(os.path.dirname(__file__), "static")
|
79
|
-
return await send_from_directory(static_dir, "index.html")
|
80
|
-
|
81
|
-
|
82
|
-
if __name__ == "__main__":
|
83
|
-
import sys
|
84
|
-
|
85
|
-
port = 8088
|
86
|
-
# Allow override from CLI for direct execution/testing
|
87
|
-
if "--port" in sys.argv:
|
88
|
-
idx = sys.argv.index("--port")
|
89
|
-
if idx + 1 < len(sys.argv):
|
90
|
-
try:
|
91
|
-
port = int(sys.argv[idx + 1])
|
92
|
-
except ValueError:
|
93
|
-
pass
|
94
|
-
print(f"Iniciando servidor web Quart em http://localhost:{port}")
|
95
|
-
app.run(host="localhost", port=port, debug=True)
|
janito/version.py
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|