glaip-sdk 0.4.0__py3-none-any.whl → 0.5.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.
- glaip_sdk/cli/account_store.py +522 -0
- glaip_sdk/cli/auth.py +222 -7
- glaip_sdk/cli/commands/accounts.py +414 -0
- glaip_sdk/cli/commands/agents.py +2 -2
- glaip_sdk/cli/commands/common_config.py +65 -0
- glaip_sdk/cli/commands/configure.py +153 -88
- glaip_sdk/cli/commands/transcripts.py +1 -1
- glaip_sdk/cli/config.py +31 -3
- glaip_sdk/cli/display.py +1 -1
- glaip_sdk/cli/hints.py +0 -1
- glaip_sdk/cli/main.py +180 -79
- glaip_sdk/cli/masking.py +14 -1
- glaip_sdk/cli/slash/agent_session.py +1 -1
- glaip_sdk/cli/slash/remote_runs_controller.py +1 -1
- glaip_sdk/cli/slash/session.py +11 -9
- glaip_sdk/cli/slash/tui/remote_runs_app.py +2 -3
- glaip_sdk/cli/transcript/capture.py +11 -17
- glaip_sdk/cli/utils.py +33 -30
- {glaip_sdk-0.4.0.dist-info → glaip_sdk-0.5.0.dist-info}/METADATA +1 -1
- {glaip_sdk-0.4.0.dist-info → glaip_sdk-0.5.0.dist-info}/RECORD +22 -19
- {glaip_sdk-0.4.0.dist-info → glaip_sdk-0.5.0.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.4.0.dist-info → glaip_sdk-0.5.0.dist-info}/entry_points.txt +0 -0
glaip_sdk/cli/utils.py
CHANGED
|
@@ -30,6 +30,7 @@ from glaip_sdk.branding import (
|
|
|
30
30
|
SUCCESS_STYLE,
|
|
31
31
|
WARNING_STYLE,
|
|
32
32
|
)
|
|
33
|
+
from glaip_sdk.cli import display as cli_display
|
|
33
34
|
from glaip_sdk.cli import masking, pager
|
|
34
35
|
from glaip_sdk.cli.config import load_config
|
|
35
36
|
from glaip_sdk.cli.constants import LITERAL_STRING_THRESHOLD, TABLE_SORT_ENABLED
|
|
@@ -40,7 +41,6 @@ from glaip_sdk.cli.context import (
|
|
|
40
41
|
from glaip_sdk.cli.context import (
|
|
41
42
|
detect_export_format as _detect_export_format,
|
|
42
43
|
)
|
|
43
|
-
from glaip_sdk.cli import display as cli_display
|
|
44
44
|
from glaip_sdk.cli.hints import command_hint
|
|
45
45
|
from glaip_sdk.cli.io import export_resource_to_file_with_validation
|
|
46
46
|
from glaip_sdk.cli.rich_helpers import markup_text, print_markup
|
|
@@ -548,45 +548,48 @@ _spinner_stop = stop_spinner
|
|
|
548
548
|
|
|
549
549
|
|
|
550
550
|
def get_client(ctx: Any) -> Client: # pragma: no cover
|
|
551
|
-
"""Get configured client from context
|
|
551
|
+
"""Get configured client from context and account store (ctx > account)."""
|
|
552
|
+
# Import here to avoid circular import
|
|
553
|
+
from glaip_sdk.cli.auth import resolve_credentials # noqa: PLC0415
|
|
554
|
+
|
|
552
555
|
module = importlib.import_module("glaip_sdk")
|
|
553
556
|
client_class = cast("type[Client]", module.Client)
|
|
554
|
-
file_config = load_config() or {}
|
|
555
557
|
context_config_obj = getattr(ctx, "obj", None)
|
|
556
558
|
context_config = context_config_obj or {}
|
|
557
559
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
env_config = {
|
|
565
|
-
"api_url": os.getenv("AIP_API_URL"),
|
|
566
|
-
"api_key": os.getenv("AIP_API_KEY"),
|
|
567
|
-
"timeout": timeout_value if timeout_value else None,
|
|
568
|
-
}
|
|
569
|
-
env_config = {k: v for k, v in env_config.items() if v not in (None, "", 0)}
|
|
570
|
-
|
|
571
|
-
# Merge config sources: context > env > file
|
|
572
|
-
config = {
|
|
573
|
-
**file_config,
|
|
574
|
-
**env_config,
|
|
575
|
-
**{k: v for k, v in context_config.items() if v is not None},
|
|
576
|
-
}
|
|
560
|
+
account_name = context_config.get("account_name")
|
|
561
|
+
api_url, api_key, _ = resolve_credentials(
|
|
562
|
+
account_name=account_name,
|
|
563
|
+
api_url=context_config.get("api_url"),
|
|
564
|
+
api_key=context_config.get("api_key"),
|
|
565
|
+
)
|
|
577
566
|
|
|
578
|
-
if not
|
|
579
|
-
configure_hint = command_hint("
|
|
580
|
-
actions = []
|
|
567
|
+
if not api_url or not api_key:
|
|
568
|
+
configure_hint = command_hint("accounts add", slash_command="login", ctx=ctx)
|
|
569
|
+
actions: list[str] = []
|
|
581
570
|
if configure_hint:
|
|
582
|
-
actions.append(f"Run `{configure_hint}`")
|
|
583
|
-
|
|
571
|
+
actions.append(f"Run `{configure_hint}` to add an account profile")
|
|
572
|
+
else:
|
|
573
|
+
actions.append("add an account with 'aip accounts add'")
|
|
584
574
|
raise click.ClickException(f"Missing api_url/api_key. {' or '.join(actions)}.")
|
|
585
575
|
|
|
576
|
+
# Get timeout from context or config
|
|
577
|
+
timeout = context_config.get("timeout")
|
|
578
|
+
if timeout is None:
|
|
579
|
+
raw_timeout = os.getenv("AIP_TIMEOUT", "0") or "0"
|
|
580
|
+
try:
|
|
581
|
+
timeout = float(raw_timeout) if raw_timeout != "0" else None
|
|
582
|
+
except ValueError:
|
|
583
|
+
timeout = None
|
|
584
|
+
if timeout is None:
|
|
585
|
+
# Fallback to legacy config
|
|
586
|
+
file_config = load_config() or {}
|
|
587
|
+
timeout = file_config.get("timeout")
|
|
588
|
+
|
|
586
589
|
return client_class(
|
|
587
|
-
api_url=
|
|
588
|
-
api_key=
|
|
589
|
-
timeout=float(
|
|
590
|
+
api_url=api_url,
|
|
591
|
+
api_key=api_key,
|
|
592
|
+
timeout=float(timeout or 30.0),
|
|
590
593
|
)
|
|
591
594
|
|
|
592
595
|
|
|
@@ -2,24 +2,27 @@ glaip_sdk/__init__.py,sha256=7ICOkPeiwQGkadqxIgJXOYPHcJOHYRIF_GU0xkjOtSE,366
|
|
|
2
2
|
glaip_sdk/_version.py,sha256=5CHGCxx_36fgmMWuEx6jJ2CzzM-i9eBFyQWFwBi23XE,2259
|
|
3
3
|
glaip_sdk/branding.py,sha256=tLqYCIHMkUf8p2smpuAGNptwaKUN38G4mlh0A0DOl_w,7823
|
|
4
4
|
glaip_sdk/cli/__init__.py,sha256=xCCfuF1Yc7mpCDcfhHZTX0vizvtrDSLeT8MJ3V7m5A0,156
|
|
5
|
+
glaip_sdk/cli/account_store.py,sha256=NXuAVPaJS_32Aw1VTaZCNwIID-gADw4F_UMieoWmg3g,17336
|
|
5
6
|
glaip_sdk/cli/agent_config.py,sha256=YAbFKrTNTRqNA6b0i0Q3pH-01rhHDRi5v8dxSFwGSwM,2401
|
|
6
|
-
glaip_sdk/cli/auth.py,sha256=
|
|
7
|
+
glaip_sdk/cli/auth.py,sha256=ycT6CepbJDfUqRT0KBYXfBhnJYd-zJ_np1-DSiY3EWs,23040
|
|
7
8
|
glaip_sdk/cli/commands/__init__.py,sha256=6Z3ASXDut0lAbUX_umBFtxPzzFyqoiZfVeTahThFu1A,219
|
|
8
|
-
glaip_sdk/cli/commands/
|
|
9
|
-
glaip_sdk/cli/commands/
|
|
9
|
+
glaip_sdk/cli/commands/accounts.py,sha256=VCG-JZGY86DlWO5bAfDZ70RuyKQ5q-Rh4U0iM8NwO6M,13755
|
|
10
|
+
glaip_sdk/cli/commands/agents.py,sha256=CGYWTPpcFXUms_3SMB5Mr-YRpBh7c8iu-Mj245XhSCc,47686
|
|
11
|
+
glaip_sdk/cli/commands/common_config.py,sha256=IY13gPkeifXxSdpzRFUvfRin8J7s38p6Y7TYjdGw7w4,2474
|
|
12
|
+
glaip_sdk/cli/commands/configure.py,sha256=8vfgtNEMK2lnEk3i6H1ZevsjxnYA6jAj4evhWmsHi6w,14494
|
|
10
13
|
glaip_sdk/cli/commands/mcps.py,sha256=tttqQnfM89iI9Pm94u8YRhiHMQNYNouecFX0brsT4cQ,42551
|
|
11
14
|
glaip_sdk/cli/commands/models.py,sha256=vfcGprK5CHprQ0CNpNzQlNNTELvdgKC7JxTG_ijOwmE,2009
|
|
12
15
|
glaip_sdk/cli/commands/tools.py,sha256=7_RMTuTI1Guu7psClovbyt2umfk4rkp7jSW19GXKA44,18440
|
|
13
|
-
glaip_sdk/cli/commands/transcripts.py,sha256=
|
|
16
|
+
glaip_sdk/cli/commands/transcripts.py,sha256=ofxZLus1xLB061NxrLo1J6LPEb2VIxJTjmz7hLKgPmc,26377
|
|
14
17
|
glaip_sdk/cli/commands/update.py,sha256=rIZo_x-tvpvcwpQLpwYwso1ix6qTHuNNTL4egmn5fEM,1812
|
|
15
|
-
glaip_sdk/cli/config.py,sha256=
|
|
18
|
+
glaip_sdk/cli/config.py,sha256=_UU7pljAhgzwKLx7Yqp2_ibiInR-dHuykC_UWL51BHc,2310
|
|
16
19
|
glaip_sdk/cli/constants.py,sha256=zqcVtzfj6huW97gbCmhkFqntge1H-c1vnkGqTazADgU,895
|
|
17
20
|
glaip_sdk/cli/context.py,sha256=--Y5vc6lgoAV7cRoUAr9UxSQaLmkMg29FolA7EwoRqM,3803
|
|
18
|
-
glaip_sdk/cli/display.py,sha256=
|
|
19
|
-
glaip_sdk/cli/hints.py,sha256=
|
|
21
|
+
glaip_sdk/cli/display.py,sha256=ojgWdGeD5KUnGOmWNqqK4JP-1EaWHWX--DWze3BmIz0,12137
|
|
22
|
+
glaip_sdk/cli/hints.py,sha256=ca4krG103IS43s5BSLr0-N7uRMpte1_LY4nAXVvgDxo,1596
|
|
20
23
|
glaip_sdk/cli/io.py,sha256=ChP6CRKbtuENsNomNEaMDfPDU0iqO-WuVvl4_y7F2io,3871
|
|
21
|
-
glaip_sdk/cli/main.py,sha256=
|
|
22
|
-
glaip_sdk/cli/masking.py,sha256=
|
|
24
|
+
glaip_sdk/cli/main.py,sha256=vWbx7nQBX2ZeMkNFFY2PA2Hr5vyr6-lOyx2ixzJeay0,20974
|
|
25
|
+
glaip_sdk/cli/masking.py,sha256=2lrXQ-pfL7N-vNEQRT1s4Xq3JPDPDT8RC61OdaTtkkc,4060
|
|
23
26
|
glaip_sdk/cli/mcp_validators.py,sha256=cwbz7p_p7_9xVuuF96OBQOdmEgo5UObU6iWWQ2X03PI,10047
|
|
24
27
|
glaip_sdk/cli/pager.py,sha256=XygkAB6UW3bte7I4KmK7-PUGCJiq2Pv-4-MfyXAmXCw,7925
|
|
25
28
|
glaip_sdk/cli/parsers/__init__.py,sha256=NzLrSH6GOdNoewXtKNpB6GwrauA8rb_IGYV6cz5Hn3o,113
|
|
@@ -27,21 +30,21 @@ glaip_sdk/cli/parsers/json_input.py,sha256=kxoxeIlgfsaH2jhe6apZAgSxAtwlpSINLTMRs
|
|
|
27
30
|
glaip_sdk/cli/resolution.py,sha256=K-VaEHm9SYY_qfb9538VNHykL4_2N6F8iQqI1zMx_64,2402
|
|
28
31
|
glaip_sdk/cli/rich_helpers.py,sha256=kO47N8e506rxrN6Oc9mbAWN3Qb536oQPWZy1s9A616g,819
|
|
29
32
|
glaip_sdk/cli/slash/__init__.py,sha256=J9TPL2UcNTkW8eifG6nRmAEGHhyEgdYMYk4cHaaObC0,386
|
|
30
|
-
glaip_sdk/cli/slash/agent_session.py,sha256=
|
|
33
|
+
glaip_sdk/cli/slash/agent_session.py,sha256=9r1xNRk5mk6rfJXV6KIf2Yo4B4hjknimd9fkxH1LO3c,11304
|
|
31
34
|
glaip_sdk/cli/slash/prompt.py,sha256=2urqR3QqN3O09lHmKKSEbhsIdlS4B7hm9O8AP_VwCSU,8034
|
|
32
|
-
glaip_sdk/cli/slash/remote_runs_controller.py,sha256=
|
|
33
|
-
glaip_sdk/cli/slash/session.py,sha256=
|
|
35
|
+
glaip_sdk/cli/slash/remote_runs_controller.py,sha256=Ok6CezIeF1CPGQ8-QN3TRx5kGGEACOrgyPwH_BRRCyI,21354
|
|
36
|
+
glaip_sdk/cli/slash/session.py,sha256=GvdpLri_TzuaWDEWHdfAIbdOjMf7MUGewxpEtW_5hPk,57642
|
|
34
37
|
glaip_sdk/cli/slash/tui/__init__.py,sha256=ljBAeAFY2qNDkbJrZh5NgXxjwUlsv9-UxgKNIv0AF1Q,274
|
|
35
|
-
glaip_sdk/cli/slash/tui/remote_runs_app.py,sha256=
|
|
38
|
+
glaip_sdk/cli/slash/tui/remote_runs_app.py,sha256=YAtBtgjtzIy5y2NVOQexZX783DJpqFUkwAVYkVn1tSo,24762
|
|
36
39
|
glaip_sdk/cli/transcript/__init__.py,sha256=yiYHyNtebMCu3BXu56Xm5RBC2tDc865q8UGPnoe6QRs,920
|
|
37
40
|
glaip_sdk/cli/transcript/cache.py,sha256=Wi1uln6HP1U6F-MRTrfnxi9bn6XJTxwWXhREIRPoMqQ,17439
|
|
38
|
-
glaip_sdk/cli/transcript/capture.py,sha256=
|
|
41
|
+
glaip_sdk/cli/transcript/capture.py,sha256=t8j_62cC6rhb51oCluZd17N04vcXqyjkhPRcRd3ZcmM,10291
|
|
39
42
|
glaip_sdk/cli/transcript/export.py,sha256=reCvrZVzli8_LzYe5ZNdaa-MwZ1ov2RjnDzKZWr_6-E,1117
|
|
40
43
|
glaip_sdk/cli/transcript/history.py,sha256=2FBjawxP8CX9gRPMUMP8bDjG50BGM2j2zk6IfHvAMH4,26211
|
|
41
44
|
glaip_sdk/cli/transcript/launcher.py,sha256=z5ivkPXDQJpATIqtRLUK8jH3p3WIZ72PvOPqYRDMJvw,2327
|
|
42
45
|
glaip_sdk/cli/transcript/viewer.py,sha256=ar1SzRkhKIf3_DgFz1EG1RZGDmd2w2wogAe038DLL_M,13037
|
|
43
46
|
glaip_sdk/cli/update_notifier.py,sha256=qv-GfwTYZdrhlSbC_71I1AvKY9cV4QVBmtees16S2Xg,9807
|
|
44
|
-
glaip_sdk/cli/utils.py,sha256=
|
|
47
|
+
glaip_sdk/cli/utils.py,sha256=Dtvi8mkrU3v88ZO2HwHL2iuzY8Ic3PTDL0YySWsvy0Q,53510
|
|
45
48
|
glaip_sdk/cli/validators.py,sha256=d-kq4y7HWMo6Gc7wLXWUsCt8JwFvJX_roZqRm1Nko1I,5622
|
|
46
49
|
glaip_sdk/client/__init__.py,sha256=F-eE_dRSzA0cc1it06oi0tZetZBHmSUjWSHGhJMLCls,263
|
|
47
50
|
glaip_sdk/client/_agent_payloads.py,sha256=VfBHoijuoqUOixGBf2SA2vlQIXQmBsjB3sXHZhXYiec,17681
|
|
@@ -104,7 +107,7 @@ glaip_sdk/utils/resource_refs.py,sha256=vF34kyAtFBLnaKnQVrsr2st1JiSxVbIZ4yq0DelJ
|
|
|
104
107
|
glaip_sdk/utils/run_renderer.py,sha256=d_VMI6LbvHPUUeRmGqh5wK_lHqDEIAcym2iqpbtDad0,1365
|
|
105
108
|
glaip_sdk/utils/serialization.py,sha256=z-qpvWLSBrGK3wbUclcA1UIKLXJedTnMSwPdq-FF4lo,13308
|
|
106
109
|
glaip_sdk/utils/validation.py,sha256=Vt8oSnn7OM6ns5vjOl5FwGIMWBPb0yI6RD5XL_L5_4M,6826
|
|
107
|
-
glaip_sdk-0.
|
|
108
|
-
glaip_sdk-0.
|
|
109
|
-
glaip_sdk-0.
|
|
110
|
-
glaip_sdk-0.
|
|
110
|
+
glaip_sdk-0.5.0.dist-info/METADATA,sha256=869wDTHn4xaN_DBTqmlZG7bQ7UXzKuhqGp1Mx_umkV8,7053
|
|
111
|
+
glaip_sdk-0.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
112
|
+
glaip_sdk-0.5.0.dist-info/entry_points.txt,sha256=EGs8NO8J1fdFMWA3CsF7sKBEvtHb_fujdCoNPhfMouE,47
|
|
113
|
+
glaip_sdk-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|