conduct-cli 0.4.33__tar.gz → 0.4.35__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.
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/PKG-INFO +1 -1
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/pyproject.toml +1 -1
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/main.py +42 -72
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/README.md +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/setup.cfg +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/setup.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/guard.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.33 → conduct_cli-0.4.35}/src/conduct_cli.egg-info/top_level.txt +0 -0
|
@@ -1280,82 +1280,48 @@ def _build_state(issue: dict, repo_full_name: str) -> dict:
|
|
|
1280
1280
|
|
|
1281
1281
|
|
|
1282
1282
|
def cmd_run(args):
|
|
1283
|
-
path = Path(args.yaml)
|
|
1284
|
-
if not path.exists():
|
|
1285
|
-
print(f"ERROR: file not found: {path}")
|
|
1286
|
-
sys.exit(1)
|
|
1287
|
-
|
|
1288
|
-
raw_yaml = path.read_text()
|
|
1289
|
-
cfg = yaml.safe_load(raw_yaml)
|
|
1290
|
-
name = cfg.get("name", path.stem)
|
|
1291
|
-
workflow_id = cfg.get("id")
|
|
1292
1283
|
server, workspace_id, api_key, token = _require_auth(args)
|
|
1293
|
-
on_block = cfg.get("on") or {}
|
|
1294
|
-
trigger_type = next(iter(on_block), None)
|
|
1295
|
-
trigger_cfg = on_block.get(trigger_type, {})
|
|
1296
|
-
|
|
1297
1284
|
json_h = api.headers(workspace_id, token, "application/json", api_key)
|
|
1298
|
-
yaml_h = api.headers(workspace_id, token, "application/x-yaml", api_key)
|
|
1299
|
-
|
|
1300
|
-
print(f"\n{BOLD}▶ conduct run — {name}{RESET}")
|
|
1301
|
-
print(f" server: {server}\n")
|
|
1302
1285
|
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
repo = trigger_cfg.get("repo_allowlist", "")
|
|
1312
|
-
label = trigger_cfg.get("label", "")
|
|
1286
|
+
# Parse --input key=value pairs into initial_state
|
|
1287
|
+
initial_state: dict = {}
|
|
1288
|
+
for kv in (args.input or []):
|
|
1289
|
+
if "=" not in kv:
|
|
1290
|
+
print(f"{RED}Bad --input format '{kv}' — expected key=value{RESET}")
|
|
1291
|
+
sys.exit(1)
|
|
1292
|
+
k, v = kv.split("=", 1)
|
|
1293
|
+
initial_state[k] = v
|
|
1313
1294
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1295
|
+
# Resolve agent by name
|
|
1296
|
+
target = args.agent
|
|
1297
|
+
workflows = api.req("GET", f"{server}/workflows", json_h)
|
|
1317
1298
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1299
|
+
# Filter by project if given
|
|
1300
|
+
if args.project:
|
|
1301
|
+
projects = api.req("GET", f"{server}/workspaces/{workspace_id}/projects", json_h)
|
|
1302
|
+
proj = next((p for p in projects if p["name"].lower() == args.project.lower()), None)
|
|
1303
|
+
if not proj:
|
|
1304
|
+
print(f"{RED}Project '{args.project}' not found.{RESET}")
|
|
1305
|
+
sys.exit(1)
|
|
1306
|
+
workflows = [w for w in workflows if w.get("project_id") == proj["id"]]
|
|
1321
1307
|
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
print(f"{CYAN} ── Issue #{issue['number']}: {issue['title']}{RESET}")
|
|
1327
|
-
state = _build_state(issue, repo)
|
|
1328
|
-
|
|
1329
|
-
max_turns = None
|
|
1330
|
-
try:
|
|
1331
|
-
pf = api.req("POST", f"{server}/workflows/{workflow_id}/preflight", json_h, {
|
|
1332
|
-
"issue_title": issue["title"],
|
|
1333
|
-
"issue_body": issue.get("body") or "",
|
|
1334
|
-
})
|
|
1335
|
-
suggested = pf.get("suggested_max_turns", 20)
|
|
1336
|
-
if suggested > 20:
|
|
1337
|
-
print(f"{GRAY} ⚠ estimated {suggested} turns — bumping max_turns{RESET}")
|
|
1338
|
-
max_turns = suggested
|
|
1339
|
-
except Exception:
|
|
1340
|
-
pass
|
|
1341
|
-
|
|
1342
|
-
payload = {"triggered_by": f"cli:issue#{issue['number']}", "initial_state": state}
|
|
1343
|
-
if max_turns:
|
|
1344
|
-
payload["max_turns"] = max_turns
|
|
1345
|
-
run = api.req("POST", f"{server}/workflows/{workflow_id}/runs", json_h, payload)
|
|
1346
|
-
ok = _stream_run(server, workflow_id, run["id"], workspace_id, token, api_key)
|
|
1347
|
-
passed += ok
|
|
1348
|
-
failed += not ok
|
|
1349
|
-
print()
|
|
1308
|
+
wf = next((w for w in workflows if w["name"].lower() == target.lower()), None)
|
|
1309
|
+
if not wf:
|
|
1310
|
+
print(f"{RED}Agent '{target}' not found. Run 'conduct agents' to list agents.{RESET}")
|
|
1311
|
+
sys.exit(1)
|
|
1350
1312
|
|
|
1351
|
-
|
|
1313
|
+
workflow_id = wf["id"]
|
|
1314
|
+
print(f"\n{BOLD}▶ conduct run — {wf['name']}{RESET}")
|
|
1315
|
+
if initial_state:
|
|
1316
|
+
for k, v in initial_state.items():
|
|
1317
|
+
print(f" {GRAY}{k}={v}{RESET}")
|
|
1318
|
+
print()
|
|
1352
1319
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
_stream_run(server, workflow_id, run["id"], workspace_id, token)
|
|
1320
|
+
run = api.req("POST", f"{server}/workflows/{workflow_id}/runs", json_h, {
|
|
1321
|
+
"triggered_by": "cli",
|
|
1322
|
+
"initial_state": initial_state,
|
|
1323
|
+
})
|
|
1324
|
+
_stream_run(server, workflow_id, run["id"], workspace_id, token, api_key)
|
|
1359
1325
|
|
|
1360
1326
|
|
|
1361
1327
|
# ── Entry point ───────────────────────────────────────────────────────────────
|
|
@@ -1458,8 +1424,10 @@ def main():
|
|
|
1458
1424
|
help="Input value applied to all playbooks (repeatable)")
|
|
1459
1425
|
|
|
1460
1426
|
# conduct run (existing)
|
|
1461
|
-
run_p = sub.add_parser("run", help="Run
|
|
1462
|
-
run_p.add_argument("
|
|
1427
|
+
run_p = sub.add_parser("run", help="Run an installed agent by name")
|
|
1428
|
+
run_p.add_argument("agent", help="Agent name (e.g. 'security_autopilot_fix')")
|
|
1429
|
+
run_p.add_argument("--project", metavar="name", help="Narrow to a specific project")
|
|
1430
|
+
run_p.add_argument("--input", action="append", metavar="key=value", help="Runtime input (repeatable)")
|
|
1463
1431
|
|
|
1464
1432
|
# conduct guard
|
|
1465
1433
|
guard_p, _guard_sub = _guard.register_guard_parser(sub)
|
|
@@ -1487,7 +1455,8 @@ def main():
|
|
|
1487
1455
|
elif args.command == "projects":
|
|
1488
1456
|
cmd_projects(args)
|
|
1489
1457
|
elif args.command == "create":
|
|
1490
|
-
|
|
1458
|
+
create_args = getattr(args, "create_args", None)
|
|
1459
|
+
if create_args:
|
|
1491
1460
|
cmd_create(args)
|
|
1492
1461
|
else:
|
|
1493
1462
|
create_p.print_help()
|
|
@@ -1496,7 +1465,8 @@ def main():
|
|
|
1496
1465
|
elif args.command == "install":
|
|
1497
1466
|
cmd_install(args)
|
|
1498
1467
|
elif args.command == "delete":
|
|
1499
|
-
|
|
1468
|
+
delete_args = getattr(args, "delete_args", None)
|
|
1469
|
+
if delete_args:
|
|
1500
1470
|
cmd_delete(args)
|
|
1501
1471
|
else:
|
|
1502
1472
|
delete_p.print_help()
|
|
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
|