openhands 1.0.1__py3-none-any.whl → 1.0.3__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.
Potentially problematic release.
This version of openhands might be problematic. Click here for more details.
- {openhands-1.0.1.dist-info → openhands-1.0.3.dist-info}/METADATA +5 -5
- {openhands-1.0.1.dist-info → openhands-1.0.3.dist-info}/RECORD +11 -11
- openhands_cli/gui_launcher.py +2 -2
- openhands_cli/pt_style.py +1 -1
- openhands_cli/runner.py +1 -0
- openhands_cli/tui/settings/settings_screen.py +3 -5
- openhands_cli/tui/settings/store.py +1 -1
- openhands_cli/user_actions/agent_action.py +6 -21
- openhands_cli/{llm_utils.py → utils.py} +20 -1
- {openhands-1.0.1.dist-info → openhands-1.0.3.dist-info}/WHEEL +0 -0
- {openhands-1.0.1.dist-info → openhands-1.0.3.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openhands
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: OpenHands CLI - Terminal User Interface for OpenHands AI Agent
|
|
5
5
|
Author-email: OpenHands Team <contact@all-hands.dev>
|
|
6
6
|
License: MIT
|
|
@@ -8,17 +8,17 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.12
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.13
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
|
-
Requires-Dist: openhands-sdk
|
|
12
|
-
Requires-Dist: openhands-tools
|
|
11
|
+
Requires-Dist: openhands-sdk==1.0.0a5
|
|
12
|
+
Requires-Dist: openhands-tools==1.0.0a5
|
|
13
13
|
Requires-Dist: prompt-toolkit>=3
|
|
14
14
|
Requires-Dist: typer>=0.17.4
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
|
|
17
17
|
# OpenHands V1 CLI
|
|
18
18
|
|
|
19
|
-
A **lightweight, modern CLI** to interact with the OpenHands agent (powered by [agent-sdk](https://github.com/
|
|
19
|
+
A **lightweight, modern CLI** to interact with the OpenHands agent (powered by [agent-sdk](https://github.com/OpenHands/agent-sdk)).
|
|
20
20
|
|
|
21
|
-
The [OpenHands V0 CLI (legacy)](https://github.com/
|
|
21
|
+
The [OpenHands V0 CLI (legacy)](https://github.com/OpenHands/OpenHands/tree/main/openhands/cli) is being deprecated.
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
openhands_cli/__init__.py,sha256=AqdjE-Up0uBSDyHvNjF0zWHNmA4ps-lsQWFpUWCWNEc,187
|
|
2
2
|
openhands_cli/agent_chat.py,sha256=FZ1NC31xJPXqyFGUtS-JqDI_HVP5155xEz59AHp3DIw,6224
|
|
3
|
-
openhands_cli/gui_launcher.py,sha256=
|
|
4
|
-
openhands_cli/llm_utils.py,sha256=eRhAjysm77GvzArKb-75agqTlR_4zzxTrYD1eQbgqbg,1606
|
|
3
|
+
openhands_cli/gui_launcher.py,sha256=7gxcem7y7WcqllZWO6B6RtM_5WPOKvRAauByS1y1U6I,7192
|
|
5
4
|
openhands_cli/locations.py,sha256=zG5OnpJiX0kQ1fprEsOSi_cNqydEvxunPBCTpNrVaJ0,438
|
|
6
|
-
openhands_cli/pt_style.py,sha256=
|
|
7
|
-
openhands_cli/runner.py,sha256=
|
|
5
|
+
openhands_cli/pt_style.py,sha256=ITu26EC-uMJdBdB5AGtB-3kdFqZvht7gGhoPJ__O0GY,1263
|
|
6
|
+
openhands_cli/runner.py,sha256=10dloNBwPHcVNfLEXgqfJgUZ6-HJyL5-xtlAQTR-9wA,6158
|
|
8
7
|
openhands_cli/setup.py,sha256=HWb2_6N6qgXvhIzh7jLecS7HA5EEcp7b3VroDxGiGz0,3799
|
|
9
8
|
openhands_cli/simple_main.py,sha256=7MmX8DgSvlFURzYsNqcE2vQ2MtdYTr-V88JlBmJlWvo,1697
|
|
9
|
+
openhands_cli/utils.py,sha256=SwrKvw9HDTExC7kjf4yFE4FkbaRTP7AQzYVhIi99zkA,2018
|
|
10
10
|
openhands_cli/argparsers/main_parser.py,sha256=ceYNnktzp4xMwrsvQZl0Py6uG3atUgBsPFfqM7Cig9k,1677
|
|
11
11
|
openhands_cli/argparsers/serve_parser.py,sha256=WU2ClG5idbs966zJ5GfBXiaMH50e0ryGC1vD24JyJJ8,900
|
|
12
12
|
openhands_cli/listeners/__init__.py,sha256=T251L6mUEQdfk1x7-AWITlDjgVDwfW8XkyKQYK6Z5O0,180
|
|
@@ -17,15 +17,15 @@ openhands_cli/tui/status.py,sha256=QNbS9OEK6d_c0P1eEQKfytuUF1R7uPxFl5nN-yv3cdA,3
|
|
|
17
17
|
openhands_cli/tui/tui.py,sha256=JBahocaunF0LwJJLkcCmwSZN9xydb3SmH7fb8Jw8rFc,3545
|
|
18
18
|
openhands_cli/tui/utils.py,sha256=t7vJHU_AcLzuLTPku88Aqd51jyWY8HwH5Y2n-Bpa-WU,536
|
|
19
19
|
openhands_cli/tui/settings/mcp_screen.py,sha256=LMdcGD6DfwZQ4jnp-KM4gYiPXfNGHHPAqtEAXLKZtmA,8215
|
|
20
|
-
openhands_cli/tui/settings/settings_screen.py,sha256=
|
|
21
|
-
openhands_cli/tui/settings/store.py,sha256=
|
|
20
|
+
openhands_cli/tui/settings/settings_screen.py,sha256=JCJl1ysd-JniiptMBIQxnNs7guH1Q0UTc3a4cYlKdNE,6964
|
|
21
|
+
openhands_cli/tui/settings/store.py,sha256=bhQZ--grg4hi5g7uvmjkrBTVq16G4Ln_uXp_D-ADKPg,3481
|
|
22
22
|
openhands_cli/user_actions/__init__.py,sha256=Tf-lQj7-6bNl5rohSdcAFApkKbQb-N9JcKZgHa1HF60,501
|
|
23
|
-
openhands_cli/user_actions/agent_action.py,sha256=
|
|
23
|
+
openhands_cli/user_actions/agent_action.py,sha256=Q0nW6zv7j1D1ys95FCI13rqQhw0sXlw820Dp9qR4WyY,2704
|
|
24
24
|
openhands_cli/user_actions/exit_session.py,sha256=3u1CqWeYAEYfZi9BFh_dUwvy9aXXuvFbsZUHNGjVzuY,624
|
|
25
25
|
openhands_cli/user_actions/settings_action.py,sha256=QqWj37CAlrkV6FW9SEmmwsvKzdGyUYv4DlGjUweKsmg,5707
|
|
26
26
|
openhands_cli/user_actions/types.py,sha256=zMHoJqxmtbxAIq6O3RC-XoGzgbZzWZvRFNMOGW4MViQ,407
|
|
27
27
|
openhands_cli/user_actions/utils.py,sha256=qPTgP_1shnWgA7itrzTyfEGb_meXO-zq98JzFMUqCx4,6362
|
|
28
|
-
openhands-1.0.
|
|
29
|
-
openhands-1.0.
|
|
30
|
-
openhands-1.0.
|
|
31
|
-
openhands-1.0.
|
|
28
|
+
openhands-1.0.3.dist-info/METADATA,sha256=rZJBpMT6qTrLX9bsGmFWKaJ3xft8KUMOsEcjrmjRBHA,1382
|
|
29
|
+
openhands-1.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
30
|
+
openhands-1.0.3.dist-info/entry_points.txt,sha256=CltyhTfx4lPndNPQXrZZDj5LmXrYXykVyIqoedPXsas,61
|
|
31
|
+
openhands-1.0.3.dist-info/RECORD,,
|
openhands_cli/gui_launcher.py
CHANGED
|
@@ -104,8 +104,8 @@ def launch_gui_server(mount_cwd: bool = False, gpu: bool = False) -> None:
|
|
|
104
104
|
|
|
105
105
|
# Get the current version for the Docker image
|
|
106
106
|
version = get_openhands_version()
|
|
107
|
-
runtime_image = f'docker.all-hands.dev/
|
|
108
|
-
app_image = f'docker.all-hands.dev/
|
|
107
|
+
runtime_image = f'docker.all-hands.dev/openhands/runtime:{version}-nikolaik'
|
|
108
|
+
app_image = f'docker.all-hands.dev/openhands/openhands:{version}'
|
|
109
109
|
|
|
110
110
|
print_formatted_text(HTML('<grey>Pulling required Docker images...</grey>'))
|
|
111
111
|
|
openhands_cli/pt_style.py
CHANGED
|
@@ -20,7 +20,7 @@ def get_cli_style() -> BaseStyle:
|
|
|
20
20
|
'prompt': f'{COLOR_GOLD} bold',
|
|
21
21
|
# Ensure good contrast for fuzzy matches on the selected completion row
|
|
22
22
|
# across terminals/themes (e.g., Ubuntu GNOME, Alacritty, Kitty).
|
|
23
|
-
# See https://github.com/
|
|
23
|
+
# See https://github.com/OpenHands/OpenHands/issues/10330
|
|
24
24
|
'completion-menu.completion.current fuzzymatch.outside': 'fg:#ffffff bg:#888888',
|
|
25
25
|
'selected': COLOR_GOLD,
|
|
26
26
|
'risk-high': '#FF0000 bold', # Red bold for HIGH risk
|
openhands_cli/runner.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
3
|
from openhands.sdk import LLM, BaseConversation, LocalFileStore
|
|
4
|
-
from openhands.sdk.security.confirmation_policy import NeverConfirm
|
|
5
|
-
from openhands.tools.preset.default import get_default_agent
|
|
6
4
|
from prompt_toolkit import HTML, print_formatted_text
|
|
7
5
|
from prompt_toolkit.shortcuts import print_container
|
|
8
6
|
from prompt_toolkit.widgets import Frame, TextArea
|
|
9
7
|
|
|
10
|
-
from openhands_cli.
|
|
8
|
+
from openhands_cli.utils import get_llm_metadata, get_default_cli_agent
|
|
11
9
|
from openhands_cli.locations import AGENT_SETTINGS_PATH, PERSISTENCE_DIR
|
|
12
10
|
from openhands_cli.pt_style import COLOR_GREY
|
|
13
11
|
from openhands_cli.tui.settings.store import AgentStore
|
|
@@ -176,13 +174,13 @@ class SettingsScreen:
|
|
|
176
174
|
model=model,
|
|
177
175
|
api_key=api_key,
|
|
178
176
|
base_url=base_url,
|
|
179
|
-
|
|
177
|
+
usage_id='agent',
|
|
180
178
|
metadata=get_llm_metadata(model_name=model, llm_type='agent'),
|
|
181
179
|
)
|
|
182
180
|
|
|
183
181
|
agent = self.agent_store.load()
|
|
184
182
|
if not agent:
|
|
185
|
-
agent =
|
|
183
|
+
agent = get_default_cli_agent(llm=llm)
|
|
186
184
|
|
|
187
185
|
agent = agent.model_copy(update={'llm': llm})
|
|
188
186
|
self.agent_store.save(agent)
|
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
7
|
from fastmcp.mcp_config import MCPConfig
|
|
8
|
-
from openhands_cli.
|
|
8
|
+
from openhands_cli.utils import get_llm_metadata
|
|
9
9
|
from openhands_cli.locations import (
|
|
10
10
|
AGENT_SETTINGS_PATH,
|
|
11
11
|
MCP_CONFIG_FILE,
|
|
@@ -44,8 +44,7 @@ def ask_user_confirmation(
|
|
|
44
44
|
question = 'Choose an option:'
|
|
45
45
|
options = [
|
|
46
46
|
'Yes, proceed',
|
|
47
|
-
'
|
|
48
|
-
'No, reject with reason',
|
|
47
|
+
'Reject',
|
|
49
48
|
"Always proceed (don't ask again)",
|
|
50
49
|
]
|
|
51
50
|
|
|
@@ -61,32 +60,18 @@ def ask_user_confirmation(
|
|
|
61
60
|
if index == 0:
|
|
62
61
|
return ConfirmationResult(decision=UserConfirmation.ACCEPT)
|
|
63
62
|
elif index == 1:
|
|
64
|
-
|
|
65
|
-
elif index == 2:
|
|
63
|
+
# Handle "Reject" option with optional reason
|
|
66
64
|
try:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
70
|
-
except Exception:
|
|
71
|
-
return ConfirmationResult(decision=UserConfirmation.DEFER)
|
|
72
|
-
|
|
73
|
-
# Support both string return and (reason, cancelled) tuple for tests
|
|
74
|
-
cancelled = False
|
|
75
|
-
if isinstance(reason_result, tuple) and len(reason_result) >= 1:
|
|
76
|
-
reason = reason_result[0] or ''
|
|
77
|
-
cancelled = bool(reason_result[1]) if len(reason_result) > 1 else False
|
|
78
|
-
else:
|
|
79
|
-
reason = str(reason_result or '').strip()
|
|
80
|
-
|
|
81
|
-
if cancelled:
|
|
65
|
+
reason = cli_text_input('Reason (and let OpenHands know why): ').strip()
|
|
66
|
+
except (EOFError, KeyboardInterrupt):
|
|
82
67
|
return ConfirmationResult(decision=UserConfirmation.DEFER)
|
|
83
68
|
|
|
84
69
|
return ConfirmationResult(decision=UserConfirmation.REJECT, reason=reason)
|
|
85
|
-
elif index ==
|
|
70
|
+
elif index == 2:
|
|
86
71
|
return ConfirmationResult(
|
|
87
72
|
decision=UserConfirmation.ACCEPT, policy_change=NeverConfirm()
|
|
88
73
|
)
|
|
89
|
-
elif index ==
|
|
74
|
+
elif index == 3:
|
|
90
75
|
return ConfirmationResult(
|
|
91
76
|
decision=UserConfirmation.ACCEPT,
|
|
92
77
|
policy_change=ConfirmRisky(threshold=SecurityRisk.HIGH),
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
from typing import Any
|
|
5
|
-
|
|
5
|
+
from openhands.sdk.security.llm_analyzer import LLMSecurityAnalyzer
|
|
6
|
+
from openhands.tools.preset import get_default_agent
|
|
7
|
+
from openhands.sdk import LLM
|
|
6
8
|
|
|
7
9
|
def get_llm_metadata(
|
|
8
10
|
model_name: str,
|
|
@@ -55,3 +57,20 @@ def get_llm_metadata(
|
|
|
55
57
|
if user_id is not None:
|
|
56
58
|
metadata['trace_user_id'] = user_id
|
|
57
59
|
return metadata
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def get_default_cli_agent(
|
|
63
|
+
llm: LLM
|
|
64
|
+
):
|
|
65
|
+
agent = get_default_agent(
|
|
66
|
+
llm=llm,
|
|
67
|
+
cli_mode=True
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
agent = agent.model_copy(
|
|
71
|
+
update={
|
|
72
|
+
'security_analyzer': LLMSecurityAnalyzer()
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return agent
|
|
File without changes
|
|
File without changes
|