langgraph-cli 0.4.38__tar.gz → 0.4.39__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.
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/PKG-INFO +1 -1
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/yarn.lock +3 -3
- langgraph_cli-0.4.39/langgraph_cli/__init__.py +1 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/deploy.py +106 -110
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/host_backend.py +34 -9
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/test_cli.py +297 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/test_deploy_command.py +11 -4
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_deploy_agents.py +1 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_deploy_helpers.py +54 -10
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_host_backend.py +72 -9
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_util.py +4 -98
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/uv.lock +7 -7
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv.lock +101 -50
- langgraph_cli-0.4.38/langgraph_cli/__init__.py +0 -1
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/LICENSE +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/Makefile +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/README.md +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/Makefile +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs_fail/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs_fail/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graph_prerelease_reqs_fail/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs/storm.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/graphs_submod/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/hello.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/prompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_a/requirements.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/hello.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/prompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/requirements.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/utils/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/graphs_reqs_b/utils/greeter.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/my_app.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/pipconf.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/examples/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/generate_schema.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/.dockerignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/.editorconfig +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/LICENSE +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/README.md +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/jest.config.js +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/src/agent/graph.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/src/agent/state.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/static/studio.png +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/tests/agent.test.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/tests/graph.int.test.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-examples/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/apps/agent/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/apps/agent/src/graph.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/apps/agent/src/state.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/apps/agent/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/libs/shared/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/libs/shared/src/index.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/libs/shared/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/turbo.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/js-monorepo-example/yarn.lock +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/__main__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/_ignore.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/analytics.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/archive.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/cli.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/config.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/constants.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/dependency_tracking.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/docker.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/exec.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/image_reference.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/progress.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/py.typed +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/schemas.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/templates.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/util.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/uv_lock.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/langgraph_cli/version.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/apps/agent/src/agent/state.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/libs/common/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/libs/common/helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/python-monorepo-example/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/schemas/schema.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/schemas/schema.v0.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/schemas/version.schema.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/integration_tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/integration_tests/test_cli.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/cli/test_templates.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/conftest.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/graphs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/multiplatform/js.mts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/multiplatform/python.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/pipconfig.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_archive.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_config.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_config.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_dependency_tracking.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_docker.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_exec.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_image_reference.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/tests/unit_tests/test_logs_helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/monorepo/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.39}/uv-examples/simple/uv.lock +0 -0
|
@@ -5217,6 +5217,6 @@ yocto-queue@^0.1.0:
|
|
|
5217
5217
|
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
|
5218
5218
|
|
|
5219
5219
|
"zod@^3.25.76 || ^4":
|
|
5220
|
-
version "4.
|
|
5221
|
-
resolved "https://registry.yarnpkg.com/zod/-/zod-4.
|
|
5222
|
-
integrity sha512-
|
|
5220
|
+
version "4.6.7"
|
|
5221
|
+
resolved "https://registry.yarnpkg.com/zod/-/zod-4.6.7.tgz#e806cf64a7f4e37635ce9f2f52c04c3766f75e5b"
|
|
5222
|
+
integrity sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.39"
|
|
@@ -12,7 +12,7 @@ from collections.abc import Callable, Mapping, Sequence
|
|
|
12
12
|
from contextlib import contextmanager
|
|
13
13
|
from dataclasses import asdict, dataclass, field
|
|
14
14
|
from datetime import datetime, timezone
|
|
15
|
-
from typing import Protocol, TypeVar
|
|
15
|
+
from typing import Generic, Protocol, TypeVar
|
|
16
16
|
|
|
17
17
|
import click
|
|
18
18
|
import click.exceptions
|
|
@@ -26,7 +26,6 @@ from langgraph_cli.dependency_tracking import find_tracked_packages
|
|
|
26
26
|
from langgraph_cli.docker import build_docker_image, can_build_locally
|
|
27
27
|
from langgraph_cli.exec import CommandRunner, Runner, subp_exec
|
|
28
28
|
from langgraph_cli.host_backend import (
|
|
29
|
-
MAX_PAGE_SIZE,
|
|
30
29
|
ControlPlaneEndpoints,
|
|
31
30
|
HostBackendClient,
|
|
32
31
|
HostBackendError,
|
|
@@ -183,12 +182,15 @@ class Listener:
|
|
|
183
182
|
)
|
|
184
183
|
return cls(
|
|
185
184
|
identifier,
|
|
186
|
-
str(resource.get("compute_id"
|
|
185
|
+
str(resource.get("compute_id") or ""),
|
|
187
186
|
tuple(str(namespace) for namespace in namespaces)
|
|
188
187
|
if isinstance(namespaces, list)
|
|
189
188
|
else (),
|
|
190
189
|
)
|
|
191
190
|
|
|
191
|
+
def cells(self) -> tuple[str | None, ...]:
|
|
192
|
+
return (self.id, self.compute_id, ", ".join(self.namespaces))
|
|
193
|
+
|
|
192
194
|
|
|
193
195
|
@dataclass(frozen=True, slots=True)
|
|
194
196
|
class Unplaced:
|
|
@@ -276,8 +278,6 @@ def _describe_listeners(listeners: Sequence[Listener]) -> str:
|
|
|
276
278
|
]
|
|
277
279
|
if len(listeners) > len(shown):
|
|
278
280
|
lines.append(f" ... and {len(listeners) - len(shown)} more")
|
|
279
|
-
if len(listeners) == MAX_PAGE_SIZE:
|
|
280
|
-
lines.append(f" (only the first {MAX_PAGE_SIZE} listeners were read)")
|
|
281
281
|
return "\n".join(lines)
|
|
282
282
|
|
|
283
283
|
|
|
@@ -499,16 +499,9 @@ def _source_of(resource: object) -> str | None:
|
|
|
499
499
|
def find_deployment_by_name(
|
|
500
500
|
client: HostBackendClient, name: str
|
|
501
501
|
) -> ExistingDeployment | None:
|
|
502
|
-
|
|
503
|
-
for resource in listed:
|
|
502
|
+
for resource in client.list_deployments(name=name, name_contains=name):
|
|
504
503
|
if resource.get("name") == name and resource.get("id"):
|
|
505
504
|
return ExistingDeployment(str(resource["id"]), _source_of(resource))
|
|
506
|
-
if len(listed) >= MAX_PAGE_SIZE:
|
|
507
|
-
raise click.ClickException(
|
|
508
|
-
"This workspace has more deployments than the CLI can search, so it "
|
|
509
|
-
f"cannot tell whether '{name}' already exists. Pass --deployment-id to "
|
|
510
|
-
"update an existing deployment."
|
|
511
|
-
)
|
|
512
505
|
return None
|
|
513
506
|
|
|
514
507
|
|
|
@@ -583,103 +576,96 @@ def _validate_prebuilt_image(
|
|
|
583
576
|
_get_emitter().info(f"Image is available for {_DEPLOYMENT_PLATFORM}")
|
|
584
577
|
|
|
585
578
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
if isinstance(source_config, dict):
|
|
589
|
-
custom_url = source_config.get("custom_url")
|
|
590
|
-
if isinstance(custom_url, str) and custom_url:
|
|
591
|
-
return custom_url
|
|
592
|
-
return "-"
|
|
579
|
+
Resource = Mapping[str, object]
|
|
580
|
+
RowT = TypeVar("RowT")
|
|
593
581
|
|
|
594
582
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
583
|
+
@dataclass(frozen=True, slots=True)
|
|
584
|
+
class Table(Generic[RowT]):
|
|
585
|
+
headers: tuple[str, ...]
|
|
586
|
+
cells: Callable[[RowT], tuple[str | None, ...]]
|
|
587
|
+
|
|
588
|
+
def render(self, rows: Sequence[RowT]) -> str:
|
|
589
|
+
grid = [
|
|
590
|
+
self.headers,
|
|
591
|
+
*(tuple(cell or "-" for cell in self.cells(row)) for row in rows),
|
|
592
|
+
]
|
|
593
|
+
widths = [max(map(len, column)) for column in zip(*grid, strict=True)]
|
|
594
|
+
rule = tuple("-" * width for width in widths)
|
|
595
|
+
return "\n".join(
|
|
596
|
+
" ".join(
|
|
597
|
+
cell.ljust(width) for cell, width in zip(line, widths, strict=True)
|
|
598
|
+
)
|
|
599
|
+
for line in (grid[0], rule, *grid[1:])
|
|
602
600
|
)
|
|
603
|
-
for deployment in deployments
|
|
604
|
-
]
|
|
605
|
-
widths = [
|
|
606
|
-
max(len(headers[index]), *(len(row[index]) for row in rows))
|
|
607
|
-
for index in range(len(headers))
|
|
608
|
-
]
|
|
609
601
|
|
|
610
|
-
def format_row(row: Sequence[str]) -> str:
|
|
611
|
-
return " ".join(value.ljust(widths[index]) for index, value in enumerate(row))
|
|
612
602
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return
|
|
603
|
+
def _text(resource: Resource, key: str) -> str | None:
|
|
604
|
+
value = resource.get(key)
|
|
605
|
+
return str(value) if value else None
|
|
616
606
|
|
|
617
607
|
|
|
618
|
-
def
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
if isinstance(compute_config, dict)
|
|
623
|
-
else None
|
|
608
|
+
def _deployment_url(deployment: Resource) -> str | None:
|
|
609
|
+
source_config = deployment.get("source_config")
|
|
610
|
+
custom_url = (
|
|
611
|
+
source_config.get("custom_url") if isinstance(source_config, Mapping) else None
|
|
624
612
|
)
|
|
625
|
-
if isinstance(
|
|
626
|
-
return ", ".join(str(namespace) for namespace in namespaces)
|
|
627
|
-
return "-"
|
|
613
|
+
return custom_url if isinstance(custom_url, str) and custom_url else None
|
|
628
614
|
|
|
629
615
|
|
|
630
|
-
def
|
|
631
|
-
|
|
632
|
-
rows = [
|
|
616
|
+
def _with_replaced_status(revisions: Sequence[Resource]) -> list[Resource]:
|
|
617
|
+
live_index = next(
|
|
633
618
|
(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
)
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
619
|
+
index
|
|
620
|
+
for index, revision in enumerate(revisions)
|
|
621
|
+
if revision.get("status") == "DEPLOYED"
|
|
622
|
+
),
|
|
623
|
+
None,
|
|
624
|
+
)
|
|
625
|
+
return [
|
|
626
|
+
{**revision, "status": "REPLACED"}
|
|
627
|
+
if revision.get("status") == "DEPLOYED" and index != live_index
|
|
628
|
+
else revision
|
|
629
|
+
for index, revision in enumerate(revisions)
|
|
643
630
|
]
|
|
644
631
|
|
|
645
|
-
def format_row(row: Sequence[str]) -> str:
|
|
646
|
-
return " ".join(value.ljust(widths[index]) for index, value in enumerate(row))
|
|
647
|
-
|
|
648
|
-
lines = [format_row(headers), format_row(tuple("-" * width for width in widths))]
|
|
649
|
-
lines.extend(format_row(row) for row in rows)
|
|
650
|
-
return "\n".join(lines)
|
|
651
632
|
|
|
633
|
+
@dataclass(frozen=True, slots=True)
|
|
634
|
+
class DeploymentRow:
|
|
635
|
+
id: str
|
|
636
|
+
name: str | None
|
|
637
|
+
url: str | None
|
|
652
638
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
if status == "DEPLOYED":
|
|
660
|
-
if latest_deployed_seen:
|
|
661
|
-
status = "REPLACED"
|
|
662
|
-
else:
|
|
663
|
-
latest_deployed_seen = True
|
|
664
|
-
rows.append(
|
|
665
|
-
(
|
|
666
|
-
str(revision.get("id", "-") or "-"),
|
|
667
|
-
status,
|
|
668
|
-
str(revision.get("created_at", "-") or "-"),
|
|
639
|
+
@classmethod
|
|
640
|
+
def from_resource(cls, deployment: Resource) -> "DeploymentRow":
|
|
641
|
+
identifier = _text(deployment, "id")
|
|
642
|
+
if identifier is None:
|
|
643
|
+
raise HostBackendError(
|
|
644
|
+
"The control plane returned a deployment without an id."
|
|
669
645
|
)
|
|
670
|
-
)
|
|
646
|
+
return cls(identifier, _text(deployment, "name"), _deployment_url(deployment))
|
|
671
647
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
for index in range(len(headers))
|
|
675
|
-
]
|
|
648
|
+
def cells(self) -> tuple[str | None, ...]:
|
|
649
|
+
return (self.id, self.name, self.url)
|
|
676
650
|
|
|
677
|
-
def
|
|
678
|
-
return "
|
|
651
|
+
def as_json(self) -> dict[str, str | None]:
|
|
652
|
+
return {"id": self.id, "name": self.name}
|
|
679
653
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
654
|
+
|
|
655
|
+
DEPLOYMENTS_TABLE = Table(
|
|
656
|
+
("Deployment ID", "Deployment Name", "Deployment URL"), DeploymentRow.cells
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
LISTENERS_TABLE = Table(("Listener ID", "Compute ID", "Namespaces"), Listener.cells)
|
|
660
|
+
|
|
661
|
+
REVISIONS_TABLE = Table(
|
|
662
|
+
("Revision ID", "Status", "Created At"),
|
|
663
|
+
lambda revision: (
|
|
664
|
+
_text(revision, "id"),
|
|
665
|
+
_text(revision, "status"),
|
|
666
|
+
_text(revision, "created_at"),
|
|
667
|
+
),
|
|
668
|
+
)
|
|
683
669
|
|
|
684
670
|
|
|
685
671
|
def format_timestamp(ts) -> str:
|
|
@@ -841,7 +827,6 @@ def _find_deployment(
|
|
|
841
827
|
lambda c: c.list_deployments(
|
|
842
828
|
agent_id=selector.agent_id,
|
|
843
829
|
agent_environment=selector.environment,
|
|
844
|
-
limit=MAX_PAGE_SIZE,
|
|
845
830
|
),
|
|
846
831
|
)
|
|
847
832
|
if len(existing) > 1:
|
|
@@ -1007,20 +992,15 @@ def _print_deployment_result(
|
|
|
1007
992
|
dashboard_label: str,
|
|
1008
993
|
status_url: str | None = None,
|
|
1009
994
|
) -> None:
|
|
1010
|
-
"""Print final deployment status and raise on failure."""
|
|
1011
995
|
em = _get_emitter()
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
if isinstance(dep_info, dict):
|
|
1015
|
-
sc = dep_info.get("source_config")
|
|
1016
|
-
if isinstance(sc, dict):
|
|
1017
|
-
custom_url = sc.get("custom_url")
|
|
996
|
+
deployment = client.get_deployment(deployment_id)
|
|
997
|
+
url = _deployment_url(deployment) if isinstance(deployment, Mapping) else None
|
|
1018
998
|
|
|
1019
999
|
if last_status == "DEPLOYED":
|
|
1020
1000
|
em.result(
|
|
1021
1001
|
"succeeded",
|
|
1022
1002
|
deployment_id=deployment_id,
|
|
1023
|
-
url=
|
|
1003
|
+
url=url,
|
|
1024
1004
|
status_url=status_url,
|
|
1025
1005
|
)
|
|
1026
1006
|
elif last_status in ("BUILD_FAILED", "DEPLOY_FAILED", "CREATE_FAILED"):
|
|
@@ -2594,6 +2574,13 @@ def _deploy_cmd(
|
|
|
2594
2574
|
default="",
|
|
2595
2575
|
help="Only show deployments whose names contain this value.",
|
|
2596
2576
|
)
|
|
2577
|
+
@click.option(
|
|
2578
|
+
"--json",
|
|
2579
|
+
"json_output",
|
|
2580
|
+
is_flag=True,
|
|
2581
|
+
default=False,
|
|
2582
|
+
help="Print the deployments as a JSON array of {id, name} instead of a table.",
|
|
2583
|
+
)
|
|
2597
2584
|
@deploy.command("list", help="[Beta] List LangSmith Deployments.")
|
|
2598
2585
|
def deploy_list(
|
|
2599
2586
|
api_key: str | None,
|
|
@@ -2601,11 +2588,13 @@ def deploy_list(
|
|
|
2601
2588
|
name_contains: str,
|
|
2602
2589
|
agent_id: str | None,
|
|
2603
2590
|
environment: str | None,
|
|
2591
|
+
json_output: bool,
|
|
2604
2592
|
) -> None:
|
|
2605
2593
|
if agent_id is not None or environment is not None:
|
|
2606
2594
|
click.secho(
|
|
2607
2595
|
"Note: --agent-id and --agent-environment flags are in private beta",
|
|
2608
2596
|
fg="yellow",
|
|
2597
|
+
err=True,
|
|
2609
2598
|
)
|
|
2610
2599
|
if agent_id is not None and not agent_id.strip():
|
|
2611
2600
|
raise click.UsageError("--agent-id must not be empty.")
|
|
@@ -2614,15 +2603,19 @@ def deploy_list(
|
|
|
2614
2603
|
filters["agent_id"] = agent_id
|
|
2615
2604
|
if environment is not None:
|
|
2616
2605
|
filters["agent_environment"] = environment
|
|
2617
|
-
client = _create_host_backend_client(host_url, api_key)
|
|
2618
|
-
|
|
2606
|
+
client = _create_host_backend_client(host_url, api_key, no_input=json_output)
|
|
2607
|
+
resources = _call_host_backend_with_optional_tenant(
|
|
2619
2608
|
client,
|
|
2620
2609
|
lambda c: c.list_deployments(name_contains=name_contains, **filters),
|
|
2610
|
+
no_input=json_output,
|
|
2621
2611
|
)
|
|
2622
|
-
|
|
2612
|
+
deployments = [DeploymentRow.from_resource(resource) for resource in resources]
|
|
2613
|
+
if json_output:
|
|
2614
|
+
click.echo(json_mod.dumps([deployment.as_json() for deployment in deployments]))
|
|
2615
|
+
elif not deployments:
|
|
2623
2616
|
click.echo("No deployments found.")
|
|
2624
|
-
|
|
2625
|
-
|
|
2617
|
+
else:
|
|
2618
|
+
click.echo(DEPLOYMENTS_TABLE.render(deployments))
|
|
2626
2619
|
|
|
2627
2620
|
|
|
2628
2621
|
# ---------------------------------------------------------------------------
|
|
@@ -2665,11 +2658,14 @@ def deploy_listeners_list(
|
|
|
2665
2658
|
)
|
|
2666
2659
|
if json_output:
|
|
2667
2660
|
click.echo(json_mod.dumps(listeners))
|
|
2668
|
-
|
|
2669
|
-
if not listeners:
|
|
2661
|
+
elif not listeners:
|
|
2670
2662
|
click.echo("No listeners found for this workspace.")
|
|
2671
|
-
|
|
2672
|
-
|
|
2663
|
+
else:
|
|
2664
|
+
click.echo(
|
|
2665
|
+
LISTENERS_TABLE.render(
|
|
2666
|
+
[Listener.from_resource(listener) for listener in listeners]
|
|
2667
|
+
)
|
|
2668
|
+
)
|
|
2673
2669
|
|
|
2674
2670
|
|
|
2675
2671
|
# ---------------------------------------------------------------------------
|
|
@@ -2712,7 +2708,7 @@ def deploy_revisions_list(
|
|
|
2712
2708
|
if not revisions:
|
|
2713
2709
|
click.echo(f"No revisions found for deployment {deployment_id}.")
|
|
2714
2710
|
return
|
|
2715
|
-
click.echo(
|
|
2711
|
+
click.echo(REVISIONS_TABLE.render(_with_replaced_status(revisions)))
|
|
2716
2712
|
|
|
2717
2713
|
|
|
2718
2714
|
# ---------------------------------------------------------------------------
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from collections.abc import Mapping
|
|
5
6
|
from dataclasses import dataclass
|
|
6
7
|
from typing import Any, Literal
|
|
7
8
|
from urllib.parse import urlparse
|
|
@@ -220,27 +221,51 @@ class HostBackendClient:
|
|
|
220
221
|
*,
|
|
221
222
|
name: str | None = None,
|
|
222
223
|
name_contains: str | None = None,
|
|
223
|
-
limit: int | None = None,
|
|
224
224
|
agent_id: str | None = None,
|
|
225
225
|
agent_environment: str | None = None,
|
|
226
|
-
) -> list[dict[str,
|
|
226
|
+
) -> list[dict[str, object]]:
|
|
227
227
|
given = (
|
|
228
228
|
("name", name),
|
|
229
229
|
("name_contains", name_contains),
|
|
230
|
-
("limit", limit),
|
|
231
230
|
("agent_id", agent_id),
|
|
232
231
|
("agent_environment", agent_environment),
|
|
233
232
|
)
|
|
234
|
-
|
|
235
|
-
return
|
|
233
|
+
filters = {key: value for key, value in given if value is not None}
|
|
234
|
+
return self._every_page("/v2/deployments", filters)
|
|
235
|
+
|
|
236
|
+
def _every_page(
|
|
237
|
+
self, path: str, filters: Mapping[str, object]
|
|
238
|
+
) -> list[dict[str, object]]:
|
|
239
|
+
resources: list[dict[str, object]] = []
|
|
240
|
+
seen_ids: set[object] = set()
|
|
241
|
+
while True:
|
|
242
|
+
page = _resources(
|
|
243
|
+
self._request(
|
|
244
|
+
"GET",
|
|
245
|
+
path,
|
|
246
|
+
params={
|
|
247
|
+
**filters,
|
|
248
|
+
"limit": MAX_PAGE_SIZE,
|
|
249
|
+
"offset": len(resources),
|
|
250
|
+
},
|
|
251
|
+
)
|
|
252
|
+
)
|
|
253
|
+
page_ids = {resource.get("id") for resource in page}
|
|
254
|
+
if page_ids and page_ids <= seen_ids:
|
|
255
|
+
raise HostBackendError(
|
|
256
|
+
f"GET {path} returned the same resources again: this control "
|
|
257
|
+
"plane ignores 'offset', so the CLI cannot read past the first page."
|
|
258
|
+
)
|
|
259
|
+
seen_ids |= page_ids
|
|
260
|
+
resources.extend(page)
|
|
261
|
+
if len(page) < MAX_PAGE_SIZE:
|
|
262
|
+
return resources
|
|
236
263
|
|
|
237
264
|
def get_listener(self, listener_id: str) -> dict[str, Any]:
|
|
238
265
|
return self._request("GET", f"/v2/listeners/{listener_id}")
|
|
239
266
|
|
|
240
|
-
def list_listeners(self) -> list[dict[str,
|
|
241
|
-
return
|
|
242
|
-
self._request("GET", "/v2/listeners", params={"limit": MAX_PAGE_SIZE})
|
|
243
|
-
)
|
|
267
|
+
def list_listeners(self) -> list[dict[str, object]]:
|
|
268
|
+
return self._every_page("/v2/listeners", {})
|
|
244
269
|
|
|
245
270
|
def get_deployment(self, deployment_id: str) -> dict[str, Any]:
|
|
246
271
|
return self._request("GET", f"/v2/deployments/{deployment_id}")
|