graph-agents-cli 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graph_agents_cli/__init__.py +26 -0
- graph_agents_cli/_api_policy.py +2145 -0
- graph_agents_cli/_approvals.py +400 -0
- graph_agents_cli/_build.py +186 -0
- graph_agents_cli/_build_info.json +7 -0
- graph_agents_cli/_chat_client.py +462 -0
- graph_agents_cli/_click.py +157 -0
- graph_agents_cli/_defaults.py +139 -0
- graph_agents_cli/_experiments.py +64 -0
- graph_agents_cli/_http.py +192 -0
- graph_agents_cli/_output.py +83 -0
- graph_agents_cli/_project.py +462 -0
- graph_agents_cli/_remote.py +220 -0
- graph_agents_cli/_response_schema.py +264 -0
- graph_agents_cli/_runner.py +319 -0
- graph_agents_cli/_skills_check.py +274 -0
- graph_agents_cli/_tools.py +189 -0
- graph_agents_cli/_trust.py +66 -0
- graph_agents_cli/api/__init__.py +15 -0
- graph_agents_cli/api/_changes.py +506 -0
- graph_agents_cli/api/_files.py +658 -0
- graph_agents_cli/api/cmd_api.py +2480 -0
- graph_agents_cli/deploy/__init__.py +15 -0
- graph_agents_cli/deploy/_config.py +171 -0
- graph_agents_cli/deploy/_image.py +128 -0
- graph_agents_cli/deploy/_kube.py +286 -0
- graph_agents_cli/deploy/_modes.py +234 -0
- graph_agents_cli/deploy/_preflight.py +370 -0
- graph_agents_cli/deploy/_values.py +168 -0
- graph_agents_cli/deploy/cmd_deploy.py +1866 -0
- graph_agents_cli/deploy/gitops.py +562 -0
- graph_agents_cli/deploy/local_load.py +273 -0
- graph_agents_cli/dev/__init__.py +13 -0
- graph_agents_cli/dev/cmd_build.py +131 -0
- graph_agents_cli/dev/cmd_install.py +78 -0
- graph_agents_cli/dev/cmd_lint.py +119 -0
- graph_agents_cli/dev/cmd_playground.py +297 -0
- graph_agents_cli/dev/policy_check.py +1287 -0
- graph_agents_cli/eval/__init__.py +22 -0
- graph_agents_cli/eval/_client.py +670 -0
- graph_agents_cli/eval/_common.py +177 -0
- graph_agents_cli/eval/_judge.py +168 -0
- graph_agents_cli/eval/_judge_runner.py +238 -0
- graph_agents_cli/eval/_paths.py +212 -0
- graph_agents_cli/eval/checks.py +581 -0
- graph_agents_cli/eval/cmd_analyze.py +278 -0
- graph_agents_cli/eval/cmd_compare.py +284 -0
- graph_agents_cli/eval/cmd_eval_group.py +80 -0
- graph_agents_cli/eval/cmd_generate.py +558 -0
- graph_agents_cli/eval/cmd_grade.py +466 -0
- graph_agents_cli/eval/cmd_metric.py +156 -0
- graph_agents_cli/eval/cmd_run.py +370 -0
- graph_agents_cli/eval/cmd_submit.py +400 -0
- graph_agents_cli/eval/config.py +435 -0
- graph_agents_cli/eval/dataset.py +350 -0
- graph_agents_cli/eval/gate.py +420 -0
- graph_agents_cli/eval/transcript.py +192 -0
- graph_agents_cli/extension/__init__.py +13 -0
- graph_agents_cli/extension/_compat.py +86 -0
- graph_agents_cli/extension/_loader.py +293 -0
- graph_agents_cli/extension/_manifest.py +135 -0
- graph_agents_cli/extension/_overrides.py +195 -0
- graph_agents_cli/extension/_paths.py +91 -0
- graph_agents_cli/extension/_refs.py +193 -0
- graph_agents_cli/extension/_resolver.py +453 -0
- graph_agents_cli/extension/_schema.py +106 -0
- graph_agents_cli/extension/_spec.py +253 -0
- graph_agents_cli/extension/_sync.py +102 -0
- graph_agents_cli/extension/_trust.py +58 -0
- graph_agents_cli/extension/cmd_extension_add.py +259 -0
- graph_agents_cli/extension/cmd_extension_group.py +57 -0
- graph_agents_cli/extension/cmd_extension_list.py +56 -0
- graph_agents_cli/extension/cmd_extension_remove.py +61 -0
- graph_agents_cli/extension/cmd_extension_update.py +195 -0
- graph_agents_cli/info/__init__.py +13 -0
- graph_agents_cli/info/cmd_info.py +222 -0
- graph_agents_cli/infra/__init__.py +15 -0
- graph_agents_cli/infra/checks.py +1169 -0
- graph_agents_cli/infra/cmd_infra.py +103 -0
- graph_agents_cli/main.py +591 -0
- graph_agents_cli/peer/__init__.py +15 -0
- graph_agents_cli/peer/_generate.py +254 -0
- graph_agents_cli/peer/cmd_peer.py +1151 -0
- graph_agents_cli/run/__init__.py +13 -0
- graph_agents_cli/run/_local_server.py +1157 -0
- graph_agents_cli/run/_signals.py +141 -0
- graph_agents_cli/run/cmd_approvals.py +530 -0
- graph_agents_cli/run/cmd_run.py +1421 -0
- graph_agents_cli/scaffold/__init__.py +19 -0
- graph_agents_cli/scaffold/agents/README.md +24 -0
- graph_agents_cli/scaffold/agents/empty_py/.template/templateconfig.yaml +22 -0
- graph_agents_cli/scaffold/agents/langgraph/.env.example +292 -0
- graph_agents_cli/scaffold/agents/langgraph/.template/templateconfig.yaml +28 -0
- graph_agents_cli/scaffold/agents/langgraph/Dockerfile +59 -0
- graph_agents_cli/scaffold/agents/langgraph/Dockerfile.langgraph-server +59 -0
- graph_agents_cli/scaffold/agents/langgraph/README.md +571 -0
- graph_agents_cli/scaffold/agents/langgraph/api-policy.yaml +60 -0
- graph_agents_cli/scaffold/agents/langgraph/app/__init__.py +20 -0
- graph_agents_cli/scaffold/agents/langgraph/app/agent.py +174 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/__init__.py +15 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a.py +2162 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a_client.py +1167 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/api_client.py +4220 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/approvals.py +1349 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/auth.py +1986 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/chat.py +2962 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/checkpointer.py +432 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/content.py +569 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/db.py +580 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/limits.py +203 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/metrics.py +231 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/middleware.py +361 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/model.py +611 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/playground.py +230 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/run_locks.py +459 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/structured.py +755 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/telemetry.py +681 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/threads.py +493 -0
- graph_agents_cli/scaffold/agents/langgraph/app/app_utils/token_exchange.py +959 -0
- graph_agents_cli/scaffold/agents/langgraph/app/fast_api_app.py +770 -0
- graph_agents_cli/scaffold/agents/langgraph/app/policies/__init__.py +55 -0
- graph_agents_cli/scaffold/agents/langgraph/app/policies/custom.py +97 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/__init__.py +46 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/example_api.py +92 -0
- graph_agents_cli/scaffold/agents/langgraph/app/tools/weather.py +33 -0
- graph_agents_cli/scaffold/agents/langgraph/langgraph.json +14 -0
- graph_agents_cli/scaffold/agents/langgraph/pyproject.toml +78 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/conftest.py +376 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/eval/datasets/basic-dataset.json +53 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/eval/eval_config.yaml +32 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/approval_graph.py +137 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_issuer.py +216 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_openai.py +357 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_outcomes.py +569 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_relay.py +479 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_api_surface.py +812 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals.py +1367 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals_server.py +794 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor.py +497 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor_server.py +247 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_history_repair.py +278 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_model_apis.py +242 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_postgres.py +637 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_resilience_postgres.py +770 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_runtime_guardrails.py +854 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_e2e.py +340 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_runtime.py +989 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_answers.py +584 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_server.py +222 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_token_exchange_issuer.py +650 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/.results/.placeholder +0 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/README.md +22 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/conftest.py +21 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/load_test/load_test.py +81 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_client.py +824 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_scoping.py +724 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client.py +1214 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client_hardening.py +716 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_policy_rpc.py +767 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_approval_ledger.py +1536 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_fake_model.py +115 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_jwt_policy.py +991 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_limits.py +310 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging.py +148 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging_hardening.py +271 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_policy.py +378 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_resilience.py +610 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_server_auth.py +702 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_structured.py +673 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_telemetry.py +404 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_thread_listing.py +255 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_threads.py +268 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_token_exchange.py +1320 -0
- graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_untrusted_content.py +393 -0
- graph_agents_cli/scaffold/agents/langgraph/uv-fastapi.lock +2084 -0
- graph_agents_cli/scaffold/agents/langgraph/uv-langgraph-server.lock +2106 -0
- graph_agents_cli/scaffold/agents/langgraph/{{cookiecutter.agent_guidance_filename}} +129 -0
- graph_agents_cli/scaffold/base_templates/_shared/graph-agents-cli-manifest.yaml +36 -0
- graph_agents_cli/scaffold/base_templates/python/.dockerignore +32 -0
- graph_agents_cli/scaffold/base_templates/python/.github/CODEOWNERS +30 -0
- graph_agents_cli/scaffold/base_templates/python/.github/agent.env +7 -0
- graph_agents_cli/scaffold/base_templates/python/.github/workflows/pr_checks.yaml +214 -0
- graph_agents_cli/scaffold/base_templates/python/.gitignore +209 -0
- graph_agents_cli/scaffold/base_templates/python/tests/unit/test_dummy.py +23 -0
- graph_agents_cli/scaffold/base_templates/python/{{cookiecutter.agent_guidance_filename}} +35 -0
- graph_agents_cli/scaffold/cmd_scaffold_group.py +49 -0
- graph_agents_cli/scaffold/commands/__init__.py +13 -0
- graph_agents_cli/scaffold/commands/create.py +1424 -0
- graph_agents_cli/scaffold/commands/enhance.py +1652 -0
- graph_agents_cli/scaffold/commands/upgrade.py +570 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/agent.env +12 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/promote-to-prod.yaml +371 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/staging.yaml +450 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-dev.yaml +43 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-prod.yaml +41 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-staging.yaml +43 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/.helmignore +14 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/Chart.yaml +21 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/examples/networkpolicy.yaml +103 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/NOTES.txt +48 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/_helpers.tpl +189 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/certificate.yaml +15 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/configmap.yaml +10 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/deployment.yaml +199 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/hpa.yaml +22 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/httproute.yaml +30 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/ingress.yaml +39 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/networkpolicy.yaml +48 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/pdb.yaml +13 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/postgresql-secret.yaml +37 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/service.yaml +15 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/serviceaccount.yaml +13 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/servicemonitor.yaml +42 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-dev.yaml +22 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-prod.yaml +45 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-staging.yaml +29 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values.yaml +396 -0
- graph_agents_cli/scaffold/deployment_targets/kubernetes/python/tests/integration/test_chart.py +269 -0
- graph_agents_cli/scaffold/deployment_targets/none/README.md +5 -0
- graph_agents_cli/scaffold/deployment_targets/none/python/README.md +6 -0
- graph_agents_cli/scaffold/utils/__init__.py +13 -0
- graph_agents_cli/scaffold/utils/backup.py +212 -0
- graph_agents_cli/scaffold/utils/build_record.py +257 -0
- graph_agents_cli/scaffold/utils/cli_options.py +184 -0
- graph_agents_cli/scaffold/utils/fs.py +83 -0
- graph_agents_cli/scaffold/utils/generate_locks.py +214 -0
- graph_agents_cli/scaffold/utils/generation_metadata.py +88 -0
- graph_agents_cli/scaffold/utils/keyedit.py +768 -0
- graph_agents_cli/scaffold/utils/keymerge.py +537 -0
- graph_agents_cli/scaffold/utils/language.py +138 -0
- graph_agents_cli/scaffold/utils/lock_utils.py +94 -0
- graph_agents_cli/scaffold/utils/logging.py +77 -0
- graph_agents_cli/scaffold/utils/manifest.py +292 -0
- graph_agents_cli/scaffold/utils/merge.py +970 -0
- graph_agents_cli/scaffold/utils/merge3.py +216 -0
- graph_agents_cli/scaffold/utils/openapi_seed.py +199 -0
- graph_agents_cli/scaffold/utils/remote_template.py +376 -0
- graph_agents_cli/scaffold/utils/template.py +1352 -0
- graph_agents_cli/scaffold/utils/upgrade.py +894 -0
- graph_agents_cli/scaffold/utils/version.py +438 -0
- graph_agents_cli/secrets/__init__.py +15 -0
- graph_agents_cli/secrets/_apply.py +954 -0
- graph_agents_cli/secrets/_required.py +188 -0
- graph_agents_cli/secrets/cmd_secrets.py +211 -0
- graph_agents_cli/setup/__init__.py +13 -0
- graph_agents_cli/setup/_antigravity.py +221 -0
- graph_agents_cli/setup/cmd_auth.py +1030 -0
- graph_agents_cli/setup/cmd_dev_token.py +513 -0
- graph_agents_cli/setup/cmd_setup.py +428 -0
- graph_agents_cli/setup/cmd_update.py +140 -0
- graph_agents_cli/skills/__init__.py +13 -0
- graph_agents_cli/skills/_bundle.py +65 -0
- graph_agents_cli/skills/data/README.md +19 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/SKILL.md +357 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/github-settings.md +113 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/gitops.md +137 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/kubernetes.md +315 -0
- graph_agents_cli/skills/data/graph-agents-cli-deploy/references/secrets.md +160 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/SKILL.md +303 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/references/dataset_schema.md +282 -0
- graph_agents_cli/skills/data/graph-agents-cli-eval/references/metrics-guide.md +143 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/SKILL.md +659 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langchain-models.md +124 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langgraph.md +235 -0
- graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/template-contract.md +477 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/SKILL.md +231 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/references/langsmith.md +46 -0
- graph_agents_cli/skills/data/graph-agents-cli-observability/references/otel.md +59 -0
- graph_agents_cli/skills/data/graph-agents-cli-scaffold/SKILL.md +414 -0
- graph_agents_cli/skills/data/graph-agents-cli-scaffold/references/flags.md +134 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/SKILL.md +478 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/brainstorming.md +118 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/commands.md +419 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/extension.md +156 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/internals.md +67 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/spec-template.md +56 -0
- graph_agents_cli/skills/data/graph-agents-cli-workflow/references/terminology.md +119 -0
- graph_agents_cli/system/__init__.py +15 -0
- graph_agents_cli/system/_apply.py +519 -0
- graph_agents_cli/system/_checks.py +1023 -0
- graph_agents_cli/system/_deploy.py +215 -0
- graph_agents_cli/system/_model.py +363 -0
- graph_agents_cli/system/_system.py +664 -0
- graph_agents_cli/system/_views.py +208 -0
- graph_agents_cli/system/cmd_system.py +423 -0
- graph_agents_cli-0.3.1.dist-info/METADATA +162 -0
- graph_agents_cli-0.3.1.dist-info/RECORD +291 -0
- graph_agents_cli-0.3.1.dist-info/WHEEL +4 -0
- graph_agents_cli-0.3.1.dist-info/entry_points.txt +2 -0
- graph_agents_cli-0.3.1.dist-info/licenses/LICENSE +201 -0
- graph_agents_cli-0.3.1.dist-info/licenses/NOTICE +19 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
|
+
# Modifications Copyright 2026 graph-agents-cli contributors
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
"""Regenerate the bundled ``uv-<runtime>.lock`` files of the langgraph template.
|
|
18
|
+
|
|
19
|
+
Run with ``uv run python -m graph_agents_cli.scaffold.utils.generate_locks``.
|
|
20
|
+
For each runtime the template's ``pyproject.toml`` is rendered with the
|
|
21
|
+
cookiecutter variables ``create`` uses (project name ``locked-template``, agent
|
|
22
|
+
directory ``app``, provider ``openai``, ...) and resolved with
|
|
23
|
+
``uv lock --no-config`` in a temporary directory that also holds what the
|
|
24
|
+
build backend needs to read the project metadata: an empty ``__init__.py`` in
|
|
25
|
+
every wheel package (``app/__init__.py``) and the readme when the pyproject
|
|
26
|
+
names one. The resulting lock is written next to the template as
|
|
27
|
+
``uv-<runtime>.lock`` with the project name replaced by the cookiecutter
|
|
28
|
+
placeholder, which ``create`` fills in when it selects the lock as ``uv.lock``.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
import logging
|
|
34
|
+
import pathlib
|
|
35
|
+
import shutil
|
|
36
|
+
import tempfile
|
|
37
|
+
import tomllib
|
|
38
|
+
from typing import Any
|
|
39
|
+
|
|
40
|
+
import click
|
|
41
|
+
|
|
42
|
+
from graph_agents_cli import _runner
|
|
43
|
+
from graph_agents_cli._defaults import RUNTIMES
|
|
44
|
+
|
|
45
|
+
from .lock_utils import (
|
|
46
|
+
LOCK_PROJECT_NAME,
|
|
47
|
+
LOCK_PROJECT_PLACEHOLDER,
|
|
48
|
+
langgraph_template_dir,
|
|
49
|
+
lock_filename,
|
|
50
|
+
render_pyproject,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
DEFAULT_PACKAGES = ("app",)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _wheel_packages(data: dict[str, Any]) -> list[str]:
|
|
57
|
+
"""The packages the wheel build target lists, or ``app`` when it lists none."""
|
|
58
|
+
node: Any = data
|
|
59
|
+
for key in ("tool", "hatch", "build", "targets", "wheel", "packages"):
|
|
60
|
+
if not isinstance(node, dict):
|
|
61
|
+
return list(DEFAULT_PACKAGES)
|
|
62
|
+
node = node.get(key)
|
|
63
|
+
if isinstance(node, list) and all(isinstance(p, str) for p in node) and node:
|
|
64
|
+
return list(node)
|
|
65
|
+
return list(DEFAULT_PACKAGES)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _readme_path(data: dict[str, Any]) -> str | None:
|
|
69
|
+
readme = (data.get("project") or {}).get("readme")
|
|
70
|
+
if isinstance(readme, dict):
|
|
71
|
+
readme = readme.get("file")
|
|
72
|
+
return readme if isinstance(readme, str) and readme.strip() else None
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def prepare_lock_dir(tmp_dir: pathlib.Path, pyproject_content: str) -> None:
|
|
76
|
+
"""Write ``pyproject.toml`` plus the files ``uv lock`` needs beside it.
|
|
77
|
+
|
|
78
|
+
An empty ``__init__.py`` per wheel package (``app/__init__.py`` for the
|
|
79
|
+
template) and the readme, when ``[project].readme`` names one, so the
|
|
80
|
+
build backend can read the project metadata without the real sources.
|
|
81
|
+
"""
|
|
82
|
+
(tmp_dir / "pyproject.toml").write_text(pyproject_content, encoding="utf-8")
|
|
83
|
+
try:
|
|
84
|
+
data = tomllib.loads(pyproject_content)
|
|
85
|
+
except tomllib.TOMLDecodeError as exc:
|
|
86
|
+
raise click.ClickException(f"The rendered pyproject.toml is not valid TOML: {exc}") from exc
|
|
87
|
+
for package in _wheel_packages(data):
|
|
88
|
+
package_dir = tmp_dir / pathlib.PurePosixPath(package)
|
|
89
|
+
package_dir.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
(package_dir / "__init__.py").touch()
|
|
91
|
+
readme = _readme_path(data)
|
|
92
|
+
if readme:
|
|
93
|
+
readme_path = tmp_dir / pathlib.PurePosixPath(readme)
|
|
94
|
+
readme_path.parent.mkdir(parents=True, exist_ok=True)
|
|
95
|
+
readme_path.write_text(f"# {LOCK_PROJECT_NAME}\n", encoding="utf-8")
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _audit(tmp_dir: pathlib.Path, output_path: pathlib.Path) -> None:
|
|
99
|
+
"""Best-effort ``uv audit``: warn on advisories or an unavailable subcommand, never abort.
|
|
100
|
+
|
|
101
|
+
Some fixes are unreachable within the version constraints, and older uv
|
|
102
|
+
releases have no ``audit`` subcommand at all.
|
|
103
|
+
"""
|
|
104
|
+
result = _runner.run_resolved(
|
|
105
|
+
["uv", "audit", "-U"], cwd=tmp_dir, check=False, capture_output=True, text=True
|
|
106
|
+
)
|
|
107
|
+
if result.returncode == 0:
|
|
108
|
+
return
|
|
109
|
+
stderr = (getattr(result, "stderr", None) or "").strip()
|
|
110
|
+
if "unrecognized subcommand" in stderr:
|
|
111
|
+
logging.warning(
|
|
112
|
+
"This uv has no `audit` subcommand; skipped the advisory check for %s.",
|
|
113
|
+
output_path.name,
|
|
114
|
+
)
|
|
115
|
+
return
|
|
116
|
+
output = "\n".join(
|
|
117
|
+
part for part in ((getattr(result, "stdout", None) or "").strip(), stderr) if part
|
|
118
|
+
)
|
|
119
|
+
logging.warning(
|
|
120
|
+
"uv audit reported unresolved vulnerabilities for %s (exit %d); review the advisories:\n%s",
|
|
121
|
+
output_path.name,
|
|
122
|
+
result.returncode,
|
|
123
|
+
output,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def generate_lock_file(
|
|
128
|
+
pyproject_content: str,
|
|
129
|
+
output_path: pathlib.Path,
|
|
130
|
+
*,
|
|
131
|
+
default_index: str | None = "https://pypi.org/simple",
|
|
132
|
+
audit: bool = True,
|
|
133
|
+
) -> None:
|
|
134
|
+
"""Resolve ``pyproject_content`` with ``uv lock`` and write the lock to ``output_path``."""
|
|
135
|
+
with tempfile.TemporaryDirectory(prefix="graph-agents-cli-lock-") as tmpdir:
|
|
136
|
+
tmp_dir = pathlib.Path(tmpdir)
|
|
137
|
+
prepare_lock_dir(tmp_dir, pyproject_content)
|
|
138
|
+
|
|
139
|
+
cmd = ["uv", "lock", "--no-config"]
|
|
140
|
+
if default_index:
|
|
141
|
+
cmd += ["--default-index", default_index]
|
|
142
|
+
_runner.run_resolved(cmd, cwd=tmp_dir, check=True)
|
|
143
|
+
|
|
144
|
+
if audit:
|
|
145
|
+
_audit(tmp_dir, output_path)
|
|
146
|
+
|
|
147
|
+
lock_content = (tmp_dir / "uv.lock").read_text(encoding="utf-8")
|
|
148
|
+
lock_content = lock_content.replace(LOCK_PROJECT_NAME, LOCK_PROJECT_PLACEHOLDER)
|
|
149
|
+
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
150
|
+
output_path.write_text(lock_content, encoding="utf-8")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def generate_runtime_locks(
|
|
154
|
+
template_path: pathlib.Path,
|
|
155
|
+
output_dir: pathlib.Path,
|
|
156
|
+
runtimes: tuple[str, ...] | list[str] = RUNTIMES,
|
|
157
|
+
*,
|
|
158
|
+
default_index: str | None = "https://pypi.org/simple",
|
|
159
|
+
audit: bool = True,
|
|
160
|
+
) -> list[pathlib.Path]:
|
|
161
|
+
"""Render and lock ``template_path`` once per runtime; return the written lock paths."""
|
|
162
|
+
written: list[pathlib.Path] = []
|
|
163
|
+
for runtime in runtimes:
|
|
164
|
+
click.echo(f"Generating {lock_filename(runtime)} from {template_path} ...")
|
|
165
|
+
content = render_pyproject(template_path, runtime)
|
|
166
|
+
output_path = output_dir / lock_filename(runtime)
|
|
167
|
+
generate_lock_file(content, output_path, default_index=default_index, audit=audit)
|
|
168
|
+
click.echo(f"Generated {output_path}")
|
|
169
|
+
written.append(output_path)
|
|
170
|
+
return written
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
@click.command()
|
|
174
|
+
@click.option(
|
|
175
|
+
"--template",
|
|
176
|
+
type=click.Path(exists=True, dir_okay=False, path_type=pathlib.Path),
|
|
177
|
+
default=None,
|
|
178
|
+
help="Path to the template pyproject.toml (default: the bundled langgraph template's)",
|
|
179
|
+
)
|
|
180
|
+
@click.option(
|
|
181
|
+
"--output-dir",
|
|
182
|
+
type=click.Path(file_okay=False, path_type=pathlib.Path),
|
|
183
|
+
default=None,
|
|
184
|
+
help="Directory to write uv-<runtime>.lock into (default: the langgraph template dir)",
|
|
185
|
+
)
|
|
186
|
+
@click.option(
|
|
187
|
+
"--runtime",
|
|
188
|
+
"runtimes",
|
|
189
|
+
type=click.Choice(list(RUNTIMES)),
|
|
190
|
+
multiple=True,
|
|
191
|
+
help="Runtime(s) to lock (default: all)",
|
|
192
|
+
)
|
|
193
|
+
@click.option("--no-audit", is_flag=True, default=False, help="Skip `uv audit`")
|
|
194
|
+
def main(
|
|
195
|
+
template: pathlib.Path | None,
|
|
196
|
+
output_dir: pathlib.Path | None,
|
|
197
|
+
runtimes: tuple[str, ...],
|
|
198
|
+
no_audit: bool,
|
|
199
|
+
) -> None:
|
|
200
|
+
"""Generate the bundled lock files of the langgraph template, one per runtime."""
|
|
201
|
+
if shutil.which("uv") is None:
|
|
202
|
+
raise click.ClickException("uv is required to generate lock files.")
|
|
203
|
+
template = template or (langgraph_template_dir() / "pyproject.toml")
|
|
204
|
+
output_dir = output_dir or langgraph_template_dir()
|
|
205
|
+
generate_runtime_locks(
|
|
206
|
+
template,
|
|
207
|
+
output_dir,
|
|
208
|
+
runtimes or RUNTIMES,
|
|
209
|
+
audit=not no_audit,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if __name__ == "__main__":
|
|
214
|
+
main()
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Copyright 2026 Google LLC
|
|
2
|
+
# Modifications Copyright 2026 graph-agents-cli contributors
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
"""Map the project manifest back to ``create`` flags (used by upgrade and enhance)."""
|
|
17
|
+
|
|
18
|
+
from packaging import version as pkg_version
|
|
19
|
+
|
|
20
|
+
from graph_agents_cli._defaults import LEGACY_AUTH_POLICY_ALIASES
|
|
21
|
+
from graph_agents_cli._project import ProjectConfig
|
|
22
|
+
from graph_agents_cli.scaffold.utils import remote_template
|
|
23
|
+
|
|
24
|
+
# The first CLI version that knows the current auth policy names; an older CLI
|
|
25
|
+
# (an authentic upgrade baseline) is given the retired name instead.
|
|
26
|
+
AUTH_POLICY_RENAME_VERSION = "0.2.0"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def auth_policy_for_version(auth_policy: str, cli_version: str | None) -> str:
|
|
30
|
+
"""``auth_policy`` as the CLI ``cli_version`` spells it (None: the running CLI)."""
|
|
31
|
+
if not cli_version:
|
|
32
|
+
return auth_policy
|
|
33
|
+
try:
|
|
34
|
+
older = pkg_version.parse(cli_version) < pkg_version.parse(AUTH_POLICY_RENAME_VERSION)
|
|
35
|
+
except pkg_version.InvalidVersion:
|
|
36
|
+
return auth_policy
|
|
37
|
+
if not older:
|
|
38
|
+
return auth_policy
|
|
39
|
+
retired = {new: old for old, new in LEGACY_AUTH_POLICY_ALIASES.items()}
|
|
40
|
+
return retired.get(auth_policy, auth_policy)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def metadata_to_cli_args(
|
|
44
|
+
metadata: ProjectConfig,
|
|
45
|
+
*,
|
|
46
|
+
for_enhance: bool = False,
|
|
47
|
+
cli_version: str | None = None,
|
|
48
|
+
) -> list[str]:
|
|
49
|
+
"""Convert a ProjectConfig into the ``create`` flags that reproduce it.
|
|
50
|
+
|
|
51
|
+
Every create parameter is passed explicitly, including defaults, so a
|
|
52
|
+
re-render is deterministic whatever the running CLI's defaults are.
|
|
53
|
+
``cli_version`` names the CLI that will receive the flags when it is not
|
|
54
|
+
the running one (an authentic upgrade baseline), so retired spellings are
|
|
55
|
+
used where that version needs them.
|
|
56
|
+
"""
|
|
57
|
+
args: list[str] = []
|
|
58
|
+
|
|
59
|
+
if metadata.base_template:
|
|
60
|
+
is_spec = remote_template.is_template_spec(metadata.base_template)
|
|
61
|
+
if not for_enhance:
|
|
62
|
+
args.extend(["--agent", metadata.base_template])
|
|
63
|
+
elif is_spec:
|
|
64
|
+
# A spec goes in `enhance`'s positional argument, which is what it
|
|
65
|
+
# fetches. --base-template only names a template inside the wheel.
|
|
66
|
+
args.append(metadata.base_template)
|
|
67
|
+
else:
|
|
68
|
+
args.extend(["--base-template", metadata.base_template])
|
|
69
|
+
|
|
70
|
+
if metadata.agent_directory and metadata.agent_directory != "app":
|
|
71
|
+
args.extend(["--agent-directory", metadata.agent_directory])
|
|
72
|
+
|
|
73
|
+
args.extend(["--agent-guidance-filename", metadata.agent_guidance_filename])
|
|
74
|
+
|
|
75
|
+
args.extend(["--deployment-target", metadata.deployment_target])
|
|
76
|
+
args.extend(["--runtime", metadata.runtime])
|
|
77
|
+
args.extend(["--model-provider", metadata.model_provider])
|
|
78
|
+
if metadata.model:
|
|
79
|
+
args.extend(["--model", metadata.model])
|
|
80
|
+
args.extend(["--checkpointer", metadata.checkpointer])
|
|
81
|
+
if metadata.registry:
|
|
82
|
+
args.extend(["--registry", metadata.registry])
|
|
83
|
+
args.extend(["--cd", metadata.cd])
|
|
84
|
+
args.extend(["--auth-policy", auth_policy_for_version(metadata.auth_policy, cli_version)])
|
|
85
|
+
if metadata.process:
|
|
86
|
+
args.extend(["--process", metadata.process])
|
|
87
|
+
|
|
88
|
+
return args
|