qbraid-cli 0.14.0__tar.gz → 0.15.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.
- {qbraid_cli-0.14.0/qbraid_cli.egg-info → qbraid_cli-0.15.0}/PKG-INFO +1 -1
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/pyproject.toml +1 -1
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/agents/app.py +70 -3
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0/qbraid_cli.egg-info}/PKG-INFO +1 -1
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/LICENSE +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/README.md +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/_build_info.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/_version.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/agents/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/ai/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/ai/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/ai/token.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/instances.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/profiles.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/server.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/compute/ssh.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/groups.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/publish.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/registry.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/envs/share.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/jobs/groups.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/lab/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/lab/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/projects/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/projects/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/skills/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/skills/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/troubleshoot/__init__.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli/troubleshoot/app.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli.egg-info/SOURCES.txt +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli.egg-info/requires.txt +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/setup.cfg +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/tests/test_cli_e2e.py +0 -0
- {qbraid_cli-0.14.0 → qbraid_cli-0.15.0}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Command Line Interface for interacting with all parts of the qBraid platform.
|
|
5
5
|
Author-email: qBraid Development Team <contact@qbraid.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.15.0"
|
|
8
8
|
description = "Command Line Interface for interacting with all parts of the qBraid platform."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
"""Agents CLI - Monitor and manage AI coding agent sessions."""
|
|
5
5
|
|
|
6
|
+
import inspect
|
|
6
7
|
import os
|
|
7
8
|
import re
|
|
8
9
|
import signal
|
|
9
10
|
import time
|
|
10
11
|
from datetime import datetime
|
|
12
|
+
from enum import Enum
|
|
11
13
|
from pathlib import Path
|
|
12
|
-
from typing import List, Optional
|
|
14
|
+
from typing import Any, Callable, Dict, List, Optional
|
|
13
15
|
|
|
14
16
|
import click
|
|
15
17
|
import typer
|
|
@@ -1096,10 +1098,59 @@ def _interactive_attach(console_: Console) -> str:
|
|
|
1096
1098
|
return selected
|
|
1097
1099
|
|
|
1098
1100
|
|
|
1101
|
+
class ApprovalMode(str, Enum):
|
|
1102
|
+
"""How much the agent asks before acting.
|
|
1103
|
+
|
|
1104
|
+
A launched agent is detached, so a confirmation prompt has nobody to
|
|
1105
|
+
answer it — ``auto`` is the mode for anything you intend to leave running.
|
|
1106
|
+
"""
|
|
1107
|
+
|
|
1108
|
+
ASK = "ask"
|
|
1109
|
+
AUTO = "auto"
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
def _approval_kwargs(method: Callable[..., Any], approval: Optional[str]) -> Dict[str, Any]:
|
|
1113
|
+
"""Forward ``approval`` only to a qbraid-core new enough to accept it.
|
|
1114
|
+
|
|
1115
|
+
The CLI's floor is qbraid-core>=0.5.0, which predates the parameter. Passing
|
|
1116
|
+
it unconditionally would raise TypeError on EVERY launch there, not only
|
|
1117
|
+
when --approval was used — so detect support and, when the user actually
|
|
1118
|
+
asked for a mode we cannot honour, say so plainly instead of forwarding it.
|
|
1119
|
+
|
|
1120
|
+
A Mock reports ``(*args, **kwargs)``; VAR_KEYWORD therefore counts as
|
|
1121
|
+
support, which is both correct in general and keeps test doubles working.
|
|
1122
|
+
"""
|
|
1123
|
+
try:
|
|
1124
|
+
params = inspect.signature(method).parameters
|
|
1125
|
+
supported = "approval" in params or any(
|
|
1126
|
+
param.kind is inspect.Parameter.VAR_KEYWORD for param in params.values()
|
|
1127
|
+
)
|
|
1128
|
+
except (TypeError, ValueError): # pragma: no cover - non-introspectable callable
|
|
1129
|
+
supported = True
|
|
1130
|
+
|
|
1131
|
+
if supported:
|
|
1132
|
+
return {"approval": approval}
|
|
1133
|
+
|
|
1134
|
+
if approval is not None:
|
|
1135
|
+
try:
|
|
1136
|
+
from qbraid_core import __version__ as core_version
|
|
1137
|
+
except ImportError: # pragma: no cover
|
|
1138
|
+
core_version = "unknown"
|
|
1139
|
+
handle_error(
|
|
1140
|
+
error_type="UnsupportedOptionError",
|
|
1141
|
+
message=(
|
|
1142
|
+
f"--approval requires a newer qbraid-core (installed: {core_version}). "
|
|
1143
|
+
"Upgrade with: pip install -U qbraid-core"
|
|
1144
|
+
),
|
|
1145
|
+
include_traceback=False,
|
|
1146
|
+
)
|
|
1147
|
+
return {}
|
|
1148
|
+
|
|
1149
|
+
|
|
1099
1150
|
@agents_app.command("launch")
|
|
1100
1151
|
def agents_launch(
|
|
1101
1152
|
tool: Optional[str] = typer.Option(
|
|
1102
|
-
None, "--tool", "-t", help="Agent tool (claude, claude-auto
|
|
1153
|
+
None, "--tool", "-t", help="Agent tool (claude, codeq, codex; claude-auto = claude --approval auto)"
|
|
1103
1154
|
),
|
|
1104
1155
|
cwd: Optional[str] = typer.Option(None, "--cwd", help="Working directory"),
|
|
1105
1156
|
name: Optional[str] = typer.Option(None, "--name", "-n", help="Agent name"),
|
|
@@ -1116,10 +1167,21 @@ def agents_launch(
|
|
|
1116
1167
|
compute: Optional[str] = typer.Option(
|
|
1117
1168
|
None, "--compute", "-c", help="SSH alias for remote compute server"
|
|
1118
1169
|
),
|
|
1170
|
+
approval: Optional[ApprovalMode] = typer.Option(
|
|
1171
|
+
None,
|
|
1172
|
+
"--approval",
|
|
1173
|
+
help="ask: the agent confirms before acting. auto: it acts without asking.",
|
|
1174
|
+
),
|
|
1119
1175
|
):
|
|
1120
1176
|
"""Launch an AI coding agent.
|
|
1121
1177
|
|
|
1122
1178
|
Starts the agent in a managed tmux session.
|
|
1179
|
+
|
|
1180
|
+
The agent runs detached, so nothing is watching its confirmation prompts.
|
|
1181
|
+
Pass --approval auto for an agent you intend to leave running: it starts
|
|
1182
|
+
the tool in its own non-interactive mode instead of parking on a prompt
|
|
1183
|
+
until you come back. Approval mode is remembered, so `qbraid agents
|
|
1184
|
+
resume` restores it.
|
|
1123
1185
|
"""
|
|
1124
1186
|
try:
|
|
1125
1187
|
from qbraid_core.services.agents import AgentLauncher, AgentLauncherError
|
|
@@ -1148,6 +1210,7 @@ def agents_launch(
|
|
|
1148
1210
|
instructions=instructions,
|
|
1149
1211
|
agent_type=agent_type,
|
|
1150
1212
|
tags=tag,
|
|
1213
|
+
**_approval_kwargs(launcher.remote_launch, approval.value if approval else None),
|
|
1151
1214
|
)
|
|
1152
1215
|
else:
|
|
1153
1216
|
|
|
@@ -1164,6 +1227,7 @@ def agents_launch(
|
|
|
1164
1227
|
parent_session_id=parent,
|
|
1165
1228
|
team_id=team,
|
|
1166
1229
|
tags=tag,
|
|
1230
|
+
**_approval_kwargs(launcher.launch, approval.value if approval else None),
|
|
1167
1231
|
progress_callback=_clone_progress if repo else None,
|
|
1168
1232
|
)
|
|
1169
1233
|
|
|
@@ -1334,12 +1398,15 @@ def agents_resume(
|
|
|
1334
1398
|
if original:
|
|
1335
1399
|
tool_value = original.tool.value if original.tool else "claude"
|
|
1336
1400
|
fork_name = name or f"{tmux_win}-fork"
|
|
1337
|
-
# Launch fresh with same tool and cwd
|
|
1401
|
+
# Launch fresh with same tool and cwd.
|
|
1338
1402
|
session = launcher.launch(
|
|
1339
1403
|
tool=tool_value,
|
|
1340
1404
|
cwd=original.cwd,
|
|
1341
1405
|
name=fork_name,
|
|
1342
1406
|
instructions=None,
|
|
1407
|
+
# A fork of a detached agent must not quietly
|
|
1408
|
+
# become one that waits for a human.
|
|
1409
|
+
**_approval_kwargs(launcher.launch, getattr(original, "approval", None)),
|
|
1343
1410
|
)
|
|
1344
1411
|
else:
|
|
1345
1412
|
console.print("[red]Could not find original session to fork.[/red]")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Command Line Interface for interacting with all parts of the qBraid platform.
|
|
5
5
|
Author-email: qBraid Development Team <contact@qbraid.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|