langstage-cli 0.5.0__tar.gz → 0.5.2__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.
- {langstage_cli-0.5.0/langstage_cli.egg-info → langstage_cli-0.5.2}/PKG-INFO +2 -2
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli/cli.py +30 -15
- {langstage_cli-0.5.0 → langstage_cli-0.5.2/langstage_cli.egg-info}/PKG-INFO +2 -2
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli.egg-info/SOURCES.txt +2 -1
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli.egg-info/requires.txt +1 -1
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/pyproject.toml +6 -2
- langstage_cli-0.5.2/tests/test_show_config.py +47 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/LICENSE +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/README.md +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/deepagent_code/__init__.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli/__init__.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli/config.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli.egg-info/dependency_links.txt +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli.egg-info/entry_points.txt +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/langstage_cli.egg-info/top_level.txt +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/setup.cfg +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/tests/test_cli.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/tests/test_codeconfig.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/tests/test_config.py +0 -0
- {langstage_cli-0.5.0 → langstage_cli-0.5.2}/tests/test_rename_shim.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langstage-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: The terminal stage for your LangGraph agent — Claude Code-style CLI for any CompiledGraph
|
|
5
5
|
Author-email: Kedar Dabhadkar <kdabhadk@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,13 +22,13 @@ Requires-Dist: langgraph>=0.2.0
|
|
|
22
22
|
Requires-Dist: langgraph-stream-parser<0.5,>=0.3
|
|
23
23
|
Requires-Dist: click>=8.0.0
|
|
24
24
|
Requires-Dist: python-dotenv
|
|
25
|
-
Requires-Dist: deepagents
|
|
26
25
|
Provides-Extra: dev
|
|
27
26
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
27
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
29
28
|
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
30
29
|
Requires-Dist: ruff==0.15.15; extra == "dev"
|
|
31
30
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: deepagents>=0.3; extra == "dev"
|
|
32
32
|
Provides-Extra: agui
|
|
33
33
|
Requires-Dist: langgraph-stream-parser[agui]<0.5,>=0.4; extra == "agui"
|
|
34
34
|
Dynamic: license-file
|
|
@@ -12,6 +12,7 @@ import sys
|
|
|
12
12
|
import threading
|
|
13
13
|
import time
|
|
14
14
|
import uuid
|
|
15
|
+
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import Any, Dict, List, Optional, Tuple
|
|
17
18
|
|
|
@@ -56,8 +57,11 @@ BRIGHT_GREEN, BRIGHT_YELLOW = "\033[92m", "\033[93m"
|
|
|
56
57
|
SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
# Version info
|
|
60
|
-
|
|
60
|
+
# Version info — read from package metadata so it never drifts from pyproject.
|
|
61
|
+
try:
|
|
62
|
+
__version__ = _pkg_version("langstage-cli")
|
|
63
|
+
except PackageNotFoundError: # pragma: no cover - editable/source checkout
|
|
64
|
+
__version__ = "0.0.0+local"
|
|
61
65
|
|
|
62
66
|
|
|
63
67
|
# Slash command registry
|
|
@@ -1397,10 +1401,6 @@ def main(
|
|
|
1397
1401
|
langstage-cli --demo "try it with no API key"
|
|
1398
1402
|
langstage-cli --show-config
|
|
1399
1403
|
"""
|
|
1400
|
-
if show_config:
|
|
1401
|
-
print(config_module.CodeConfig.resolve(toml_start=Path.cwd()).describe())
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1404
1404
|
if demo:
|
|
1405
1405
|
if agent_spec:
|
|
1406
1406
|
print(f"{RED}⏺ Error: --demo and -a/--agent are mutually exclusive{RESET}")
|
|
@@ -1408,6 +1408,29 @@ def main(
|
|
|
1408
1408
|
# The keyless echo agent shipped with the shared core.
|
|
1409
1409
|
agent_spec = "langgraph_stream_parser.demo.stub:graph"
|
|
1410
1410
|
|
|
1411
|
+
# CLI flags are the highest-precedence config layer. Build the override dict
|
|
1412
|
+
# ONCE and use it for both --show-config and the real run, so the diagnostic
|
|
1413
|
+
# reflects exactly what a run resolves (CLI-set values then show as
|
|
1414
|
+
# `[override]`, not `[default]`). Resolving --show-config without these was
|
|
1415
|
+
# the bug in #20.
|
|
1416
|
+
cli_overrides = {
|
|
1417
|
+
"agent_spec": agent_spec,
|
|
1418
|
+
"graph_name": graph_name,
|
|
1419
|
+
"stream_mode": stream_mode,
|
|
1420
|
+
# bool flags only override when actually passed; otherwise fall back to
|
|
1421
|
+
# TOML/env/default.
|
|
1422
|
+
"async_mode": True if use_async else None,
|
|
1423
|
+
"verbose": True if verbose else None,
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
if show_config:
|
|
1427
|
+
print(
|
|
1428
|
+
config_module.CodeConfig.resolve(
|
|
1429
|
+
toml_start=Path.cwd(), overrides=cli_overrides
|
|
1430
|
+
).describe()
|
|
1431
|
+
)
|
|
1432
|
+
return
|
|
1433
|
+
|
|
1411
1434
|
try:
|
|
1412
1435
|
# Handle -f/--file option: read message from file
|
|
1413
1436
|
if prompt_file and message:
|
|
@@ -1437,15 +1460,7 @@ def main(
|
|
|
1437
1460
|
# (DEEPAGENT_AGENT_SPEC is canonical; DEEPAGENT_SPEC is a deprecated alias.)
|
|
1438
1461
|
cfg = config_module.CodeConfig.resolve(
|
|
1439
1462
|
toml_start=Path.cwd(),
|
|
1440
|
-
overrides=
|
|
1441
|
-
"agent_spec": agent_spec,
|
|
1442
|
-
"graph_name": graph_name,
|
|
1443
|
-
"stream_mode": stream_mode,
|
|
1444
|
-
# bool flags only override when actually passed; otherwise fall
|
|
1445
|
-
# back to TOML/env/default.
|
|
1446
|
-
"async_mode": True if use_async else None,
|
|
1447
|
-
"verbose": True if verbose else None,
|
|
1448
|
-
},
|
|
1463
|
+
overrides=cli_overrides,
|
|
1449
1464
|
)
|
|
1450
1465
|
final_spec = cfg.agent_spec
|
|
1451
1466
|
final_graph_name_default = cfg.graph_name
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langstage-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: The terminal stage for your LangGraph agent — Claude Code-style CLI for any CompiledGraph
|
|
5
5
|
Author-email: Kedar Dabhadkar <kdabhadk@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,13 +22,13 @@ Requires-Dist: langgraph>=0.2.0
|
|
|
22
22
|
Requires-Dist: langgraph-stream-parser<0.5,>=0.3
|
|
23
23
|
Requires-Dist: click>=8.0.0
|
|
24
24
|
Requires-Dist: python-dotenv
|
|
25
|
-
Requires-Dist: deepagents
|
|
26
25
|
Provides-Extra: dev
|
|
27
26
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
27
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
29
28
|
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
30
29
|
Requires-Dist: ruff==0.15.15; extra == "dev"
|
|
31
30
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: deepagents>=0.3; extra == "dev"
|
|
32
32
|
Provides-Extra: agui
|
|
33
33
|
Requires-Dist: langgraph-stream-parser[agui]<0.5,>=0.4; extra == "agui"
|
|
34
34
|
Dynamic: license-file
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langstage-cli"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.2"
|
|
8
8
|
description = "The terminal stage for your LangGraph agent — Claude Code-style CLI for any CompiledGraph"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -28,7 +28,6 @@ dependencies = [
|
|
|
28
28
|
"langgraph-stream-parser>=0.3,<0.5",
|
|
29
29
|
"click>=8.0.0",
|
|
30
30
|
"python-dotenv",
|
|
31
|
-
"deepagents",
|
|
32
31
|
]
|
|
33
32
|
|
|
34
33
|
[project.optional-dependencies]
|
|
@@ -38,6 +37,11 @@ dev = [
|
|
|
38
37
|
"black>=23.0.0",
|
|
39
38
|
"ruff==0.15.15",
|
|
40
39
|
"mypy>=1.0.0",
|
|
40
|
+
# Only the bundled `examples/agent.py` (a dev sample, not shipped in the
|
|
41
|
+
# wheel) uses deepagents — the CLI itself never imports it. Keep it here so
|
|
42
|
+
# the example/tests run, but don't make every `pip install langstage-cli`
|
|
43
|
+
# pull deepagents + langchain + langgraph.
|
|
44
|
+
"deepagents>=0.3",
|
|
41
45
|
]
|
|
42
46
|
agui = ["langgraph-stream-parser[agui]>=0.4,<0.5"]
|
|
43
47
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Regression tests for #20: `--show-config` must reflect CLI flags.
|
|
2
|
+
|
|
3
|
+
Before the fix, the --show-config branch resolved config WITHOUT the CLI
|
|
4
|
+
overrides, so flags showed as `[default]` and the reported source could
|
|
5
|
+
contradict the real run.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import re
|
|
9
|
+
|
|
10
|
+
from click.testing import CliRunner
|
|
11
|
+
|
|
12
|
+
from langstage_cli.cli import main
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_show_config_reflects_cli_flags():
|
|
16
|
+
with CliRunner().isolated_filesystem(): # no stray toml
|
|
17
|
+
r = CliRunner().invoke(
|
|
18
|
+
main, ["-a", "fromcli.py:graph", "-v", "--stream-mode", "values", "--show-config"]
|
|
19
|
+
)
|
|
20
|
+
assert r.exit_code == 0, r.output
|
|
21
|
+
# CLI-set values appear with the [override] source, not [default].
|
|
22
|
+
assert re.search(r"agent_spec\s*=\s*fromcli\.py:graph\s*\[override\]", r.output), r.output
|
|
23
|
+
assert re.search(r"stream_mode\s*=\s*values\s*\[override\]", r.output), r.output
|
|
24
|
+
assert re.search(r"verbose\s*=\s*True\s*\[override\]", r.output), r.output
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_show_config_cli_flag_beats_env():
|
|
28
|
+
with CliRunner().isolated_filesystem():
|
|
29
|
+
r = CliRunner().invoke(
|
|
30
|
+
main,
|
|
31
|
+
["-a", "fromcli.py:graph", "--show-config"],
|
|
32
|
+
env={"LANGSTAGE_AGENT_SPEC": "fromenv.py:graph"},
|
|
33
|
+
)
|
|
34
|
+
assert r.exit_code == 0, r.output
|
|
35
|
+
# the CLI flag wins (matches what a real run does), not the env var
|
|
36
|
+
assert re.search(r"agent_spec\s*=\s*fromcli\.py:graph\s*\[override\]", r.output), r.output
|
|
37
|
+
assert "fromenv.py:graph" not in r.output.split("agent_spec")[1].split("\n")[0]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_show_config_without_flags_still_reports_env():
|
|
41
|
+
with CliRunner().isolated_filesystem():
|
|
42
|
+
r = CliRunner().invoke(
|
|
43
|
+
main, ["--show-config"], env={"LANGSTAGE_AGENT_SPEC": "fromenv.py:graph"}
|
|
44
|
+
)
|
|
45
|
+
assert r.exit_code == 0, r.output
|
|
46
|
+
# no flags → env is correctly the winning source (no regression)
|
|
47
|
+
assert re.search(r"agent_spec\s*=\s*fromenv\.py:graph\s*\[env:", r.output), r.output
|
|
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
|