agentcore-cli 0.31.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.
- agentcore/__init__.py +1 -0
- agentcore/agent_inspector/NOTICE +9 -0
- agentcore/agent_inspector/favicon.svg +60 -0
- agentcore/agent_inspector/index.css +1 -0
- agentcore/agent_inspector/index.html +14 -0
- agentcore/agent_inspector/index.js +289 -0
- agentcore/assets/AGENTS.md +60 -0
- agentcore/assets/README.md +108 -0
- agentcore/assets/agents/AGENTS.md +218 -0
- agentcore/assets/cdk/.prettierrc +8 -0
- agentcore/assets/cdk/README.md +26 -0
- agentcore/assets/cdk/bin/cdk.ts +216 -0
- agentcore/assets/cdk/cdk.json +88 -0
- agentcore/assets/cdk/gitignore.template +9 -0
- agentcore/assets/cdk/jest.config.js +9 -0
- agentcore/assets/cdk/lib/cdk-stack.ts +291 -0
- agentcore/assets/cdk/npmignore.template +6 -0
- agentcore/assets/cdk/package.json +30 -0
- agentcore/assets/cdk/test/cdk.test.ts +31 -0
- agentcore/assets/cdk/tsconfig.json +28 -0
- agentcore/assets/container/python/Dockerfile +47 -0
- agentcore/assets/container/python/dockerignore.template +27 -0
- agentcore/assets/container/typescript/Dockerfile +25 -0
- agentcore/assets/container/typescript/dockerignore.template +24 -0
- agentcore/assets/datasets/predefined-v1.jsonl +3 -0
- agentcore/assets/datasets/simulated-v1.jsonl +3 -0
- agentcore/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
- agentcore/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
- agentcore/assets/evaluators/autoevals-lambda/pyproject.toml +22 -0
- agentcore/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
- agentcore/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
- agentcore/assets/evaluators/deepeval-lambda/pyproject.toml +19 -0
- agentcore/assets/evaluators/python-lambda/execution-role-policy.json +10 -0
- agentcore/assets/evaluators/python-lambda/lambda_function.py +19 -0
- agentcore/assets/evaluators/python-lambda/pyproject.toml +15 -0
- agentcore/assets/harness/invoke.py.template +74 -0
- agentcore/assets/mcp/python/README.md +27 -0
- agentcore/assets/mcp/python/pyproject.toml +22 -0
- agentcore/assets/mcp/python/server.py +117 -0
- agentcore/assets/mcp/python-lambda/README.md +22 -0
- agentcore/assets/mcp/python-lambda/handler.py +144 -0
- agentcore/assets/mcp/python-lambda/pyproject.toml +15 -0
- agentcore/assets/python/a2a/googleadk/base/README.md +22 -0
- agentcore/assets/python/a2a/googleadk/base/gitignore.template +41 -0
- agentcore/assets/python/a2a/googleadk/base/main.py +124 -0
- agentcore/assets/python/a2a/googleadk/base/model/__init__.py +1 -0
- agentcore/assets/python/a2a/googleadk/base/model/load.py +41 -0
- agentcore/assets/python/a2a/googleadk/base/pyproject.toml +22 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/README.md +22 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/gitignore.template +41 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/main.py +144 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/model/__init__.py +1 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/model/load.py +123 -0
- agentcore/assets/python/a2a/langchain_langgraph/base/pyproject.toml +26 -0
- agentcore/assets/python/a2a/strands/base/README.md +22 -0
- agentcore/assets/python/a2a/strands/base/gitignore.template +41 -0
- agentcore/assets/python/a2a/strands/base/main.py +113 -0
- agentcore/assets/python/a2a/strands/base/model/__init__.py +1 -0
- agentcore/assets/python/a2a/strands/base/model/load.py +123 -0
- agentcore/assets/python/a2a/strands/base/pyproject.toml +23 -0
- agentcore/assets/python/a2a/strands/capabilities/memory/__init__.py +1 -0
- agentcore/assets/python/a2a/strands/capabilities/memory/session.py +46 -0
- agentcore/assets/python/agui/googleadk/base/README.md +30 -0
- agentcore/assets/python/agui/googleadk/base/gitignore.template +41 -0
- agentcore/assets/python/agui/googleadk/base/main.py +91 -0
- agentcore/assets/python/agui/googleadk/base/model/__init__.py +1 -0
- agentcore/assets/python/agui/googleadk/base/model/load.py +41 -0
- agentcore/assets/python/agui/googleadk/base/pyproject.toml +25 -0
- agentcore/assets/python/agui/langchain_langgraph/base/README.md +22 -0
- agentcore/assets/python/agui/langchain_langgraph/base/gitignore.template +41 -0
- agentcore/assets/python/agui/langchain_langgraph/base/main.py +130 -0
- agentcore/assets/python/agui/langchain_langgraph/base/model/__init__.py +1 -0
- agentcore/assets/python/agui/langchain_langgraph/base/model/load.py +123 -0
- agentcore/assets/python/agui/langchain_langgraph/base/pyproject.toml +31 -0
- agentcore/assets/python/agui/strands/base/README.md +22 -0
- agentcore/assets/python/agui/strands/base/gitignore.template +41 -0
- agentcore/assets/python/agui/strands/base/main.py +105 -0
- agentcore/assets/python/agui/strands/base/model/__init__.py +1 -0
- agentcore/assets/python/agui/strands/base/model/load.py +123 -0
- agentcore/assets/python/agui/strands/base/pyproject.toml +27 -0
- agentcore/assets/python/agui/strands/capabilities/memory/__init__.py +1 -0
- agentcore/assets/python/agui/strands/capabilities/memory/session.py +46 -0
- agentcore/assets/python/http/autogen/base/README.md +45 -0
- agentcore/assets/python/http/autogen/base/gitignore.template +41 -0
- agentcore/assets/python/http/autogen/base/main.py +145 -0
- agentcore/assets/python/http/autogen/base/mcp_client/__init__.py +1 -0
- agentcore/assets/python/http/autogen/base/mcp_client/client.py +28 -0
- agentcore/assets/python/http/autogen/base/model/__init__.py +1 -0
- agentcore/assets/python/http/autogen/base/model/load.py +136 -0
- agentcore/assets/python/http/autogen/base/pyproject.toml +34 -0
- agentcore/assets/python/http/bma/base/Dockerfile +41 -0
- agentcore/assets/python/http/bma/base/README.md +178 -0
- agentcore/assets/python/http/bma/base/client.py +200 -0
- agentcore/assets/python/http/bma/base/lifecycle/server.py +641 -0
- agentcore/assets/python/http/bma/base/otel/collector.yaml +69 -0
- agentcore/assets/python/http/bma/base/plugins/acr-report/.codex-plugin/plugin.json +6 -0
- agentcore/assets/python/http/bma/base/plugins/acr-report/skills/acr-report/SKILL.md +16 -0
- agentcore/assets/python/http/bma/base/policies/bma-acr-policy.json +11 -0
- agentcore/assets/python/http/bma/base/policies/bma-session-policy.json +35 -0
- agentcore/assets/python/http/bma/base/policies/bma-session-trust.json +20 -0
- agentcore/assets/python/http/bma/base/pyproject.toml +21 -0
- agentcore/assets/python/http/googleadk/base/README.md +45 -0
- agentcore/assets/python/http/googleadk/base/gitignore.template +41 -0
- agentcore/assets/python/http/googleadk/base/main.py +207 -0
- agentcore/assets/python/http/googleadk/base/mcp_client/__init__.py +1 -0
- agentcore/assets/python/http/googleadk/base/mcp_client/client.py +75 -0
- agentcore/assets/python/http/googleadk/base/model/__init__.py +1 -0
- agentcore/assets/python/http/googleadk/base/model/load.py +41 -0
- agentcore/assets/python/http/googleadk/base/pyproject.toml +24 -0
- agentcore/assets/python/http/langchain_langgraph/base/README.md +45 -0
- agentcore/assets/python/http/langchain_langgraph/base/gitignore.template +41 -0
- agentcore/assets/python/http/langchain_langgraph/base/main.py +227 -0
- agentcore/assets/python/http/langchain_langgraph/base/mcp_client/__init__.py +1 -0
- agentcore/assets/python/http/langchain_langgraph/base/mcp_client/client.py +79 -0
- agentcore/assets/python/http/langchain_langgraph/base/model/__init__.py +1 -0
- agentcore/assets/python/http/langchain_langgraph/base/model/load.py +123 -0
- agentcore/assets/python/http/langchain_langgraph/base/pyproject.toml +38 -0
- agentcore/assets/python/http/openaiagents/base/README.md +45 -0
- agentcore/assets/python/http/openaiagents/base/gitignore.template +41 -0
- agentcore/assets/python/http/openaiagents/base/main.py +200 -0
- agentcore/assets/python/http/openaiagents/base/mcp_client/__init__.py +1 -0
- agentcore/assets/python/http/openaiagents/base/mcp_client/client.py +74 -0
- agentcore/assets/python/http/openaiagents/base/model/__init__.py +1 -0
- agentcore/assets/python/http/openaiagents/base/model/load.py +37 -0
- agentcore/assets/python/http/openaiagents/base/pyproject.toml +21 -0
- agentcore/assets/python/http/strands/base/README.md +46 -0
- agentcore/assets/python/http/strands/base/gitignore.template +41 -0
- agentcore/assets/python/http/strands/base/main.py +714 -0
- agentcore/assets/python/http/strands/base/mcp_client/__init__.py +1 -0
- agentcore/assets/python/http/strands/base/mcp_client/client.py +116 -0
- agentcore/assets/python/http/strands/base/model/__init__.py +1 -0
- agentcore/assets/python/http/strands/base/model/load.py +239 -0
- agentcore/assets/python/http/strands/base/model/mantle_compat.py +21 -0
- agentcore/assets/python/http/strands/base/pyproject.toml +31 -0
- agentcore/assets/python/http/strands/base/skills/fetcher.py +279 -0
- agentcore/assets/python/http/strands/capabilities/execution-limits/hooks/execution_limits.py +54 -0
- agentcore/assets/python/http/strands/capabilities/memory/__init__.py +1 -0
- agentcore/assets/python/http/strands/capabilities/memory/session.py +47 -0
- agentcore/assets/python/http/strands/capabilities/payments/__init__.py +4 -0
- agentcore/assets/python/http/strands/capabilities/payments/payments.py +142 -0
- agentcore/assets/python/mcp/standalone/base/README.md +36 -0
- agentcore/assets/python/mcp/standalone/base/gitignore.template +41 -0
- agentcore/assets/python/mcp/standalone/base/main.py +83 -0
- agentcore/assets/python/mcp/standalone/base/pyproject.toml +16 -0
- agentcore/assets/typescript/.gitkeep +0 -0
- agentcore/assets/typescript/http/strands/base/README.md +42 -0
- agentcore/assets/typescript/http/strands/base/gitignore.template +22 -0
- agentcore/assets/typescript/http/strands/base/main.ts +149 -0
- agentcore/assets/typescript/http/strands/base/mcp_client/client.ts +11 -0
- agentcore/assets/typescript/http/strands/base/model/load.ts +102 -0
- agentcore/assets/typescript/http/strands/base/package.json +38 -0
- agentcore/assets/typescript/http/strands/base/tsconfig.json +19 -0
- agentcore/assets/typescript/http/strands/capabilities/memory/memory.ts +52 -0
- agentcore/assets/typescript/http/vercelai/base/README.md +42 -0
- agentcore/assets/typescript/http/vercelai/base/gitignore.template +22 -0
- agentcore/assets/typescript/http/vercelai/base/main.ts +70 -0
- agentcore/assets/typescript/http/vercelai/base/model/load.ts +121 -0
- agentcore/assets/typescript/http/vercelai/base/package.json +35 -0
- agentcore/assets/typescript/http/vercelai/base/tsconfig.json +19 -0
- agentcore/aws/__init__.py +263 -0
- agentcore/aws/_aws_errors.py +72 -0
- agentcore/aws/_http.py +176 -0
- agentcore/aws/_util.py +37 -0
- agentcore/aws/account.py +165 -0
- agentcore/aws/agentcore.py +971 -0
- agentcore/aws/agentcore_ab_tests.py +230 -0
- agentcore/aws/agentcore_batch_evaluation.py +227 -0
- agentcore/aws/agentcore_config_bundles.py +220 -0
- agentcore/aws/agentcore_control.py +994 -0
- agentcore/aws/agentcore_datasets.py +222 -0
- agentcore/aws/agentcore_harness.py +330 -0
- agentcore/aws/agentcore_payments.py +430 -0
- agentcore/aws/agentcore_recommendation.py +140 -0
- agentcore/aws/agui_parser.py +131 -0
- agentcore/aws/agui_types.py +342 -0
- agentcore/aws/api_client.py +87 -0
- agentcore/aws/arn.py +18 -0
- agentcore/aws/aws_context.py +23 -0
- agentcore/aws/bedrock.py +44 -0
- agentcore/aws/bedrock_agent.py +129 -0
- agentcore/aws/bedrock_import.py +252 -0
- agentcore/aws/bedrock_import_types.py +111 -0
- agentcore/aws/cloudwatch.py +136 -0
- agentcore/aws/connect_shell.py +266 -0
- agentcore/aws/iam.py +41 -0
- agentcore/aws/partition.py +58 -0
- agentcore/aws/policy_generation.py +116 -0
- agentcore/aws/region.py +54 -0
- agentcore/aws/retry.py +27 -0
- agentcore/aws/shell_framer.py +136 -0
- agentcore/aws/stage_endpoint.py +39 -0
- agentcore/aws/target_region.py +54 -0
- agentcore/aws/transaction_search.py +97 -0
- agentcore/cdk/__init__.py +10 -0
- agentcore/cdk/constants.py +13 -0
- agentcore/cdk/local_cdk_project.py +48 -0
- agentcore/cdk/toolkit.py +706 -0
- agentcore/cli/__init__.py +0 -0
- agentcore/cli/commands/__init__.py +0 -0
- agentcore/cli/commands/_jobs_common.py +39 -0
- agentcore/cli/commands/_run_wizards.py +639 -0
- agentcore/cli/commands/add/__init__.py +37 -0
- agentcore/cli/commands/add/_commander.py +52 -0
- agentcore/cli/commands/add/_common.py +47 -0
- agentcore/cli/commands/add/agent_wizard.py +528 -0
- agentcore/cli/commands/add/auth_options.py +154 -0
- agentcore/cli/commands/add/skill_action.py +105 -0
- agentcore/cli/commands/add/skill_command.py +87 -0
- agentcore/cli/commands/add/tool_action.py +160 -0
- agentcore/cli/commands/add/tool_command.py +117 -0
- agentcore/cli/commands/add/validate.py +333 -0
- agentcore/cli/commands/capacity_provider/__init__.py +86 -0
- agentcore/cli/commands/capacity_provider/action.py +114 -0
- agentcore/cli/commands/capacity_provider/constants.py +22 -0
- agentcore/cli/commands/config.py +91 -0
- agentcore/cli/commands/config_bundle.py +251 -0
- agentcore/cli/commands/create/__init__.py +643 -0
- agentcore/cli/commands/create/action.py +406 -0
- agentcore/cli/commands/create/dependencies.py +91 -0
- agentcore/cli/commands/create/harness_validate.py +82 -0
- agentcore/cli/commands/create/validate.py +195 -0
- agentcore/cli/commands/create/wizard.py +127 -0
- agentcore/cli/commands/dataset.py +119 -0
- agentcore/cli/commands/deploy/__init__.py +31 -0
- agentcore/cli/commands/deploy/_guards.py +25 -0
- agentcore/cli/commands/deploy/actions.py +840 -0
- agentcore/cli/commands/deploy/command.py +349 -0
- agentcore/cli/commands/deploy/progress.py +115 -0
- agentcore/cli/commands/deploy/types.py +68 -0
- agentcore/cli/commands/deploy/utils.py +43 -0
- agentcore/cli/commands/deploy/validate.py +21 -0
- agentcore/cli/commands/dev/__init__.py +5 -0
- agentcore/cli/commands/dev/_deps.py +50 -0
- agentcore/cli/commands/dev/browser_mode.py +270 -0
- agentcore/cli/commands/dev/command.py +450 -0
- agentcore/cli/commands/dev/terminal_mode.py +379 -0
- agentcore/cli/commands/exec/__init__.py +29 -0
- agentcore/cli/commands/exec/action.py +442 -0
- agentcore/cli/commands/exec/command.py +206 -0
- agentcore/cli/commands/exec/types.py +35 -0
- agentcore/cli/commands/export/__init__.py +114 -0
- agentcore/cli/commands/export/constants.py +21 -0
- agentcore/cli/commands/export/fetch_harness_spec.py +234 -0
- agentcore/cli/commands/export/harness_action.py +385 -0
- agentcore/cli/commands/export/harness_mapper.py +868 -0
- agentcore/cli/commands/export/harness_resolver.py +95 -0
- agentcore/cli/commands/export/types.py +90 -0
- agentcore/cli/commands/export/wizard.py +97 -0
- agentcore/cli/commands/feedback/__init__.py +69 -0
- agentcore/cli/commands/feedback/action.py +30 -0
- agentcore/cli/commands/feedback/consent_prompt.py +35 -0
- agentcore/cli/commands/feedback/wizard.py +49 -0
- agentcore/cli/commands/fetch/__init__.py +69 -0
- agentcore/cli/commands/fetch/action.py +62 -0
- agentcore/cli/commands/help.py +65 -0
- agentcore/cli/commands/import_/__init__.py +167 -0
- agentcore/cli/commands/import_/_js.py +72 -0
- agentcore/cli/commands/import_/actions.py +457 -0
- agentcore/cli/commands/import_/constants.py +45 -0
- agentcore/cli/commands/import_/import_evaluator.py +140 -0
- agentcore/cli/commands/import_/import_gateway.py +520 -0
- agentcore/cli/commands/import_/import_memory.py +128 -0
- agentcore/cli/commands/import_/import_online_eval.py +165 -0
- agentcore/cli/commands/import_/import_pipeline.py +145 -0
- agentcore/cli/commands/import_/import_runtime.py +214 -0
- agentcore/cli/commands/import_/import_utils.py +410 -0
- agentcore/cli/commands/import_/phase1_update.py +110 -0
- agentcore/cli/commands/import_/phase2_import.py +206 -0
- agentcore/cli/commands/import_/resource_import.py +228 -0
- agentcore/cli/commands/import_/template_utils.py +148 -0
- agentcore/cli/commands/import_/types.py +150 -0
- agentcore/cli/commands/import_/yaml_parser.py +265 -0
- agentcore/cli/commands/init.py +196 -0
- agentcore/cli/commands/invoke/__init__.py +32 -0
- agentcore/cli/commands/invoke/_deps.py +73 -0
- agentcore/cli/commands/invoke/action.py +840 -0
- agentcore/cli/commands/invoke/command.py +490 -0
- agentcore/cli/commands/invoke/constants.py +40 -0
- agentcore/cli/commands/invoke/guards.py +23 -0
- agentcore/cli/commands/invoke/interactive.py +604 -0
- agentcore/cli/commands/invoke/resolve.py +149 -0
- agentcore/cli/commands/invoke/resolve_prompt.py +60 -0
- agentcore/cli/commands/invoke/types.py +61 -0
- agentcore/cli/commands/invoke/validate.py +33 -0
- agentcore/cli/commands/job_actions.py +239 -0
- agentcore/cli/commands/job_history.py +380 -0
- agentcore/cli/commands/logs/__init__.py +53 -0
- agentcore/cli/commands/logs/action.py +159 -0
- agentcore/cli/commands/logs/filter_pattern.py +17 -0
- agentcore/cli/commands/logs/guards.py +51 -0
- agentcore/cli/commands/logs_evals.py +42 -0
- agentcore/cli/commands/package.py +118 -0
- agentcore/cli/commands/remove/__init__.py +172 -0
- agentcore/cli/commands/remove/skill_command.py +131 -0
- agentcore/cli/commands/remove/tool_command.py +59 -0
- agentcore/cli/commands/run.py +808 -0
- agentcore/cli/commands/run_ingest.py +97 -0
- agentcore/cli/commands/shared/__init__.py +0 -0
- agentcore/cli/commands/shared/arn_utils.py +9 -0
- agentcore/cli/commands/shared/filesystem_utils.py +421 -0
- agentcore/cli/commands/shared/header_utils.py +87 -0
- agentcore/cli/commands/shared/indexed_key_parser.py +76 -0
- agentcore/cli/commands/shared/lifecycle_utils.py +72 -0
- agentcore/cli/commands/shared/region_utils.py +20 -0
- agentcore/cli/commands/shared/vpc_utils.py +99 -0
- agentcore/cli/commands/status/__init__.py +30 -0
- agentcore/cli/commands/status/_guards.py +25 -0
- agentcore/cli/commands/status/action.py +741 -0
- agentcore/cli/commands/status/command.py +321 -0
- agentcore/cli/commands/status/constants.py +36 -0
- agentcore/cli/commands/status/format_knowledge_base.py +111 -0
- agentcore/cli/commands/telemetry.py +79 -0
- agentcore/cli/commands/traces/__init__.py +155 -0
- agentcore/cli/commands/traces/action.py +123 -0
- agentcore/cli/commands/update/__init__.py +63 -0
- agentcore/cli/commands/update/action.py +164 -0
- agentcore/cli/commands/validate.py +165 -0
- agentcore/cli/constants.py +96 -0
- agentcore/cli/errors.py +118 -0
- agentcore/cli/external_requirements/__init__.py +67 -0
- agentcore/cli/external_requirements/checks.py +280 -0
- agentcore/cli/external_requirements/detect.py +55 -0
- agentcore/cli/external_requirements/versions.py +57 -0
- agentcore/cli/groups.py +23 -0
- agentcore/cli/interactive.py +85 -0
- agentcore/cli/main.py +137 -0
- agentcore/cli/naming.py +11 -0
- agentcore/cli/notices.py +42 -0
- agentcore/cli/project.py +34 -0
- agentcore/cli/run_command.py +27 -0
- agentcore/cli/tree.py +135 -0
- agentcore/cli/update_notifier.py +123 -0
- agentcore/cli/variadic.py +50 -0
- agentcore/cloudformation/__init__.py +84 -0
- agentcore/cloudformation/bootstrap.py +64 -0
- agentcore/cloudformation/logical_ids.py +37 -0
- agentcore/cloudformation/outputs.py +566 -0
- agentcore/cloudformation/stack_discovery.py +75 -0
- agentcore/cloudformation/stack_events.py +107 -0
- agentcore/cloudformation/stack_status.py +98 -0
- agentcore/cloudformation/types.py +44 -0
- agentcore/lib/__init__.py +68 -0
- agentcore/lib/constants.py +77 -0
- agentcore/lib/dependency_management/__init__.py +23 -0
- agentcore/lib/dependency_management/messages.py +92 -0
- agentcore/lib/dependency_management/plan.py +98 -0
- agentcore/lib/dependency_management/semver.py +137 -0
- agentcore/lib/dependency_management/sync.py +139 -0
- agentcore/lib/dependency_management/types.py +56 -0
- agentcore/lib/errors/__init__.py +5 -0
- agentcore/lib/errors/types.py +352 -0
- agentcore/lib/errors/validation.py +121 -0
- agentcore/lib/packaging/__init__.py +81 -0
- agentcore/lib/packaging/build_args.py +23 -0
- agentcore/lib/packaging/build_context.py +26 -0
- agentcore/lib/packaging/build_context_dockerignore.py +45 -0
- agentcore/lib/packaging/container.py +95 -0
- agentcore/lib/packaging/helpers.py +289 -0
- agentcore/lib/packaging/node.py +153 -0
- agentcore/lib/packaging/python.py +135 -0
- agentcore/lib/packaging/types.py +69 -0
- agentcore/lib/packaging/uv.py +45 -0
- agentcore/lib/result.py +104 -0
- agentcore/lib/schemas/__init__.py +1 -0
- agentcore/lib/schemas/io/__init__.py +27 -0
- agentcore/lib/schemas/io/config_io.py +458 -0
- agentcore/lib/schemas/io/global_config.py +239 -0
- agentcore/lib/schemas/io/path_resolver.py +132 -0
- agentcore/lib/secrets/__init__.py +18 -0
- agentcore/lib/secrets/cipher.py +70 -0
- agentcore/lib/secrets/key_provider.py +163 -0
- agentcore/lib/secrets/sensitive_keys.py +55 -0
- agentcore/lib/time_constants.py +4 -0
- agentcore/lib/utils/__init__.py +47 -0
- agentcore/lib/utils/aws_account.py +15 -0
- agentcore/lib/utils/credentials.py +68 -0
- agentcore/lib/utils/dotenv.py +32 -0
- agentcore/lib/utils/env.py +105 -0
- agentcore/lib/utils/json_format.py +29 -0
- agentcore/lib/utils/json_rpc.py +22 -0
- agentcore/lib/utils/platform.py +33 -0
- agentcore/lib/utils/polling.py +86 -0
- agentcore/lib/utils/subprocess.py +135 -0
- agentcore/lib/utils/time_parser.py +48 -0
- agentcore/lib/utils/validation.py +106 -0
- agentcore/logging/__init__.py +10 -0
- agentcore/logging/_common.py +77 -0
- agentcore/logging/cdk_io_host.py +36 -0
- agentcore/logging/create_logger.py +107 -0
- agentcore/logging/dev_logger.py +63 -0
- agentcore/logging/exec_logger.py +159 -0
- agentcore/logging/invoke_logger.py +154 -0
- agentcore/logging/remove_logger.py +95 -0
- agentcore/operations/__init__.py +0 -0
- agentcore/operations/agent/__init__.py +0 -0
- agentcore/operations/agent/config_bundle_defaults.py +31 -0
- agentcore/operations/agent/generate/__init__.py +28 -0
- agentcore/operations/agent/generate/schema_mapper.py +319 -0
- agentcore/operations/agent/generate/types.py +172 -0
- agentcore/operations/agent/generate/write_agent_to_project.py +67 -0
- agentcore/operations/agent/import_/__init__.py +31 -0
- agentcore/operations/agent/import_/base_translator.py +449 -0
- agentcore/operations/agent/import_/constants.py +23 -0
- agentcore/operations/agent/import_/execute.py +127 -0
- agentcore/operations/agent/import_/langgraph_translator.py +294 -0
- agentcore/operations/agent/import_/pyproject_generator.py +73 -0
- agentcore/operations/agent/import_/strands_translator.py +289 -0
- agentcore/operations/config_bundle/__init__.py +1 -0
- agentcore/operations/config_bundle/bundle_name_variants.py +9 -0
- agentcore/operations/config_bundle/diff_versions.py +52 -0
- agentcore/operations/config_bundle/resolve_bundle.py +65 -0
- agentcore/operations/connectors/__init__.py +3 -0
- agentcore/operations/connectors/translators.py +63 -0
- agentcore/operations/dataset/__init__.py +21 -0
- agentcore/operations/dataset/delete.py +7 -0
- agentcore/operations/dataset/publish.py +16 -0
- agentcore/operations/dataset/pull.py +21 -0
- agentcore/operations/dataset/push.py +201 -0
- agentcore/operations/dataset/resolve_dataset.py +65 -0
- agentcore/operations/dataset/status.py +18 -0
- agentcore/operations/dataset/wait.py +25 -0
- agentcore/operations/deploy/__init__.py +152 -0
- agentcore/operations/deploy/backfill_vpc_id.py +90 -0
- agentcore/operations/deploy/change_detection.py +84 -0
- agentcore/operations/deploy/constants.py +58 -0
- agentcore/operations/deploy/dependency_sync.py +105 -0
- agentcore/operations/deploy/ensure_target.py +30 -0
- agentcore/operations/deploy/gateway_status.py +44 -0
- agentcore/operations/deploy/managed_memory_notice.py +36 -0
- agentcore/operations/deploy/payment_connector_authorization.py +106 -0
- agentcore/operations/deploy/post_deploy_datasets.py +96 -0
- agentcore/operations/deploy/post_deploy_knowledge_bases.py +104 -0
- agentcore/operations/deploy/post_deploy_observability.py +28 -0
- agentcore/operations/deploy/post_deploy_online_evals.py +60 -0
- agentcore/operations/deploy/pre_deploy_identity.py +505 -0
- agentcore/operations/deploy/preflight.py +385 -0
- agentcore/operations/deploy/region_override.py +45 -0
- agentcore/operations/deploy/teardown.py +153 -0
- agentcore/operations/dev/__init__.py +61 -0
- agentcore/operations/dev/_http.py +79 -0
- agentcore/operations/dev/_server.py +165 -0
- agentcore/operations/dev/codezip_dev_server.py +151 -0
- agentcore/operations/dev/config.py +128 -0
- agentcore/operations/dev/constants.py +9 -0
- agentcore/operations/dev/container_dev_server.py +237 -0
- agentcore/operations/dev/container_runtime.py +37 -0
- agentcore/operations/dev/dev_server.py +244 -0
- agentcore/operations/dev/gateway_env.py +25 -0
- agentcore/operations/dev/invoke.py +214 -0
- agentcore/operations/dev/invoke_a2a.py +204 -0
- agentcore/operations/dev/invoke_agui.py +88 -0
- agentcore/operations/dev/invoke_mcp.py +145 -0
- agentcore/operations/dev/invoke_types.py +30 -0
- agentcore/operations/dev/load_dev_env.py +26 -0
- agentcore/operations/dev/memory_env.py +19 -0
- agentcore/operations/dev/otel/__init__.py +5 -0
- agentcore/operations/dev/otel/collector.py +234 -0
- agentcore/operations/dev/otel/transforms.py +331 -0
- agentcore/operations/dev/payment_env.py +50 -0
- agentcore/operations/dev/server.py +28 -0
- agentcore/operations/dev/sse_transform.py +30 -0
- agentcore/operations/dev/utils.py +152 -0
- agentcore/operations/dev/web_ui/__init__.py +31 -0
- agentcore/operations/dev/web_ui/constants.py +25 -0
- agentcore/operations/dev/web_ui/handlers/__init__.py +36 -0
- agentcore/operations/dev/web_ui/handlers/_common.py +36 -0
- agentcore/operations/dev/web_ui/handlers/_deployed.py +37 -0
- agentcore/operations/dev/web_ui/handlers/a2a_proxy.py +37 -0
- agentcore/operations/dev/web_ui/handlers/cloudwatch_traces.py +71 -0
- agentcore/operations/dev/web_ui/handlers/harness_invocation.py +89 -0
- agentcore/operations/dev/web_ui/handlers/harness_utils.py +95 -0
- agentcore/operations/dev/web_ui/handlers/invocations.py +327 -0
- agentcore/operations/dev/web_ui/handlers/mcp_proxy.py +119 -0
- agentcore/operations/dev/web_ui/handlers/memory.py +84 -0
- agentcore/operations/dev/web_ui/handlers/resources.py +351 -0
- agentcore/operations/dev/web_ui/handlers/start.py +182 -0
- agentcore/operations/dev/web_ui/handlers/status.py +25 -0
- agentcore/operations/dev/web_ui/handlers/traces.py +50 -0
- agentcore/operations/dev/web_ui/run_web_ui.py +60 -0
- agentcore/operations/dev/web_ui/web_server.py +297 -0
- agentcore/operations/eval/__init__.py +8 -0
- agentcore/operations/eval/list_eval_runs.py +18 -0
- agentcore/operations/eval/logs_eval.py +119 -0
- agentcore/operations/eval/pause_resume.py +90 -0
- agentcore/operations/eval/run_eval.py +354 -0
- agentcore/operations/eval/shared/__init__.py +0 -0
- agentcore/operations/eval/shared/dataset_loader.py +68 -0
- agentcore/operations/eval/shared/dataset_session_provider.py +122 -0
- agentcore/operations/eval/shared/evaluator_runner.py +89 -0
- agentcore/operations/eval/shared/scenario_executor.py +71 -0
- agentcore/operations/eval/shared/span_collector.py +255 -0
- agentcore/operations/eval/storage.py +67 -0
- agentcore/operations/feedback/__init__.py +21 -0
- agentcore/operations/feedback/aperture_client.py +98 -0
- agentcore/operations/feedback/build_payload.py +97 -0
- agentcore/operations/feedback/constants.py +26 -0
- agentcore/operations/feedback/submit_feedback.py +150 -0
- agentcore/operations/fetch_access/__init__.py +36 -0
- agentcore/operations/fetch_access/_target.py +17 -0
- agentcore/operations/fetch_access/fetch_gateway_token.py +75 -0
- agentcore/operations/fetch_access/fetch_harness_token.py +72 -0
- agentcore/operations/fetch_access/fetch_runtime_token.py +76 -0
- agentcore/operations/fetch_access/list_agents.py +18 -0
- agentcore/operations/fetch_access/list_gateways.py +26 -0
- agentcore/operations/fetch_access/list_harnesses.py +23 -0
- agentcore/operations/fetch_access/oauth_token.py +162 -0
- agentcore/operations/fetch_access/types.py +34 -0
- agentcore/operations/harness/__init__.py +1 -0
- agentcore/operations/harness/orphan.py +84 -0
- agentcore/operations/harness/skill_utils.py +56 -0
- agentcore/operations/identity/__init__.py +33 -0
- agentcore/operations/identity/api_key_credential_provider.py +68 -0
- agentcore/operations/identity/oauth2_credential_provider.py +95 -0
- agentcore/operations/ingest/__init__.py +184 -0
- agentcore/operations/init/__init__.py +3 -0
- agentcore/operations/init/files.py +59 -0
- agentcore/operations/insights/__init__.py +21 -0
- agentcore/operations/insights/insights_storage.py +67 -0
- agentcore/operations/insights/run_insights.py +148 -0
- agentcore/operations/invoke/__init__.py +5 -0
- agentcore/operations/invoke/resolve_agent_context.py +85 -0
- agentcore/operations/jobs/__init__.py +38 -0
- agentcore/operations/jobs/ab_test/__init__.py +0 -0
- agentcore/operations/jobs/ab_test/build_options.py +126 -0
- agentcore/operations/jobs/ab_test/format.py +121 -0
- agentcore/operations/jobs/ab_test/handler.py +412 -0
- agentcore/operations/jobs/ab_test/promote.py +142 -0
- agentcore/operations/jobs/ab_test/resolve.py +221 -0
- agentcore/operations/jobs/batch_evaluation/__init__.py +0 -0
- agentcore/operations/jobs/batch_evaluation/build_source.py +68 -0
- agentcore/operations/jobs/batch_evaluation/dataset_phase1.py +95 -0
- agentcore/operations/jobs/batch_evaluation/format.py +58 -0
- agentcore/operations/jobs/batch_evaluation/handler.py +203 -0
- agentcore/operations/jobs/insights/__init__.py +0 -0
- agentcore/operations/jobs/insights/format.py +65 -0
- agentcore/operations/jobs/insights/handler.py +178 -0
- agentcore/operations/jobs/recommendation/__init__.py +0 -0
- agentcore/operations/jobs/recommendation/apply_to_bundle.py +76 -0
- agentcore/operations/jobs/recommendation/build_config.py +271 -0
- agentcore/operations/jobs/recommendation/fetch_session_spans.py +93 -0
- agentcore/operations/jobs/recommendation/format.py +77 -0
- agentcore/operations/jobs/recommendation/handler.py +331 -0
- agentcore/operations/jobs/shared/__init__.py +0 -0
- agentcore/operations/jobs/shared/constants.py +85 -0
- agentcore/operations/jobs/shared/engine.py +187 -0
- agentcore/operations/jobs/shared/format.py +104 -0
- agentcore/operations/jobs/shared/region.py +34 -0
- agentcore/operations/jobs/shared/resolve_agent_state.py +30 -0
- agentcore/operations/jobs/shared/storage.py +117 -0
- agentcore/operations/jobs/shared/wait.py +30 -0
- agentcore/operations/knowledge_base/__init__.py +33 -0
- agentcore/operations/knowledge_base/connector_config.py +105 -0
- agentcore/operations/knowledge_base/hydrate_data_sources.py +59 -0
- agentcore/operations/mcp/__init__.py +4 -0
- agentcore/operations/memory/__init__.py +13 -0
- agentcore/operations/memory/_records.py +72 -0
- agentcore/operations/memory/list_memory_records.py +45 -0
- agentcore/operations/memory/retrieve_memory_records.py +52 -0
- agentcore/operations/node/__init__.py +15 -0
- agentcore/operations/node/setup.py +36 -0
- agentcore/operations/python/__init__.py +17 -0
- agentcore/operations/python/setup.py +47 -0
- agentcore/operations/resolve_agent.py +159 -0
- agentcore/operations/session/__init__.py +86 -0
- agentcore/operations/traces/__init__.py +29 -0
- agentcore/operations/traces/get_trace.py +202 -0
- agentcore/operations/traces/insights_query.py +74 -0
- agentcore/operations/traces/list_traces.py +46 -0
- agentcore/operations/traces/trace_url.py +25 -0
- agentcore/operations/traces/types.py +55 -0
- agentcore/primitives/__init__.py +0 -0
- agentcore/primitives/_gateway_target_wizard.py +293 -0
- agentcore/primitives/_gateway_validation.py +442 -0
- agentcore/primitives/_harness_cli.py +557 -0
- agentcore/primitives/_harness_validation.py +163 -0
- agentcore/primitives/_harness_wizard.py +726 -0
- agentcore/primitives/_knowledge_base_wizard.py +259 -0
- agentcore/primitives/_payment_wizard.py +331 -0
- agentcore/primitives/_policy_form.py +160 -0
- agentcore/primitives/agent.py +817 -0
- agentcore/primitives/auth_utils.py +77 -0
- agentcore/primitives/base.py +178 -0
- agentcore/primitives/capacity_provider.py +501 -0
- agentcore/primitives/config_bundle.py +329 -0
- agentcore/primitives/credential.py +387 -0
- agentcore/primitives/credential_utils.py +45 -0
- agentcore/primitives/dataset.py +211 -0
- agentcore/primitives/deployed_gateways.py +34 -0
- agentcore/primitives/evaluator.py +909 -0
- agentcore/primitives/gateway.py +496 -0
- agentcore/primitives/gateway_target.py +988 -0
- agentcore/primitives/harness.py +706 -0
- agentcore/primitives/knowledge_base.py +477 -0
- agentcore/primitives/memory.py +387 -0
- agentcore/primitives/online_eval_config.py +365 -0
- agentcore/primitives/online_insights.py +275 -0
- agentcore/primitives/payment_connector.py +427 -0
- agentcore/primitives/payment_eligible.py +20 -0
- agentcore/primitives/payment_manager.py +605 -0
- agentcore/primitives/payment_validation.py +68 -0
- agentcore/primitives/policy.py +622 -0
- agentcore/primitives/policy_engine.py +358 -0
- agentcore/primitives/registry.py +56 -0
- agentcore/primitives/runtime_endpoint.py +361 -0
- agentcore/primitives/secret_flag_warning.py +17 -0
- agentcore/schema/__init__.py +14 -0
- agentcore/schema/_zod.py +395 -0
- agentcore/schema/constants.py +306 -0
- agentcore/schema/schemas/__init__.py +40 -0
- agentcore/schema/schemas/agent_env.py +545 -0
- agentcore/schema/schemas/agentcore_project.py +530 -0
- agentcore/schema/schemas/auth.py +286 -0
- agentcore/schema/schemas/aws_targets.py +72 -0
- agentcore/schema/schemas/connections.py +187 -0
- agentcore/schema/schemas/deployed_state.py +322 -0
- agentcore/schema/schemas/mcp.py +650 -0
- agentcore/schema/schemas/mcp_defs.py +54 -0
- agentcore/schema/schemas/primitives/__init__.py +52 -0
- agentcore/schema/schemas/primitives/ab_test.py +162 -0
- agentcore/schema/schemas/primitives/capacity_provider.py +214 -0
- agentcore/schema/schemas/primitives/config_bundle.py +48 -0
- agentcore/schema/schemas/primitives/dataset.py +55 -0
- agentcore/schema/schemas/primitives/evaluator.py +171 -0
- agentcore/schema/schemas/primitives/harness.py +710 -0
- agentcore/schema/schemas/primitives/knowledge_base.py +90 -0
- agentcore/schema/schemas/primitives/memory.py +113 -0
- agentcore/schema/schemas/primitives/online_eval_config.py +77 -0
- agentcore/schema/schemas/primitives/payment.py +114 -0
- agentcore/schema/schemas/primitives/policy.py +83 -0
- agentcore/schema/schemas/primitives/tags.py +50 -0
- agentcore/schema/schemas/zod_util.py +5 -0
- agentcore/schema/types/__init__.py +3 -0
- agentcore/schema/types/path.py +16 -0
- agentcore/templates/__init__.py +115 -0
- agentcore/templates/_handlebars.py +782 -0
- agentcore/templates/_js.py +164 -0
- agentcore/templates/base_renderer.py +107 -0
- agentcore/templates/cdk_renderer.py +129 -0
- agentcore/templates/evaluator_renderer.py +39 -0
- agentcore/templates/gateway_target_renderer.py +69 -0
- agentcore/templates/llm_context/README.md +16 -0
- agentcore/templates/llm_context/agentcore.ts +685 -0
- agentcore/templates/llm_context/aws-targets.ts +51 -0
- agentcore/templates/profiles.py +151 -0
- agentcore/templates/render.py +92 -0
- agentcore/templates/renderers.py +83 -0
- agentcore/templates/schema_assets.py +23 -0
- agentcore/templates/template_root.py +28 -0
- agentcore/templates/types.py +192 -0
- agentcore_cli-0.31.1.dist-info/METADATA +84 -0
- agentcore_cli-0.31.1.dist-info/RECORD +655 -0
- agentcore_cli-0.31.1.dist-info/WHEEL +4 -0
- agentcore_cli-0.31.1.dist-info/entry_points.txt +2 -0
- agentcore_cli-0.31.1.dist-info/licenses/LICENSE +175 -0
- agentcore_cli-0.31.1.dist-info/licenses/NOTICE +88 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"""`agentcore status` registration and rendering (port of ``commands/status/command.tsx``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from collections.abc import Mapping
|
|
7
|
+
from datetime import datetime
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
from agentcore.aws import agentcore_datasets
|
|
13
|
+
from agentcore.cli.commands.status._guards import require_project
|
|
14
|
+
from agentcore.cli.commands.status.action import (
|
|
15
|
+
ResourceStatusEntry,
|
|
16
|
+
handle_project_status,
|
|
17
|
+
handle_runtime_lookup,
|
|
18
|
+
load_status_config,
|
|
19
|
+
)
|
|
20
|
+
from agentcore.cli.commands.status.constants import DEPLOYMENT_STATE_COLORS, DEPLOYMENT_STATE_LABELS
|
|
21
|
+
from agentcore.cli.constants import ANSI, COMMAND_DESCRIPTIONS
|
|
22
|
+
from agentcore.cli.errors import get_error_message
|
|
23
|
+
|
|
24
|
+
VALID_RESOURCE_TYPES = (
|
|
25
|
+
"agent",
|
|
26
|
+
"runtime-endpoint",
|
|
27
|
+
"memory",
|
|
28
|
+
"credential",
|
|
29
|
+
"gateway",
|
|
30
|
+
"evaluator",
|
|
31
|
+
"online-eval",
|
|
32
|
+
"payment",
|
|
33
|
+
"policy-engine",
|
|
34
|
+
"policy",
|
|
35
|
+
"config-bundle",
|
|
36
|
+
"dataset",
|
|
37
|
+
"knowledge-base",
|
|
38
|
+
"harness",
|
|
39
|
+
"capacity-provider",
|
|
40
|
+
)
|
|
41
|
+
VALID_STATES = ("deployed", "local-only", "pending-removal")
|
|
42
|
+
|
|
43
|
+
_COLOR = {"green": ANSI.green, "yellow": ANSI.yellow, "red": ANSI.red, "cyan": ANSI.cyan}
|
|
44
|
+
_BOLD = "\x1b[1m" if ANSI.reset else ""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _c(text: str, color: str | None) -> str:
|
|
48
|
+
code = _COLOR.get(color or "", "")
|
|
49
|
+
return f"{code}{text}{ANSI.reset}" if code else text
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _dim(text: str) -> str:
|
|
53
|
+
return f"{ANSI.dim}{text}{ANSI.reset}" if ANSI.dim else text
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _bold(text: str) -> str:
|
|
57
|
+
return f"{_BOLD}{text}{ANSI.reset}" if _BOLD else text
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def filter_resources(
|
|
61
|
+
resources: list[ResourceStatusEntry],
|
|
62
|
+
*,
|
|
63
|
+
type_: str | None = None,
|
|
64
|
+
state: str | None = None,
|
|
65
|
+
runtime: str | None = None,
|
|
66
|
+
name: str | None = None,
|
|
67
|
+
) -> list[ResourceStatusEntry]:
|
|
68
|
+
out = resources
|
|
69
|
+
if type_:
|
|
70
|
+
out = [r for r in out if r["resourceType"] == type_]
|
|
71
|
+
if state:
|
|
72
|
+
out = [r for r in out if r["deploymentState"] == state]
|
|
73
|
+
if runtime:
|
|
74
|
+
out = [r for r in out if r["resourceType"] != "agent" or r["name"] == runtime]
|
|
75
|
+
# --name drills into one resource (meant for knowledge-base); a bare --name narrows across types.
|
|
76
|
+
if name:
|
|
77
|
+
out = [r for r in out if r["name"] == name]
|
|
78
|
+
return out
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _state_label(state: str) -> str:
|
|
82
|
+
return _c(DEPLOYMENT_STATE_LABELS.get(state, state), DEPLOYMENT_STATE_COLORS.get(state))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def format_resource_entry(entry: Mapping[str, Any], show_runtime: bool = False) -> str:
|
|
86
|
+
line = f" {entry['name']}: {_state_label(entry['deploymentState'])}"
|
|
87
|
+
if entry.get("detail"):
|
|
88
|
+
line += f" - Runtime: {entry['detail']}" if show_runtime else _dim(f" ({entry['detail']})")
|
|
89
|
+
if entry.get("identifier"):
|
|
90
|
+
line += _dim(f" ({entry['identifier']})")
|
|
91
|
+
if entry.get("error"):
|
|
92
|
+
line += _c(f" - Error: {entry['error']}", "red")
|
|
93
|
+
return line
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _short_date(epoch_seconds: float) -> str:
|
|
97
|
+
"""``toLocaleDateString([], {month: 'short', day: 'numeric', year: 'numeric'})`` in en-US form."""
|
|
98
|
+
dt = datetime.fromtimestamp(epoch_seconds)
|
|
99
|
+
return f"{dt.strftime('%b')} {dt.day}, {dt.year}"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def get_dataset_status(*, region: str, dataset_id: str, name: str) -> dict[str, Any]:
|
|
103
|
+
"""DRAFT info plus version history (port of ``operations/dataset/status.ts``)."""
|
|
104
|
+
info = agentcore_datasets.get_dataset(region=region, dataset_id=dataset_id)
|
|
105
|
+
versions = agentcore_datasets.list_dataset_versions(region=region, dataset_id=dataset_id)
|
|
106
|
+
return {
|
|
107
|
+
"name": name,
|
|
108
|
+
"datasetId": dataset_id,
|
|
109
|
+
"schemaType": info.get("schemaType"),
|
|
110
|
+
"status": info.get("status"),
|
|
111
|
+
"draftExampleCount": info.get("exampleCount"),
|
|
112
|
+
"draftStatus": info.get("draftStatus") or "UNKNOWN",
|
|
113
|
+
"updatedAt": info.get("updatedAt"),
|
|
114
|
+
"versions": versions.get("versions") or [],
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _section(lines: list[str], title: str) -> None:
|
|
119
|
+
lines.append("")
|
|
120
|
+
lines.append(_bold(title))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def render_status(result: Any, filtered: list[ResourceStatusEntry], dataset_details: list[dict[str, Any]]) -> str:
|
|
124
|
+
"""Plain-text rendering of upstream's Ink status view."""
|
|
125
|
+
by_type: dict[str, list[ResourceStatusEntry]] = {}
|
|
126
|
+
for entry in filtered:
|
|
127
|
+
by_type.setdefault(entry["resourceType"], []).append(entry)
|
|
128
|
+
|
|
129
|
+
def of(kind: str) -> list[ResourceStatusEntry]:
|
|
130
|
+
return by_type.get(kind, [])
|
|
131
|
+
|
|
132
|
+
region = f", {result.target_region}" if result.target_region else ""
|
|
133
|
+
target = result.target_name if result.target_name is not None else "No target configured"
|
|
134
|
+
lines = [_bold(f"AgentCore Status (target: {target}{region})")]
|
|
135
|
+
|
|
136
|
+
agents, endpoints = of("agent"), of("runtime-endpoint")
|
|
137
|
+
|
|
138
|
+
def endpoint_line(ep: Mapping[str, Any], label: str, indent: str) -> str:
|
|
139
|
+
detail = _dim(ep.get("detail") or "")
|
|
140
|
+
state = _c(
|
|
141
|
+
f"[{DEPLOYMENT_STATE_LABELS.get(ep['deploymentState'], ep['deploymentState'])}]",
|
|
142
|
+
DEPLOYMENT_STATE_COLORS.get(ep["deploymentState"]),
|
|
143
|
+
)
|
|
144
|
+
return f"{indent}◉ {label} {detail} {state}"
|
|
145
|
+
|
|
146
|
+
if agents:
|
|
147
|
+
_section(lines, "Agents")
|
|
148
|
+
for entry in agents:
|
|
149
|
+
lines.append(format_resource_entry(entry, show_runtime=True))
|
|
150
|
+
if entry.get("invocationUrl"):
|
|
151
|
+
lines.append(_dim(f" URL: {entry['invocationUrl']}"))
|
|
152
|
+
for ep in (e for e in endpoints if e.get("parentName") == entry["name"]):
|
|
153
|
+
lines.append(endpoint_line(ep, ep["name"], " "))
|
|
154
|
+
elif endpoints:
|
|
155
|
+
_section(lines, "Runtime Endpoints")
|
|
156
|
+
for ep in endpoints:
|
|
157
|
+
lines.append(endpoint_line(ep, f"{ep.get('parentName')}/{ep['name']}", " "))
|
|
158
|
+
|
|
159
|
+
for kind, title in (
|
|
160
|
+
("memory", "Memories"),
|
|
161
|
+
("credential", "Credentials"),
|
|
162
|
+
("gateway", "Gateways"),
|
|
163
|
+
("evaluator", "Evaluators"),
|
|
164
|
+
("online-eval", "Online Eval Configs"),
|
|
165
|
+
("policy-engine", "Policy Engines"),
|
|
166
|
+
("policy", "Policies"),
|
|
167
|
+
("config-bundle", "Config Bundles"),
|
|
168
|
+
):
|
|
169
|
+
if of(kind):
|
|
170
|
+
_section(lines, title)
|
|
171
|
+
lines.extend(format_resource_entry(e) for e in of(kind))
|
|
172
|
+
|
|
173
|
+
if of("dataset"):
|
|
174
|
+
_section(lines, "Datasets")
|
|
175
|
+
lines.extend(format_resource_entry(e) for e in of("dataset"))
|
|
176
|
+
for d in dataset_details:
|
|
177
|
+
lines.append("")
|
|
178
|
+
lines.append(" " + _bold(str(d["name"])))
|
|
179
|
+
lines.append(_dim(f" Schema: {d['schemaType']}"))
|
|
180
|
+
draft = _c(f"({d['draftStatus']})", "yellow" if d["draftStatus"] == "MODIFIED" else "green")
|
|
181
|
+
lines.append(
|
|
182
|
+
f" DRAFT: {d['draftExampleCount']} examples {draft} · Updated: {_short_date(d['updatedAt'])}"
|
|
183
|
+
)
|
|
184
|
+
if d["versions"]:
|
|
185
|
+
lines.append(_dim(" Versions:"))
|
|
186
|
+
for i, v in enumerate(d["versions"]):
|
|
187
|
+
body = (
|
|
188
|
+
_c(f"FAILED: {v['failureReason']}", "red")
|
|
189
|
+
if v.get("failureReason")
|
|
190
|
+
else f"{v.get('exampleCount')} examples"
|
|
191
|
+
)
|
|
192
|
+
text = (
|
|
193
|
+
f" v{v['datasetVersion']}{' (latest)' if i == 0 else ''} — {body}"
|
|
194
|
+
f" · Created: {_short_date(v['createdAt'])}"
|
|
195
|
+
)
|
|
196
|
+
lines.append(_dim(text) if i > 0 else text)
|
|
197
|
+
else:
|
|
198
|
+
lines.append(_dim(" No published versions"))
|
|
199
|
+
|
|
200
|
+
if of("knowledge-base"):
|
|
201
|
+
_section(lines, "Knowledge Bases")
|
|
202
|
+
lines.extend(format_resource_entry(e) for e in of("knowledge-base"))
|
|
203
|
+
|
|
204
|
+
if of("payment"):
|
|
205
|
+
_section(lines, "Payments")
|
|
206
|
+
for entry in of("payment"):
|
|
207
|
+
lines.append(format_resource_entry(entry))
|
|
208
|
+
for connector in entry.get("paymentConnectors") or []:
|
|
209
|
+
lines.append(f" {connector['name']}: {connector['status']} ({connector['connectorId']})")
|
|
210
|
+
if connector.get("authorizationUrl"):
|
|
211
|
+
lines.append(f" Authorization: {_c(connector['authorizationUrl'], 'cyan')}")
|
|
212
|
+
if connector.get("credentialProviderArn"):
|
|
213
|
+
lines.append(_dim(f" Credential provider: {connector['credentialProviderArn']}"))
|
|
214
|
+
if connector.get("error"):
|
|
215
|
+
lines.append(_c(f" {connector['error']}", "red"))
|
|
216
|
+
|
|
217
|
+
if of("harness"):
|
|
218
|
+
_section(lines, "Harnesses")
|
|
219
|
+
lines.extend(format_resource_entry(e) for e in of("harness"))
|
|
220
|
+
|
|
221
|
+
if not filtered:
|
|
222
|
+
lines.append(_dim("No resources match the given filters."))
|
|
223
|
+
return "\n".join(lines)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def _print_json(payload: Any) -> None:
|
|
227
|
+
typer.echo(json.dumps(payload, indent=2, ensure_ascii=False))
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def status_command(
|
|
231
|
+
runtime_id: str | None = typer.Option(None, "--runtime-id", help="Look up a specific runtime by ID"),
|
|
232
|
+
target: str | None = typer.Option(None, "--target", help="Select deployment target"),
|
|
233
|
+
type_: str | None = typer.Option(
|
|
234
|
+
None, "--type", help=f"Filter by resource type ({', '.join(VALID_RESOURCE_TYPES)})"
|
|
235
|
+
),
|
|
236
|
+
state: str | None = typer.Option(
|
|
237
|
+
None, "--state", help="Filter by deployment state (deployed, local-only, pending-removal)"
|
|
238
|
+
),
|
|
239
|
+
runtime: str | None = typer.Option(None, "--runtime", help="Filter to a specific runtime"),
|
|
240
|
+
name: str | None = typer.Option(None, "--name", help="Show details for a single resource by name (knowledge-base)"),
|
|
241
|
+
as_json: bool = typer.Option(False, "--json", help="Output as JSON"),
|
|
242
|
+
) -> None:
|
|
243
|
+
require_project()
|
|
244
|
+
|
|
245
|
+
if type_ and type_ not in VALID_RESOURCE_TYPES:
|
|
246
|
+
typer.echo(_c(f"Invalid resource type '{type_}'. Valid types: {', '.join(VALID_RESOURCE_TYPES)}", "red"))
|
|
247
|
+
raise typer.Exit(1)
|
|
248
|
+
if state and state not in VALID_STATES:
|
|
249
|
+
typer.echo(_c(f"Invalid state '{state}'. Valid states: {', '.join(VALID_STATES)}", "red"))
|
|
250
|
+
raise typer.Exit(1)
|
|
251
|
+
|
|
252
|
+
try:
|
|
253
|
+
if runtime_id:
|
|
254
|
+
lookup = handle_runtime_lookup(load_status_config(), agent_runtime_id=runtime_id, target_name=target)
|
|
255
|
+
if not lookup.success:
|
|
256
|
+
if as_json:
|
|
257
|
+
_print_json(lookup.to_json())
|
|
258
|
+
else:
|
|
259
|
+
typer.echo(_c(str(lookup.error), "red"))
|
|
260
|
+
raise typer.Exit(1)
|
|
261
|
+
if as_json:
|
|
262
|
+
_print_json(lookup.to_json())
|
|
263
|
+
return
|
|
264
|
+
status_text = f" - Runtime status: {lookup.runtime_status}" if lookup.runtime_status else ""
|
|
265
|
+
typer.echo(f"AgentCore Status - {lookup.runtime_id} (target: {lookup.target_name}){status_text}")
|
|
266
|
+
return
|
|
267
|
+
|
|
268
|
+
kb_name = name if name and (not type_ or type_ == "knowledge-base") else None
|
|
269
|
+
result = handle_project_status(load_status_config(), target_name=target, knowledge_base_name=kb_name)
|
|
270
|
+
if not result.success:
|
|
271
|
+
if as_json:
|
|
272
|
+
_print_json(result.to_json())
|
|
273
|
+
else:
|
|
274
|
+
typer.echo(_c(str(result.error), "red"))
|
|
275
|
+
raise typer.Exit(1)
|
|
276
|
+
|
|
277
|
+
filtered = filter_resources(result.resources, type_=type_, state=state, runtime=runtime, name=name)
|
|
278
|
+
if as_json:
|
|
279
|
+
_print_json(result.to_json(filtered))
|
|
280
|
+
return
|
|
281
|
+
|
|
282
|
+
dataset_details: list[dict[str, Any]] = []
|
|
283
|
+
datasets = [r for r in filtered if r["resourceType"] == "dataset"]
|
|
284
|
+
if type_ == "dataset" and datasets and result.target_region and result.target_name:
|
|
285
|
+
deployed = (
|
|
286
|
+
((result.deployed_state.get("targets") or {}).get(result.target_name) or {}).get("resources") or {}
|
|
287
|
+
).get("datasets") or {}
|
|
288
|
+
for d in datasets:
|
|
289
|
+
if d["deploymentState"] == "deployed" and deployed.get(d["name"]):
|
|
290
|
+
try:
|
|
291
|
+
dataset_details.append(
|
|
292
|
+
get_dataset_status(
|
|
293
|
+
region=result.target_region, dataset_id=deployed[d["name"]]["datasetId"], name=d["name"]
|
|
294
|
+
)
|
|
295
|
+
)
|
|
296
|
+
except Exception: # noqa: BLE001
|
|
297
|
+
pass
|
|
298
|
+
|
|
299
|
+
typer.echo(render_status(result, filtered, dataset_details))
|
|
300
|
+
except typer.Exit:
|
|
301
|
+
raise
|
|
302
|
+
except Exception as exc: # noqa: BLE001
|
|
303
|
+
typer.echo(_c(f"Error: {get_error_message(exc)}", "red"))
|
|
304
|
+
raise typer.Exit(1) from None
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def register_status(app: typer.Typer) -> None:
|
|
308
|
+
description = COMMAND_DESCRIPTIONS["status"]
|
|
309
|
+
app.command("status", help=description)(status_command)
|
|
310
|
+
app.command("s", help=description, hidden=True)(status_command)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
__all__ = [
|
|
314
|
+
"VALID_RESOURCE_TYPES",
|
|
315
|
+
"VALID_STATES",
|
|
316
|
+
"filter_resources",
|
|
317
|
+
"format_resource_entry",
|
|
318
|
+
"get_dataset_status",
|
|
319
|
+
"register_status",
|
|
320
|
+
"render_status",
|
|
321
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Status display constants (port of ``commands/status/constants.ts``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Literal
|
|
6
|
+
from urllib.parse import quote
|
|
7
|
+
|
|
8
|
+
from agentcore.aws.partition import service_endpoint
|
|
9
|
+
|
|
10
|
+
ResourceDeploymentState = Literal["deployed", "local-only", "pending-removal"]
|
|
11
|
+
|
|
12
|
+
# STATUS_COLORS from tui/theme.ts: success green, warning yellow, error red.
|
|
13
|
+
DEPLOYMENT_STATE_COLORS: dict[str, str] = {"deployed": "green", "local-only": "yellow", "pending-removal": "red"}
|
|
14
|
+
|
|
15
|
+
DEPLOYMENT_STATE_LABELS: dict[str, str] = {
|
|
16
|
+
"deployed": "Deployed",
|
|
17
|
+
"local-only": "Local only",
|
|
18
|
+
"pending-removal": "Removed locally",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def encode_uri_component(value: str) -> str:
|
|
23
|
+
return quote(value, safe="-_.!~*'()")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def build_runtime_invocation_url(region: str, runtime_arn: str) -> str:
|
|
27
|
+
return f"https://{service_endpoint('bedrock-agentcore', region)}/runtimes/{encode_uri_component(runtime_arn)}/invocations"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"DEPLOYMENT_STATE_COLORS",
|
|
32
|
+
"DEPLOYMENT_STATE_LABELS",
|
|
33
|
+
"ResourceDeploymentState",
|
|
34
|
+
"build_runtime_invocation_url",
|
|
35
|
+
"encode_uri_component",
|
|
36
|
+
]
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"""Knowledge base status rendering (port of ``commands/status/format-knowledge-base.ts``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class KbIngestionDetail:
|
|
10
|
+
status: str | None = None
|
|
11
|
+
started_at: str | None = None
|
|
12
|
+
updated_at: str | None = None
|
|
13
|
+
completed_at: str | None = None
|
|
14
|
+
scanned: int | None = None
|
|
15
|
+
indexed: int | None = None
|
|
16
|
+
modified: int | None = None
|
|
17
|
+
failed: int | None = None
|
|
18
|
+
deleted: int | None = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class KbDataSourceDetail:
|
|
23
|
+
uri: str
|
|
24
|
+
data_source_id: str
|
|
25
|
+
ingestion: KbIngestionDetail | None = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass
|
|
29
|
+
class KbStatusDetail:
|
|
30
|
+
name: str
|
|
31
|
+
knowledge_base_id: str
|
|
32
|
+
status: str | None = None
|
|
33
|
+
gateway_names: list[str] = field(default_factory=list)
|
|
34
|
+
data_sources: list[KbDataSourceDetail] = field(default_factory=list)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
FAILURE_HINTS = [
|
|
38
|
+
"Next steps:",
|
|
39
|
+
" → Retry ingestion: agentcore run ingest --name <kb>",
|
|
40
|
+
" → Common causes:",
|
|
41
|
+
" • Document format not supported (.txt, .md, .html, .pdf, .doc, .csv, .xls)",
|
|
42
|
+
" • File exceeds 50MB size limit",
|
|
43
|
+
" • S3 bucket permissions — ensure the KB role has s3:GetObject access",
|
|
44
|
+
" • Data source credentials expired (Confluence, SharePoint, etc.)",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def format_knowledge_base_detail(kb: KbStatusDetail) -> list[str]:
|
|
49
|
+
"""The multi-line KB status block (``status --type knowledge-base --name X``)."""
|
|
50
|
+
lines = [f"Knowledge Base: {kb.name}"]
|
|
51
|
+
mark = "✓" if kb.status == "ACTIVE" else "⟳"
|
|
52
|
+
lines.append(f" Knowledge Base: {mark} {kb.status or 'UNKNOWN'} ({kb.knowledge_base_id})")
|
|
53
|
+
any_failed = False
|
|
54
|
+
lines.append(f" Data Sources ({len(kb.data_sources)}):")
|
|
55
|
+
for ds in kb.data_sources:
|
|
56
|
+
ing = ds.ingestion
|
|
57
|
+
status = ing.status if ing else None
|
|
58
|
+
ds_mark = "✗" if status == "FAILED" else "✓" if status in ("COMPLETE", "SUCCEEDED") else "⟳"
|
|
59
|
+
lines.append(f" {ds_mark} {ds.uri} ({ds.data_source_id})")
|
|
60
|
+
if ing:
|
|
61
|
+
if ing.status == "FAILED":
|
|
62
|
+
any_failed = True
|
|
63
|
+
lines.append(f" Ingestion: {ing.status or 'UNKNOWN'}")
|
|
64
|
+
if ing.started_at:
|
|
65
|
+
lines.append(f" Started: {ing.started_at}")
|
|
66
|
+
if ing.completed_at:
|
|
67
|
+
lines.append(f" Completed: {ing.completed_at}")
|
|
68
|
+
elif ing.updated_at:
|
|
69
|
+
lines.append(f" Updated: {ing.updated_at}")
|
|
70
|
+
lines.append(
|
|
71
|
+
f" Documents: {ing.scanned or 0} scanned, {ing.indexed or 0} new indexed, "
|
|
72
|
+
f"{ing.modified or 0} modified, {ing.failed or 0} failed, {ing.deleted or 0} deleted"
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
lines.append(" Ingestion: never run")
|
|
76
|
+
if kb.gateway_names:
|
|
77
|
+
lines.append(f" Gateways: {', '.join(kb.gateway_names)}")
|
|
78
|
+
lines.append(" Tools: retrieve (available)")
|
|
79
|
+
if any_failed:
|
|
80
|
+
lines.append("")
|
|
81
|
+
lines.extend(f" {h}" for h in FAILURE_HINTS)
|
|
82
|
+
return lines
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def format_knowledge_base_summary_line(kb: KbStatusDetail) -> str:
|
|
86
|
+
"""One-line rollup used when no ``--name`` drill-down is requested."""
|
|
87
|
+
total_indexed = sum((ds.ingestion.indexed or 0) if ds.ingestion else 0 for ds in kb.data_sources)
|
|
88
|
+
any_failed = any(ds.ingestion and ds.ingestion.status == "FAILED" for ds in kb.data_sources)
|
|
89
|
+
ingesting = any(
|
|
90
|
+
ds.ingestion and (ds.ingestion.status or "") in ("IN_PROGRESS", "STARTING", "SUBMITTED")
|
|
91
|
+
for ds in kb.data_sources
|
|
92
|
+
)
|
|
93
|
+
if any_failed:
|
|
94
|
+
state = "✗ Failed"
|
|
95
|
+
elif ingesting:
|
|
96
|
+
state = "⟳ Ingesting"
|
|
97
|
+
elif kb.status == "ACTIVE":
|
|
98
|
+
state = "✓ Ready"
|
|
99
|
+
else:
|
|
100
|
+
state = kb.status or "Unknown"
|
|
101
|
+
count = len(kb.data_sources)
|
|
102
|
+
return f"{kb.name}: {state} ({count} data source{'s' if count != 1 else ''}, {total_indexed} indexed)"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
__all__ = [
|
|
106
|
+
"KbDataSourceDetail",
|
|
107
|
+
"KbIngestionDetail",
|
|
108
|
+
"KbStatusDetail",
|
|
109
|
+
"format_knowledge_base_detail",
|
|
110
|
+
"format_knowledge_base_summary_line",
|
|
111
|
+
]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""`agentcore telemetry` (port of src/cli/commands/telemetry and src/cli/telemetry/config.ts).
|
|
2
|
+
|
|
3
|
+
The preference is read and stored exactly as upstream so both CLIs agree on it, but this
|
|
4
|
+
port never sends telemetry.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Literal
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
from agentcore.lib.schemas.io.global_config import GlobalConfig, get_global_config_file, read_global_config
|
|
14
|
+
|
|
15
|
+
DESCRIPTION = "Manage anonymous usage analytics preferences."
|
|
16
|
+
ENV_VAR_NAME = "AGENTCORE_TELEMETRY_DISABLED"
|
|
17
|
+
|
|
18
|
+
HELP_EPILOG = """\
|
|
19
|
+
Manage Telemetry Preferences:
|
|
20
|
+
Opt in: agentcore config telemetry.enabled true
|
|
21
|
+
Opt out: agentcore config telemetry.enabled false
|
|
22
|
+
Status: agentcore telemetry status
|
|
23
|
+
|
|
24
|
+
This Python port does not send telemetry; the preference is shared with the npm CLI.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(frozen=True)
|
|
29
|
+
class TelemetryPreference:
|
|
30
|
+
enabled: bool
|
|
31
|
+
source: Literal["environment", "global-config", "default"]
|
|
32
|
+
env_var: tuple[str, str] | None = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def resolve_telemetry_preference(config: GlobalConfig | None = None) -> TelemetryPreference:
|
|
36
|
+
env_value = os.environ.get(ENV_VAR_NAME)
|
|
37
|
+
if env_value is not None:
|
|
38
|
+
normalized = env_value.lower().strip()
|
|
39
|
+
if normalized in ("false", "0"):
|
|
40
|
+
return TelemetryPreference(True, "environment", (ENV_VAR_NAME, env_value))
|
|
41
|
+
if normalized:
|
|
42
|
+
return TelemetryPreference(False, "environment", (ENV_VAR_NAME, env_value))
|
|
43
|
+
|
|
44
|
+
if config is None:
|
|
45
|
+
read = read_global_config()
|
|
46
|
+
config = read.value if read.success else GlobalConfig()
|
|
47
|
+
enabled = (config.get("telemetry") or {}).get("enabled")
|
|
48
|
+
if isinstance(enabled, bool):
|
|
49
|
+
return TelemetryPreference(enabled, "global-config")
|
|
50
|
+
return TelemetryPreference(True, "default")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def handle_telemetry_status(config_file: str | None = None) -> None:
|
|
54
|
+
config_file = config_file or get_global_config_file()
|
|
55
|
+
read = read_global_config(config_file)
|
|
56
|
+
pref = resolve_telemetry_preference(read.value if read.success else GlobalConfig())
|
|
57
|
+
|
|
58
|
+
source_label = {
|
|
59
|
+
"environment": "environment variable",
|
|
60
|
+
"global-config": f"global config ({config_file})",
|
|
61
|
+
"default": "default",
|
|
62
|
+
}[pref.source]
|
|
63
|
+
|
|
64
|
+
typer.echo(f"Telemetry: {'Enabled' if pref.enabled else 'Disabled'}")
|
|
65
|
+
typer.echo(f"Source: {source_label}")
|
|
66
|
+
if pref.env_var:
|
|
67
|
+
name, value = pref.env_var
|
|
68
|
+
typer.echo(f"\nNote: {name}={value} is set in your environment.")
|
|
69
|
+
typer.echo("\nThis Python CLI does not send telemetry; the preference applies to the npm CLI.")
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def register(app: typer.Typer) -> None:
|
|
73
|
+
telemetry = typer.Typer(help=DESCRIPTION, epilog=HELP_EPILOG, no_args_is_help=True)
|
|
74
|
+
|
|
75
|
+
@telemetry.command("status", help="Show current telemetry preference and source")
|
|
76
|
+
def status() -> None:
|
|
77
|
+
handle_telemetry_status()
|
|
78
|
+
|
|
79
|
+
app.add_typer(telemetry, name="telemetry")
|