langgraph-cli 0.4.38__tar.gz → 0.4.40__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.40}/PKG-INFO +1 -1
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/yarn.lock +3 -3
- langgraph_cli-0.4.40/langgraph_cli/__init__.py +1 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/deploy.py +126 -118
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/host_backend.py +38 -10
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/test_cli.py +297 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/test_deploy_command.py +37 -11
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_deploy_agents.py +1 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_deploy_helpers.py +110 -10
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_host_backend.py +72 -9
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_util.py +4 -98
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/uv.lock +7 -7
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv.lock +101 -50
- langgraph_cli-0.4.38/langgraph_cli/__init__.py +0 -1
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/LICENSE +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/Makefile +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/README.md +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/Makefile +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs/deps/additional_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs/deps/zuper_deps/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs_fail/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs_fail/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graph_prerelease_reqs_fail/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs/storm.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/graphs_submod/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/hello.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/prompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_a/requirements.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/graphs_submod/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/graphs_submod/subprompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/hello.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/prompt.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/requirements.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/utils/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/graphs_reqs_b/utils/greeter.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/my_app.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/pipconf.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/examples/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/generate_schema.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/.dockerignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/.editorconfig +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/.gitignore +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/LICENSE +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/README.md +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/jest.config.js +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/src/agent/graph.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/src/agent/state.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/static/studio.png +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/tests/agent.test.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/tests/graph.int.test.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-examples/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/.eslintrc.cjs +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/apps/agent/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/apps/agent/src/graph.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/apps/agent/src/state.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/apps/agent/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/libs/shared/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/libs/shared/src/index.ts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/libs/shared/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/package.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/tsconfig.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/turbo.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/js-monorepo-example/yarn.lock +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/__main__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/_ignore.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/analytics.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/archive.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/cli.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/config.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/constants.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/dependency_tracking.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/docker.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/exec.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/image_reference.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/progress.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/py.typed +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/schemas.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/templates.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/util.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/uv_lock.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/langgraph_cli/version.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/apps/agent/src/agent/state.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/libs/common/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/libs/common/helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/python-monorepo-example/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/schemas/schema.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/schemas/schema.v0.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/schemas/version.schema.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/integration_tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/integration_tests/test_cli.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/cli/test_templates.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/conftest.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/graphs/agent.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/multiplatform/js.mts +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/multiplatform/python.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/pipconfig.txt +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_archive.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_config.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_config.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_dependency_tracking.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_docker.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_exec.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_image_reference.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/tests/unit_tests/test_logs_helpers.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/apps/agent/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/apps/agent/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/apps/agent/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/apps/agent/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/apps/agent/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/libs/shared/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/libs/shared/src/shared/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/libs/shared/src/shared/utils.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/monorepo/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/simple/.env.example +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/simple/langgraph.json +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/simple/pyproject.toml +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/simple/src/agent/__init__.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/uv-examples/simple/src/agent/graph.py +0 -0
- {langgraph_cli-0.4.38 → langgraph_cli-0.4.40}/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.40"
|
|
@@ -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"):
|
|
@@ -1081,6 +1061,8 @@ def _docker_config_for_token(registry_host: str, token: str, username: str):
|
|
|
1081
1061
|
|
|
1082
1062
|
_UPLOAD_TIMEOUT_SECONDS = 300
|
|
1083
1063
|
_BYTES_PER_MIB = 1_048_576
|
|
1064
|
+
# Byte range Cloud Storage signs into upload URLs, up to the 200 MB archive limit.
|
|
1065
|
+
_GCS_SIZE_RANGE = f"0,{200 * _BYTES_PER_MIB}"
|
|
1084
1066
|
|
|
1085
1067
|
|
|
1086
1068
|
class _ProgressReader:
|
|
@@ -1106,12 +1088,24 @@ class _ProgressReader:
|
|
|
1106
1088
|
return self._file_size
|
|
1107
1089
|
|
|
1108
1090
|
|
|
1109
|
-
def
|
|
1110
|
-
|
|
1091
|
+
def _upload_source_tarball(
|
|
1092
|
+
signed_url: str,
|
|
1093
|
+
file_path: str,
|
|
1094
|
+
file_size: int,
|
|
1095
|
+
upload_headers: dict[str, str] | None,
|
|
1096
|
+
) -> None:
|
|
1097
|
+
"""Upload tarball via signed PUT URL with progress display."""
|
|
1111
1098
|
import urllib.error
|
|
1112
1099
|
import urllib.request
|
|
1113
1100
|
|
|
1114
1101
|
em = _get_emitter()
|
|
1102
|
+
# Control planes that return no `upload_headers` sign for the Cloud Storage
|
|
1103
|
+
# size range. Content-Type is a fallback: without one, urllib sends a form
|
|
1104
|
+
# content type, which breaks signatures that cover it.
|
|
1105
|
+
headers = {
|
|
1106
|
+
"Content-Type": "application/gzip",
|
|
1107
|
+
**(upload_headers or {"X-Goog-Content-Length-Range": _GCS_SIZE_RANGE}),
|
|
1108
|
+
}
|
|
1115
1109
|
|
|
1116
1110
|
with open(file_path, "rb") as f:
|
|
1117
1111
|
reader = _ProgressReader(f, file_size, em)
|
|
@@ -1119,11 +1113,7 @@ def _upload_to_gcs(signed_url: str, file_path: str, file_size: int) -> None:
|
|
|
1119
1113
|
signed_url,
|
|
1120
1114
|
data=reader,
|
|
1121
1115
|
method="PUT",
|
|
1122
|
-
headers={
|
|
1123
|
-
"Content-Type": "application/gzip",
|
|
1124
|
-
"Content-Length": str(file_size),
|
|
1125
|
-
"X-Goog-Content-Length-Range": "0,209715200",
|
|
1126
|
-
},
|
|
1116
|
+
headers={**headers, "Content-Length": str(file_size)},
|
|
1127
1117
|
)
|
|
1128
1118
|
try:
|
|
1129
1119
|
urllib.request.urlopen(req, timeout=_UPLOAD_TIMEOUT_SECONDS)
|
|
@@ -1443,7 +1433,9 @@ def _run_remote_build(
|
|
|
1443
1433
|
step += 1
|
|
1444
1434
|
|
|
1445
1435
|
_log_deploy_step(step, "Uploading source")
|
|
1446
|
-
|
|
1436
|
+
_upload_source_tarball(
|
|
1437
|
+
signed_url, archive_path, file_size, upload_data.get("upload_headers")
|
|
1438
|
+
)
|
|
1447
1439
|
step += 1
|
|
1448
1440
|
|
|
1449
1441
|
_log_deploy_step(step, "Triggering remote build")
|
|
@@ -2594,6 +2586,13 @@ def _deploy_cmd(
|
|
|
2594
2586
|
default="",
|
|
2595
2587
|
help="Only show deployments whose names contain this value.",
|
|
2596
2588
|
)
|
|
2589
|
+
@click.option(
|
|
2590
|
+
"--json",
|
|
2591
|
+
"json_output",
|
|
2592
|
+
is_flag=True,
|
|
2593
|
+
default=False,
|
|
2594
|
+
help="Print the deployments as a JSON array of {id, name} instead of a table.",
|
|
2595
|
+
)
|
|
2597
2596
|
@deploy.command("list", help="[Beta] List LangSmith Deployments.")
|
|
2598
2597
|
def deploy_list(
|
|
2599
2598
|
api_key: str | None,
|
|
@@ -2601,11 +2600,13 @@ def deploy_list(
|
|
|
2601
2600
|
name_contains: str,
|
|
2602
2601
|
agent_id: str | None,
|
|
2603
2602
|
environment: str | None,
|
|
2603
|
+
json_output: bool,
|
|
2604
2604
|
) -> None:
|
|
2605
2605
|
if agent_id is not None or environment is not None:
|
|
2606
2606
|
click.secho(
|
|
2607
2607
|
"Note: --agent-id and --agent-environment flags are in private beta",
|
|
2608
2608
|
fg="yellow",
|
|
2609
|
+
err=True,
|
|
2609
2610
|
)
|
|
2610
2611
|
if agent_id is not None and not agent_id.strip():
|
|
2611
2612
|
raise click.UsageError("--agent-id must not be empty.")
|
|
@@ -2614,15 +2615,19 @@ def deploy_list(
|
|
|
2614
2615
|
filters["agent_id"] = agent_id
|
|
2615
2616
|
if environment is not None:
|
|
2616
2617
|
filters["agent_environment"] = environment
|
|
2617
|
-
client = _create_host_backend_client(host_url, api_key)
|
|
2618
|
-
|
|
2618
|
+
client = _create_host_backend_client(host_url, api_key, no_input=json_output)
|
|
2619
|
+
resources = _call_host_backend_with_optional_tenant(
|
|
2619
2620
|
client,
|
|
2620
2621
|
lambda c: c.list_deployments(name_contains=name_contains, **filters),
|
|
2622
|
+
no_input=json_output,
|
|
2621
2623
|
)
|
|
2622
|
-
|
|
2624
|
+
deployments = [DeploymentRow.from_resource(resource) for resource in resources]
|
|
2625
|
+
if json_output:
|
|
2626
|
+
click.echo(json_mod.dumps([deployment.as_json() for deployment in deployments]))
|
|
2627
|
+
elif not deployments:
|
|
2623
2628
|
click.echo("No deployments found.")
|
|
2624
|
-
|
|
2625
|
-
|
|
2629
|
+
else:
|
|
2630
|
+
click.echo(DEPLOYMENTS_TABLE.render(deployments))
|
|
2626
2631
|
|
|
2627
2632
|
|
|
2628
2633
|
# ---------------------------------------------------------------------------
|
|
@@ -2665,11 +2670,14 @@ def deploy_listeners_list(
|
|
|
2665
2670
|
)
|
|
2666
2671
|
if json_output:
|
|
2667
2672
|
click.echo(json_mod.dumps(listeners))
|
|
2668
|
-
|
|
2669
|
-
if not listeners:
|
|
2673
|
+
elif not listeners:
|
|
2670
2674
|
click.echo("No listeners found for this workspace.")
|
|
2671
|
-
|
|
2672
|
-
|
|
2675
|
+
else:
|
|
2676
|
+
click.echo(
|
|
2677
|
+
LISTENERS_TABLE.render(
|
|
2678
|
+
[Listener.from_resource(listener) for listener in listeners]
|
|
2679
|
+
)
|
|
2680
|
+
)
|
|
2673
2681
|
|
|
2674
2682
|
|
|
2675
2683
|
# ---------------------------------------------------------------------------
|
|
@@ -2712,7 +2720,7 @@ def deploy_revisions_list(
|
|
|
2712
2720
|
if not revisions:
|
|
2713
2721
|
click.echo(f"No revisions found for deployment {deployment_id}.")
|
|
2714
2722
|
return
|
|
2715
|
-
click.echo(
|
|
2723
|
+
click.echo(REVISIONS_TABLE.render(_with_replaced_status(revisions)))
|
|
2716
2724
|
|
|
2717
2725
|
|
|
2718
2726
|
# ---------------------------------------------------------------------------
|
|
@@ -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}")
|
|
@@ -258,10 +283,13 @@ class HostBackendClient:
|
|
|
258
283
|
)
|
|
259
284
|
|
|
260
285
|
def request_upload_url(self, deployment_id: str) -> dict[str, Any]:
|
|
261
|
-
"""Get a signed
|
|
286
|
+
"""Get a signed URL for uploading the source tarball."""
|
|
287
|
+
# Tells the control plane this client sends the returned
|
|
288
|
+
# `upload_headers` with its upload, which some storage requires.
|
|
262
289
|
return self._request(
|
|
263
290
|
"POST",
|
|
264
291
|
f"/v2/deployments/{deployment_id}/upload-url",
|
|
292
|
+
{"supports_upload_headers": True},
|
|
265
293
|
)
|
|
266
294
|
|
|
267
295
|
def update_deployment(
|