langstage-cli 0.6.52__tar.gz → 0.6.53__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.6.52/langstage_cli.egg-info → langstage_cli-0.6.53}/PKG-INFO +4 -2
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/README.md +3 -1
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/cli.py +27 -1
- {langstage_cli-0.6.52 → langstage_cli-0.6.53/langstage_cli.egg-info}/PKG-INFO +4 -2
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/pyproject.toml +1 -1
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_advertised_wave4.py +57 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/LICENSE +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/deepagent_code/__init__.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/__init__.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/agui_stream.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/config.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/exit_codes.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli/sessions.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli.egg-info/SOURCES.txt +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli.egg-info/dependency_links.txt +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli.egg-info/entry_points.txt +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli.egg-info/requires.txt +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/langstage_cli.egg-info/top_level.txt +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/setup.cfg +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_agui_stream.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_approval_menu_abort.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_async_mode.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_checkpointer.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_cli.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_cli_help.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_codeconfig.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_config.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_config_command.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_configurable.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_ctrl_c_sync_tool.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_custom_decision_195.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_deferred_pass.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_dumb_term.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_exit_codes.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_generic_interrupt.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_help_render.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_hidden_option_suggestions.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_history_persist.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_hitl_approval_preview.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_hitl_resume_warning.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_init.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_interrupt_non_tty.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_legacy_config_home.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_load_error.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_menu_allowed_197.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_message_boundaries.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_no_color.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_no_interactive_approve.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_no_persist_resume.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_paused_session_message.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_persist_env.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_quiet_output.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_reasoning_render.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_rename_shim.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_render_markdown.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_routine_1024.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_session_lifecycle.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_sessions.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_show_config.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_show_config_malformed.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_spec_loading_core.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_spec_resolution.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_spinner_reply_survives.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_stdin_interactive.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_stdin_single_shot.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_stream_mode.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_streaming_marker.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_terminal_width.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_toml_relative_paths.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_tool_card_args.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_tool_output_escape.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_turn_error_verbose.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_turn_exit_and_render.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_unicode_console.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_usage_hint_186.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_verbose_command.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_verify_flag.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_workspace.py +0 -0
- {langstage_cli-0.6.52 → langstage_cli-0.6.53}/tests/test_wrong_type_graph.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langstage-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.53
|
|
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
|
|
@@ -355,7 +355,9 @@ the reply it renders is the graph's `messages` channel. A graph whose state has
|
|
|
355
355
|
the CLI prints its final state as JSON, with a note on stderr. To drive such a graph from
|
|
356
356
|
the CLI, give it a `messages` channel, or a first node that copies the last message into
|
|
357
357
|
`query`. `--verify` gives the same verdict as a run: it passes a turn that ends with
|
|
358
|
-
final state to show, and fails a turn with no message and no state (exit 1).
|
|
358
|
+
final state to show, and fails a turn with no message and no state (exit 1). Its probe
|
|
359
|
+
turn gets the same `[configurable]` keys from `langstage.toml` a run does, on a fresh
|
|
360
|
+
thread (a pinned `thread_id` is ignored).
|
|
359
361
|
|
|
360
362
|
A spec's inline `:name` (`app.py:prod`) wins over `-g` / `[agent] graph_name`;
|
|
361
363
|
`--show-config` reports the graph that runs, and a run notes the ignored name.
|
|
@@ -317,7 +317,9 @@ the reply it renders is the graph's `messages` channel. A graph whose state has
|
|
|
317
317
|
the CLI prints its final state as JSON, with a note on stderr. To drive such a graph from
|
|
318
318
|
the CLI, give it a `messages` channel, or a first node that copies the last message into
|
|
319
319
|
`query`. `--verify` gives the same verdict as a run: it passes a turn that ends with
|
|
320
|
-
final state to show, and fails a turn with no message and no state (exit 1).
|
|
320
|
+
final state to show, and fails a turn with no message and no state (exit 1). Its probe
|
|
321
|
+
turn gets the same `[configurable]` keys from `langstage.toml` a run does, on a fresh
|
|
322
|
+
thread (a pinned `thread_id` is ignored).
|
|
321
323
|
|
|
322
324
|
A spec's inline `:name` (`app.py:prod`) wins over `-g` / `[agent] graph_name`;
|
|
323
325
|
`--show-config` reports the graph that runs, and a run notes the ignored name.
|
|
@@ -2701,6 +2701,29 @@ async def _render_empty_turn(agent: Any, thread_id: str) -> bool:
|
|
|
2701
2701
|
return False
|
|
2702
2702
|
|
|
2703
2703
|
|
|
2704
|
+
def _verify_target(graph: Any, toml_configurable: Any) -> Any:
|
|
2705
|
+
"""What ``--verify`` hands core's ``verify``: the graph a run would drive.
|
|
2706
|
+
|
|
2707
|
+
A run forwards the ``[configurable]`` table (minus ``thread_id``, which is per
|
|
2708
|
+
run) to the graph through ``build_session_agent`` (gh #57). ``--verify`` used to
|
|
2709
|
+
pass the bare graph, so an agent reading ``config["configurable"][...]`` ran fine
|
|
2710
|
+
and failed the CI gate with a ``KeyError`` (gh #202). With keys to forward, build
|
|
2711
|
+
the agent the same way a run does. The probe still uses its own fresh thread, so a
|
|
2712
|
+
pinned ``thread_id`` is dropped. If the build fails (a wrong-type export), return
|
|
2713
|
+
the bare graph so core turns it into its usual clean ``ok=False`` verdict.
|
|
2714
|
+
"""
|
|
2715
|
+
configurable = dict(toml_configurable) if isinstance(toml_configurable, dict) else {}
|
|
2716
|
+
configurable.pop("thread_id", None)
|
|
2717
|
+
if not configurable:
|
|
2718
|
+
return graph
|
|
2719
|
+
from langstage_cli.agui_stream import build_session_agent
|
|
2720
|
+
|
|
2721
|
+
try:
|
|
2722
|
+
return build_session_agent(graph, config={"configurable": configurable})
|
|
2723
|
+
except Exception: # noqa: BLE001 - let core report the bad agent
|
|
2724
|
+
return graph
|
|
2725
|
+
|
|
2726
|
+
|
|
2704
2727
|
def _empty_turn_state_keys(graph: Any, thread_id: str, result: Any) -> List[str]:
|
|
2705
2728
|
"""The non-``messages`` state keys behind a ``--verify`` "no content" failure.
|
|
2706
2729
|
|
|
@@ -3881,7 +3904,10 @@ def main(
|
|
|
3881
3904
|
_ensure_checkpointer(graph)
|
|
3882
3905
|
verify_thread = f"verify-{uuid.uuid4().hex}"
|
|
3883
3906
|
try:
|
|
3884
|
-
result = _core_verify(
|
|
3907
|
+
result = _core_verify(
|
|
3908
|
+
_verify_target(graph, config_module.get(toml_config, "configurable")),
|
|
3909
|
+
thread_id=verify_thread,
|
|
3910
|
+
)
|
|
3885
3911
|
state_keys = (
|
|
3886
3912
|
[] if result.ok else _empty_turn_state_keys(graph, verify_thread, result)
|
|
3887
3913
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langstage-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.53
|
|
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
|
|
@@ -355,7 +355,9 @@ the reply it renders is the graph's `messages` channel. A graph whose state has
|
|
|
355
355
|
the CLI prints its final state as JSON, with a note on stderr. To drive such a graph from
|
|
356
356
|
the CLI, give it a `messages` channel, or a first node that copies the last message into
|
|
357
357
|
`query`. `--verify` gives the same verdict as a run: it passes a turn that ends with
|
|
358
|
-
final state to show, and fails a turn with no message and no state (exit 1).
|
|
358
|
+
final state to show, and fails a turn with no message and no state (exit 1). Its probe
|
|
359
|
+
turn gets the same `[configurable]` keys from `langstage.toml` a run does, on a fresh
|
|
360
|
+
thread (a pinned `thread_id` is ignored).
|
|
359
361
|
|
|
360
362
|
A spec's inline `:name` (`app.py:prod`) wins over `-g` / `[agent] graph_name`;
|
|
361
363
|
`--show-config` reports the graph that runs, and a run notes the ignored name.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langstage-cli"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.53"
|
|
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"
|
|
@@ -307,3 +307,60 @@ def test_verify_passes_a_final_state_graph_with_no_persist(tmp_path, monkeypatch
|
|
|
307
307
|
_ws(tmp_path, monkeypatch, {"custom_state_200b.py": _CUSTOM_STATE})
|
|
308
308
|
ver = CliRunner().invoke(main, ["--no-persist", "--verify", "-a", "custom_state_200b.py:graph"])
|
|
309
309
|
assert ver.exit_code == 0, ver.output
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
# --- gh #202: --verify forwards the [configurable] table a run forwards ---
|
|
313
|
+
|
|
314
|
+
_CFG_AGENT = textwrap.dedent(
|
|
315
|
+
"""
|
|
316
|
+
from langgraph.graph import StateGraph, START, END
|
|
317
|
+
from langgraph.graph.message import MessagesState
|
|
318
|
+
from langchain_core.messages import AIMessage
|
|
319
|
+
from langchain_core.runnables import RunnableConfig
|
|
320
|
+
|
|
321
|
+
def r(s, config: RunnableConfig):
|
|
322
|
+
user = config["configurable"]["user_id"]
|
|
323
|
+
return {"messages": [AIMessage(content=f"hello {user}")]}
|
|
324
|
+
|
|
325
|
+
g = StateGraph(MessagesState); g.add_node("r", r); g.add_edge(START, "r"); g.add_edge("r", END)
|
|
326
|
+
graph = g.compile()
|
|
327
|
+
"""
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def _cfg_toml(spec: str, extra: str = "") -> str:
|
|
332
|
+
return f'[agent]\nspec = "{spec}"\n\n[configurable]\nuser_id = "alex"\n{extra}'
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def test_verify_forwards_configurable_like_a_run(tmp_path, monkeypatch):
|
|
336
|
+
_ws(
|
|
337
|
+
tmp_path,
|
|
338
|
+
monkeypatch,
|
|
339
|
+
{"cfg_202.py": _CFG_AGENT, "langstage.toml": _cfg_toml("cfg_202.py:graph")},
|
|
340
|
+
)
|
|
341
|
+
run = CliRunner().invoke(main, ["--no-persist", "hi"])
|
|
342
|
+
ver = CliRunner().invoke(main, ["--verify"])
|
|
343
|
+
assert run.exit_code == 0 and "hello alex" in run.stdout, run.output
|
|
344
|
+
assert ver.exit_code == 0, ver.output # was KeyError: 'user_id', exit 1
|
|
345
|
+
assert "verified" in ver.stdout, ver.stdout
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def test_verify_with_configurable_ignores_a_pinned_thread_id(tmp_path, monkeypatch):
|
|
349
|
+
toml = _cfg_toml("cfg_202b.py:graph", 'thread_id = "pinned"\n')
|
|
350
|
+
_ws(tmp_path, monkeypatch, {"cfg_202b.py": _CFG_AGENT, "langstage.toml": toml})
|
|
351
|
+
ver = CliRunner().invoke(main, ["--verify"])
|
|
352
|
+
assert ver.exit_code == 0, ver.output
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
def test_verify_without_configurable_still_fails_an_agent_that_needs_it(tmp_path, monkeypatch):
|
|
356
|
+
_ws(tmp_path, monkeypatch, {"cfg_202c.py": _CFG_AGENT})
|
|
357
|
+
ver = CliRunner().invoke(main, ["--verify", "-a", "cfg_202c.py:graph"])
|
|
358
|
+
assert ver.exit_code == 1, ver.output
|
|
359
|
+
assert "user_id" in ver.stderr, ver.stderr
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def test_verify_target_falls_back_to_the_graph_when_the_build_fails():
|
|
363
|
+
bad = {"not": "a graph"}
|
|
364
|
+
assert cli._verify_target(bad, {"user_id": "alex"}) is bad
|
|
365
|
+
assert cli._verify_target(bad, None) is bad
|
|
366
|
+
assert cli._verify_target(bad, {"thread_id": "only"}) is bad
|
|
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
|
|
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
|