agentkit-sdk-python 0.5.9__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/PKG-INFO +2 -1
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/agent_server_app.py +37 -2
- agentkit_sdk_python-0.6.0/agentkit/apps/agent_server_app/origin.py +190 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/__init__.py +100 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/_openapi.py +173 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/_redact.py +55 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/_sigv4.py +95 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/admin.py +500 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/credential_hosting.py +529 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/errors.py +41 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/oauth.py +221 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/profile.py +161 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/providers.py +87 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/resolve.py +184 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/session.py +218 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/ssl_trust.py +109 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/sso.py +153 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/store.py +127 -0
- agentkit_sdk_python-0.6.0/agentkit/auth/sts.py +141 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/client/base_service_client.py +3 -1
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/configuration.py +68 -6
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/client.py +2 -4
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/types.py +110 -126
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli.py +16 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/cli_auth.py +538 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/__init__.py +29 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli.py +36 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_create.py +344 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_exec.py +334 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_get.py +106 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_shell.py +106 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/session_create.py +361 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/session_sync.py +101 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/tool_resolve.py +237 -0
- agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/utils.py +381 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/tos_service.py +107 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/version.py +1 -1
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/PKG-INFO +2 -1
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/SOURCES.txt +28 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/requires.txt +1 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/pyproject.toml +2 -1
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/LICENSE +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/MANIFEST.in +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/README.md +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/a2a_app.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/middleware.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/base_app.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/mcp_app.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/simple_app.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/simple_app_handlers.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/apps/utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/client/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/client/base_agentkit_client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/client/base_iam_client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/console_urls.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/constants.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/context.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/platform/provider.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/account/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/account/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/identity/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/identity/auth.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/types.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/base.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/local_docker.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/ve_pipeline.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/__main__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_build.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_deploy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_destroy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_init.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_invoke.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_knowledge.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_launch.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_memory.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_runtime.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_skills.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_skills_workflow.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_status.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_tools.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_version.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/console_reporter.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/interactive_config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/choice_resolvers.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/cloud_provider.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config_handler.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config_validator.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/constants.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/dataclass_utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/docker_build_config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/global_config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/region_defaults.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/region_resolver.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/strategy_configs.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/context.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/base_images.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/container.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/errors.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/base_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/build_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/deploy_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/init_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/invoke_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/lifecycle_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/status_executor.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/models.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/reporter.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/a2a.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/agent_server.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/basic.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/langchain_basic_stream.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/main.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/agent.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/build.sh +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/go.mod +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/go.sum +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/main.go +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/base.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/local_docker.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/ve_agentkit.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/builder.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/client.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/deployer.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/initializer.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/invoker.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/lifecycle.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/status.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/base_strategy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/cloud_strategy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/hybrid_strategy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/local_strategy.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/utils/agent_parser.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/cr.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/iam.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/sts.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/global_config_io.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/logging_config.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/misc.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/request.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/template_utils.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit/utils/ve_sign.py +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/setup.cfg +0 -0
- {agentkit_sdk_python-0.5.9 → agentkit_sdk_python-0.6.0}/tests/test_client_uses_platform_context.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentkit-sdk-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Python SDK for transforming any AI agent into a production-ready application. Framework-agnostic primitives for runtime, memory, authentication, and tools with volcengine-managed infrastructure.
|
|
5
5
|
Author-email: Xiangrui Cheng <innsdcc@gmail.com>, Yumeng Bao <baoyumeng.123@gmail.com>, Yaozheng Fang <fangyozheng@gmail.com>, Guodong Li <cu.eric.lee@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,6 +238,7 @@ Requires-Dist: tos>=2.8.7
|
|
|
238
238
|
Requires-Dist: volcengine
|
|
239
239
|
Requires-Dist: pyfiglet>=1.0.2
|
|
240
240
|
Requires-Dist: typing_extensions>=4.12
|
|
241
|
+
Requires-Dist: websocket-client>=1.8.0
|
|
241
242
|
Requires-Dist: pyreadline3; sys_platform == "win32"
|
|
242
243
|
Provides-Extra: extensions
|
|
243
244
|
Provides-Extra: toolkit
|
|
@@ -49,6 +49,13 @@ from veadk.runner import Runner
|
|
|
49
49
|
from agentkit.apps.agent_server_app.middleware import (
|
|
50
50
|
AgentkitTelemetryHTTPMiddleware,
|
|
51
51
|
)
|
|
52
|
+
from agentkit.apps.agent_server_app.origin import (
|
|
53
|
+
add_cors_compat_middleware,
|
|
54
|
+
adk_supports_regex_origins,
|
|
55
|
+
resolve_agentkit_allow_origins,
|
|
56
|
+
split_allow_origins,
|
|
57
|
+
supports_get_fast_api_kwarg,
|
|
58
|
+
)
|
|
52
59
|
from agentkit.apps.agent_server_app.telemetry import telemetry
|
|
53
60
|
from agentkit.apps.base_app import BaseAgentkitApp
|
|
54
61
|
|
|
@@ -101,6 +108,7 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
101
108
|
*,
|
|
102
109
|
app: App | None = None,
|
|
103
110
|
allow_origins: list[str] | None = None,
|
|
111
|
+
allow_origin_regex: str | list[str] | None = None,
|
|
104
112
|
) -> None:
|
|
105
113
|
super().__init__()
|
|
106
114
|
|
|
@@ -153,9 +161,36 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
153
161
|
await handler()
|
|
154
162
|
yield
|
|
155
163
|
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
resolved_allow_origins = resolve_agentkit_allow_origins(
|
|
165
|
+
allow_origins=allow_origins,
|
|
166
|
+
allow_origin_regex=allow_origin_regex,
|
|
167
|
+
)
|
|
168
|
+
get_fast_api_app = self.server.get_fast_api_app
|
|
169
|
+
get_fast_api_app_kwargs: dict[str, Any] = {"lifespan": lifespan}
|
|
170
|
+
supports_allow_origins = supports_get_fast_api_kwarg(
|
|
171
|
+
get_fast_api_app, "allow_origins"
|
|
158
172
|
)
|
|
173
|
+
supports_regex_origins = adk_supports_regex_origins()
|
|
174
|
+
needs_cors_compat_middleware = False
|
|
175
|
+
|
|
176
|
+
if supports_allow_origins:
|
|
177
|
+
if supports_regex_origins:
|
|
178
|
+
get_fast_api_app_kwargs["allow_origins"] = (
|
|
179
|
+
resolved_allow_origins or None
|
|
180
|
+
)
|
|
181
|
+
else:
|
|
182
|
+
literal_origins, combined_regex = split_allow_origins(
|
|
183
|
+
resolved_allow_origins
|
|
184
|
+
)
|
|
185
|
+
get_fast_api_app_kwargs["allow_origins"] = literal_origins or None
|
|
186
|
+
needs_cors_compat_middleware = combined_regex is not None
|
|
187
|
+
else:
|
|
188
|
+
needs_cors_compat_middleware = bool(resolved_allow_origins)
|
|
189
|
+
|
|
190
|
+
self.app = get_fast_api_app(**get_fast_api_app_kwargs)
|
|
191
|
+
|
|
192
|
+
if needs_cors_compat_middleware:
|
|
193
|
+
add_cors_compat_middleware(self.app, resolved_allow_origins)
|
|
159
194
|
|
|
160
195
|
@self.app.post("/run_sse")
|
|
161
196
|
async def run_agent_sse(req: RunAgentRequest) -> StreamingResponse:
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import inspect
|
|
16
|
+
import os
|
|
17
|
+
import re
|
|
18
|
+
from collections.abc import Callable
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from fastapi import FastAPI
|
|
22
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
23
|
+
|
|
24
|
+
_REGEX_PREFIX = "regex:"
|
|
25
|
+
|
|
26
|
+
DEFAULT_AGENTKIT_ALLOW_ORIGINS = ["*"]
|
|
27
|
+
|
|
28
|
+
STRICT_AGENTKIT_HOSTED_ORIGINS = [
|
|
29
|
+
"https://console.volcengine.com",
|
|
30
|
+
"https://console.byteplus.com",
|
|
31
|
+
"regex:https://.*\\.volcengine\\.com",
|
|
32
|
+
"regex:https://.*\\.volceapi\\.com",
|
|
33
|
+
"regex:https://.*\\.byteplus\\.com",
|
|
34
|
+
"regex:https://.*\\.byteplusapi\\.com",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def resolve_agentkit_allow_origins(
|
|
39
|
+
*,
|
|
40
|
+
allow_origins: list[str] | None,
|
|
41
|
+
allow_origin_regex: str | list[str] | None = None,
|
|
42
|
+
) -> list[str]:
|
|
43
|
+
"""Resolve AgentKit CORS origins with SDK defaults and env overrides."""
|
|
44
|
+
|
|
45
|
+
env_origins = _get_env_list("AGENTKIT_ALLOW_ORIGINS", "ADK_ALLOW_ORIGINS")
|
|
46
|
+
env_regexes = _get_env_list(
|
|
47
|
+
"AGENTKIT_ALLOW_ORIGIN_REGEX",
|
|
48
|
+
"ADK_ALLOW_ORIGIN_REGEX",
|
|
49
|
+
)
|
|
50
|
+
if allow_origins is not None:
|
|
51
|
+
origins = list(allow_origins)
|
|
52
|
+
elif env_origins is not None or env_regexes is not None:
|
|
53
|
+
origins = env_origins or []
|
|
54
|
+
elif _truthy_env("AGENTKIT_DISABLE_DEFAULT_ALLOW_ORIGINS"):
|
|
55
|
+
origins = []
|
|
56
|
+
else:
|
|
57
|
+
origins = list(DEFAULT_AGENTKIT_ALLOW_ORIGINS)
|
|
58
|
+
|
|
59
|
+
if allow_origin_regex is None:
|
|
60
|
+
regexes = env_regexes or []
|
|
61
|
+
else:
|
|
62
|
+
regexes = _as_list(allow_origin_regex)
|
|
63
|
+
|
|
64
|
+
resolved = [_normalize_origin(origin) for origin in origins]
|
|
65
|
+
resolved.extend(_normalize_regex(pattern) for pattern in regexes)
|
|
66
|
+
|
|
67
|
+
deduped = _dedupe(resolved)
|
|
68
|
+
_validate_regex_origins(deduped)
|
|
69
|
+
return deduped
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def split_allow_origins(allow_origins: list[str]) -> tuple[list[str], str | None]:
|
|
73
|
+
"""Split ADK-style origins into literal origins and a combined regex."""
|
|
74
|
+
|
|
75
|
+
literal_origins: list[str] = []
|
|
76
|
+
regex_patterns: list[str] = []
|
|
77
|
+
for origin in allow_origins:
|
|
78
|
+
if origin.startswith(_REGEX_PREFIX):
|
|
79
|
+
pattern = origin[len(_REGEX_PREFIX) :]
|
|
80
|
+
if pattern:
|
|
81
|
+
regex_patterns.append(pattern)
|
|
82
|
+
else:
|
|
83
|
+
literal_origins.append(origin)
|
|
84
|
+
|
|
85
|
+
return literal_origins, "|".join(regex_patterns) if regex_patterns else None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def supports_get_fast_api_kwarg(func: Callable[..., Any], kwarg_name: str) -> bool:
|
|
89
|
+
"""Return whether a callable accepts a given keyword argument."""
|
|
90
|
+
|
|
91
|
+
try:
|
|
92
|
+
signature = inspect.signature(func)
|
|
93
|
+
except (TypeError, ValueError):
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
for parameter in signature.parameters.values():
|
|
97
|
+
if parameter.kind == inspect.Parameter.VAR_KEYWORD:
|
|
98
|
+
return True
|
|
99
|
+
return kwarg_name in signature.parameters
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def adk_supports_regex_origins() -> bool:
|
|
103
|
+
"""Return whether installed ADK understands `regex:` allow_origins entries."""
|
|
104
|
+
|
|
105
|
+
try:
|
|
106
|
+
from google.adk.cli import adk_web_server
|
|
107
|
+
|
|
108
|
+
return hasattr(adk_web_server, "_parse_cors_origins")
|
|
109
|
+
except Exception:
|
|
110
|
+
return False
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def add_cors_compat_middleware(app: FastAPI, allow_origins: list[str]) -> None:
|
|
114
|
+
"""Add CORS middleware for ADK versions that cannot parse regex origins."""
|
|
115
|
+
|
|
116
|
+
literal_origins, allow_origin_regex = split_allow_origins(allow_origins)
|
|
117
|
+
app.add_middleware(
|
|
118
|
+
CORSMiddleware,
|
|
119
|
+
allow_origins=literal_origins,
|
|
120
|
+
allow_origin_regex=allow_origin_regex,
|
|
121
|
+
allow_credentials=True,
|
|
122
|
+
allow_methods=["*"],
|
|
123
|
+
allow_headers=["*"],
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _normalize_origin(origin: str) -> str:
|
|
128
|
+
origin = origin.strip()
|
|
129
|
+
if not origin or origin == "*" or origin.startswith(_REGEX_PREFIX):
|
|
130
|
+
return origin
|
|
131
|
+
if "*" in origin:
|
|
132
|
+
return _normalize_regex(_glob_to_regex(origin))
|
|
133
|
+
return origin
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _normalize_regex(pattern: str) -> str:
|
|
137
|
+
pattern = pattern.strip()
|
|
138
|
+
if not pattern:
|
|
139
|
+
return pattern
|
|
140
|
+
if pattern.startswith(_REGEX_PREFIX):
|
|
141
|
+
return pattern
|
|
142
|
+
return f"{_REGEX_PREFIX}{pattern}"
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _glob_to_regex(origin: str) -> str:
|
|
146
|
+
return re.escape(origin).replace("\\*", ".*")
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _validate_regex_origins(origins: list[str]) -> None:
|
|
150
|
+
for origin in origins:
|
|
151
|
+
if not origin.startswith(_REGEX_PREFIX):
|
|
152
|
+
continue
|
|
153
|
+
pattern = origin[len(_REGEX_PREFIX) :]
|
|
154
|
+
try:
|
|
155
|
+
re.compile(pattern)
|
|
156
|
+
except re.error as e:
|
|
157
|
+
raise ValueError(f"Invalid allow origin regex '{pattern}': {e}") from e
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def _get_env_list(*names: str) -> list[str] | None:
|
|
161
|
+
for name in names:
|
|
162
|
+
value = os.getenv(name)
|
|
163
|
+
if value is None:
|
|
164
|
+
continue
|
|
165
|
+
return [item.strip() for item in value.split(",") if item.strip()]
|
|
166
|
+
return None
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _truthy_env(name: str) -> bool:
|
|
170
|
+
value = os.getenv(name, "")
|
|
171
|
+
return value.lower() in {"1", "true", "yes", "on"}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def _as_list(value: str | list[str] | None) -> list[str]:
|
|
175
|
+
if value is None:
|
|
176
|
+
return []
|
|
177
|
+
if isinstance(value, str):
|
|
178
|
+
return [value]
|
|
179
|
+
return list(value)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _dedupe(values: list[str]) -> list[str]:
|
|
183
|
+
seen: set[str] = set()
|
|
184
|
+
deduped: list[str] = []
|
|
185
|
+
for value in values:
|
|
186
|
+
if not value or value in seen:
|
|
187
|
+
continue
|
|
188
|
+
seen.add(value)
|
|
189
|
+
deduped.append(value)
|
|
190
|
+
return deduped
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""agentkit.auth — passwordless / SSO authentication for AgentKit.
|
|
16
|
+
|
|
17
|
+
A self-contained, dependency-free library (Python stdlib only) that lets a CLI
|
|
18
|
+
or any developer's program obtain Volcengine credentials in two ways:
|
|
19
|
+
|
|
20
|
+
* **AK/SK** — long-lived access keys from env / config (the existing behaviour).
|
|
21
|
+
* **SSO (OAuth 2.0 / OIDC)** — interactive browser login against a UserPool
|
|
22
|
+
(federating Feishu / ByteDance-SSO / any OIDC IdP), exchanged for **short-lived
|
|
23
|
+
STS credentials** via ``AssumeRoleWithOIDC``. No AK/SK ever touches disk.
|
|
24
|
+
|
|
25
|
+
The library is intentionally decoupled from the rest of the AgentKit SDK: it has
|
|
26
|
+
no import dependency on ``agentkit.client`` / ``agentkit.platform`` and can be
|
|
27
|
+
vendored or used on its own::
|
|
28
|
+
|
|
29
|
+
from agentkit.auth import login, load_session, AuthProfile
|
|
30
|
+
|
|
31
|
+
profile = AuthProfile(
|
|
32
|
+
name="my-pool",
|
|
33
|
+
issuer="https://userpool-<uid>.userpool.auth.id.cn-beijing.volces.com",
|
|
34
|
+
client_id="<PUBLIC_CLI_CLIENT_ID>",
|
|
35
|
+
role_trn="trn:iam::<ACCOUNT_ID>:role/<ROLE_NAME>",
|
|
36
|
+
provider_trn="trn:iam::<ACCOUNT_ID>:oidc-provider/<PROVIDER_NAME>",
|
|
37
|
+
region="cn-beijing",
|
|
38
|
+
)
|
|
39
|
+
session = login(profile) # opens a browser, returns an AuthSession
|
|
40
|
+
creds = session.credentials() # -> StsCredentials(ak, sk, token, expires_at)
|
|
41
|
+
|
|
42
|
+
The SDK wires this into its credential-resolution chain (see
|
|
43
|
+
``agentkit.platform.configuration``) so that ``agentkit login`` once makes every
|
|
44
|
+
subsequent command work with the resulting STS credentials — and an expired STS
|
|
45
|
+
session auto-refreshes from the cached OIDC refresh token without a new browser
|
|
46
|
+
round-trip.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
from __future__ import annotations
|
|
50
|
+
|
|
51
|
+
from agentkit.auth.errors import AuthError, NetworkError, SsoError
|
|
52
|
+
from agentkit.auth.oauth import OAuthClient, run_loopback_login
|
|
53
|
+
from agentkit.auth.profile import (
|
|
54
|
+
AuthProfile,
|
|
55
|
+
active_profile_name,
|
|
56
|
+
address_to_profile_name,
|
|
57
|
+
clear_active_profile,
|
|
58
|
+
list_profiles,
|
|
59
|
+
load_profile,
|
|
60
|
+
save_profile,
|
|
61
|
+
set_active_profile,
|
|
62
|
+
)
|
|
63
|
+
from agentkit.auth.providers import (
|
|
64
|
+
AkSkCredentialProvider,
|
|
65
|
+
CredentialProvider,
|
|
66
|
+
SsoStsCredentialProvider,
|
|
67
|
+
)
|
|
68
|
+
from agentkit.auth.resolve import discover_cli_config, resolve_profile
|
|
69
|
+
from agentkit.auth.session import AuthSession, StsCredentials
|
|
70
|
+
from agentkit.auth.sso import login, load_session, logout, whoami
|
|
71
|
+
from agentkit.auth.sts import assume_role_with_oidc, get_caller_identity
|
|
72
|
+
|
|
73
|
+
__all__ = [
|
|
74
|
+
"AuthError",
|
|
75
|
+
"AuthProfile",
|
|
76
|
+
"AuthSession",
|
|
77
|
+
"AkSkCredentialProvider",
|
|
78
|
+
"CredentialProvider",
|
|
79
|
+
"NetworkError",
|
|
80
|
+
"OAuthClient",
|
|
81
|
+
"SsoError",
|
|
82
|
+
"SsoStsCredentialProvider",
|
|
83
|
+
"StsCredentials",
|
|
84
|
+
"active_profile_name",
|
|
85
|
+
"address_to_profile_name",
|
|
86
|
+
"assume_role_with_oidc",
|
|
87
|
+
"clear_active_profile",
|
|
88
|
+
"discover_cli_config",
|
|
89
|
+
"get_caller_identity",
|
|
90
|
+
"list_profiles",
|
|
91
|
+
"load_profile",
|
|
92
|
+
"load_session",
|
|
93
|
+
"login",
|
|
94
|
+
"logout",
|
|
95
|
+
"resolve_profile",
|
|
96
|
+
"run_loopback_login",
|
|
97
|
+
"save_profile",
|
|
98
|
+
"set_active_profile",
|
|
99
|
+
"whoami",
|
|
100
|
+
]
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Minimal signed Volcengine OpenAPI client for the auth ADMIN commands.
|
|
16
|
+
|
|
17
|
+
Stdlib-only SigV4 (reusing :mod:`agentkit.auth._sigv4`) so the admin path that
|
|
18
|
+
provisions the UserPool client / IAM OIDC provider / STS role carries no
|
|
19
|
+
third-party dependency. Used only by ``agentkit auth admin`` — the end-user login
|
|
20
|
+
path never touches it. A mandatory ``GetCallerIdentity`` guard runs before any write.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
import json
|
|
26
|
+
import os
|
|
27
|
+
import urllib.error
|
|
28
|
+
import urllib.parse
|
|
29
|
+
import urllib.request
|
|
30
|
+
|
|
31
|
+
from agentkit.auth._sigv4 import sign_headers
|
|
32
|
+
from agentkit.auth.errors import AuthError
|
|
33
|
+
from agentkit.auth.ssl_trust import harden_default_ssl_context
|
|
34
|
+
|
|
35
|
+
_HOST = "open.volcengineapi.com"
|
|
36
|
+
# Services whose OpenAPI reads parameters from the query string, not a JSON body.
|
|
37
|
+
_QUERY_PARAM_SERVICES = {"iam"}
|
|
38
|
+
|
|
39
|
+
# Map common Volcengine error-code fragments to an actionable next step. Surfaced on
|
|
40
|
+
# ApiError.hint so a raw mid-provision failure tells the operator what to fix, not just
|
|
41
|
+
# the opaque code (important on a cold account where services/quotas aren't set up).
|
|
42
|
+
_REMEDIATION = (
|
|
43
|
+
("notinwhitelist", "this feature needs per-account whitelisting — request it, or use the default path (ticket mode / inline JWKS)."),
|
|
44
|
+
("servicenotfound", "this Volcengine service may not be enabled on this account — enable it in the console, then re-run."),
|
|
45
|
+
("invalidaction", "this service/action may be unavailable on this account — confirm the service is enabled (run `agentkit auth admin doctor`)."),
|
|
46
|
+
("nosuchentity", "the referenced IAM/AgentKit resource is missing — if it is 'AgentKitSandboxAccess', activate AgentKit on this account first."),
|
|
47
|
+
("policynotexist", "the referenced policy is missing — activate AgentKit on this account so its system policies exist."),
|
|
48
|
+
("accessdenied", "the provisioning credentials lack permission for this action — use an admin AK/SK with IAM/AgentKit rights."),
|
|
49
|
+
("nopermission", "the provisioning credentials lack permission for this action — use an admin AK/SK with IAM/AgentKit rights."),
|
|
50
|
+
("unauthorized", "the provisioning credentials lack permission for this action — use an admin AK/SK with IAM/AgentKit rights."),
|
|
51
|
+
("limitexceeded", "an account quota/limit was hit — request a quota increase or remove unused resources."),
|
|
52
|
+
("quota", "an account quota/limit was hit — request a quota increase or remove unused resources."),
|
|
53
|
+
("throttl", "the API is throttling — retry shortly."),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def remediation_for(code: str) -> str | None:
|
|
58
|
+
"""Best-effort actionable hint for a Volcengine error code, or None."""
|
|
59
|
+
c = (code or "").lower()
|
|
60
|
+
for frag, hint in _REMEDIATION:
|
|
61
|
+
if frag in c:
|
|
62
|
+
return hint
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ApiError(AuthError):
|
|
67
|
+
"""A Volcengine OpenAPI call returned an error. Subclasses AuthError so the CLI's
|
|
68
|
+
``except AuthError`` handlers surface it as a clean message, not a traceback.
|
|
69
|
+
|
|
70
|
+
Carries an actionable ``hint`` derived from the error code where possible."""
|
|
71
|
+
|
|
72
|
+
def __init__(self, action: str, code: str, message: str) -> None:
|
|
73
|
+
super().__init__(f"{action}: {code}: {message}", hint=remediation_for(code))
|
|
74
|
+
self.action = action
|
|
75
|
+
self.code = code
|
|
76
|
+
self.message = message
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class OpenApiClient:
|
|
80
|
+
"""Signed Volcengine OpenAPI caller with an account guard (admin use only)."""
|
|
81
|
+
|
|
82
|
+
def __init__(
|
|
83
|
+
self,
|
|
84
|
+
*,
|
|
85
|
+
access_key: str | None = None,
|
|
86
|
+
secret_key: str | None = None,
|
|
87
|
+
session_token: str | None = None,
|
|
88
|
+
region: str = "cn-beijing",
|
|
89
|
+
expect_account: str | None = None,
|
|
90
|
+
harden_ssl: bool = True,
|
|
91
|
+
) -> None:
|
|
92
|
+
if harden_ssl:
|
|
93
|
+
harden_default_ssl_context()
|
|
94
|
+
self.ak = access_key or os.getenv("VOLCENGINE_ACCESS_KEY") or os.getenv("VOLC_ACCESSKEY")
|
|
95
|
+
self.sk = secret_key or os.getenv("VOLCENGINE_SECRET_KEY") or os.getenv("VOLC_SECRETKEY")
|
|
96
|
+
self.token = session_token or os.getenv("VOLCENGINE_SESSION_TOKEN")
|
|
97
|
+
if not (self.ak and self.sk):
|
|
98
|
+
raise AuthError(
|
|
99
|
+
"admin provisioning needs Volcengine credentials.",
|
|
100
|
+
hint="export VOLCENGINE_ACCESS_KEY / VOLCENGINE_SECRET_KEY for the account that owns the UserPool.",
|
|
101
|
+
)
|
|
102
|
+
self.region = region
|
|
103
|
+
ident = self.call("sts", "GetCallerIdentity", "2018-01-01", {})
|
|
104
|
+
self.account_id = str(ident.get("AccountId") or "")
|
|
105
|
+
if expect_account and self.account_id != expect_account:
|
|
106
|
+
raise AuthError(
|
|
107
|
+
f"refusing to provision: caller account {self.account_id} != expected {expect_account}"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def call(self, service: str, action: str, version: str, body: dict) -> dict:
|
|
111
|
+
if service in _QUERY_PARAM_SERVICES:
|
|
112
|
+
query = {"Action": action, "Version": version}
|
|
113
|
+
for k, v in body.items():
|
|
114
|
+
if isinstance(v, (list, tuple)):
|
|
115
|
+
for i, item in enumerate(v):
|
|
116
|
+
query[f"{k}.{i + 1}"] = str(item)
|
|
117
|
+
else:
|
|
118
|
+
query[k] = str(v)
|
|
119
|
+
payload = b""
|
|
120
|
+
else:
|
|
121
|
+
query = {"Action": action, "Version": version}
|
|
122
|
+
payload = json.dumps(body).encode()
|
|
123
|
+
headers = sign_headers(
|
|
124
|
+
"POST", _HOST, query, payload,
|
|
125
|
+
access_key=self.ak, secret_key=self.sk, service=service, region=self.region,
|
|
126
|
+
session_token=self.token,
|
|
127
|
+
)
|
|
128
|
+
url = f"https://{_HOST}/?{urllib.parse.urlencode(query)}"
|
|
129
|
+
req = urllib.request.Request(url, data=payload, headers=headers, method="POST")
|
|
130
|
+
try:
|
|
131
|
+
raw = urllib.request.urlopen(req, timeout=30).read()
|
|
132
|
+
except urllib.error.HTTPError as exc:
|
|
133
|
+
raw = exc.read()
|
|
134
|
+
data = json.loads(raw)
|
|
135
|
+
err = (data.get("ResponseMetadata") or {}).get("Error")
|
|
136
|
+
if err:
|
|
137
|
+
raise ApiError(action, str(err.get("Code")), str(err.get("Message")))
|
|
138
|
+
return data.get("Result") or {}
|
|
139
|
+
|
|
140
|
+
def call_get(self, service: str, action: str, version: str, params: dict) -> dict:
|
|
141
|
+
"""GET-style signed call (params in the query string) — e.g. the vpc service."""
|
|
142
|
+
query = {"Action": action, "Version": version}
|
|
143
|
+
for k, v in params.items():
|
|
144
|
+
if isinstance(v, (list, tuple)):
|
|
145
|
+
for i, item in enumerate(v):
|
|
146
|
+
query[f"{k}.{i + 1}"] = str(item)
|
|
147
|
+
else:
|
|
148
|
+
query[k] = str(v)
|
|
149
|
+
headers = sign_headers(
|
|
150
|
+
"GET", _HOST, query, b"",
|
|
151
|
+
access_key=self.ak, secret_key=self.sk, service=service, region=self.region,
|
|
152
|
+
session_token=self.token,
|
|
153
|
+
)
|
|
154
|
+
url = f"https://{_HOST}/?{urllib.parse.urlencode(query)}"
|
|
155
|
+
req = urllib.request.Request(url, headers=headers, method="GET")
|
|
156
|
+
try:
|
|
157
|
+
raw = urllib.request.urlopen(req, timeout=30).read()
|
|
158
|
+
except urllib.error.HTTPError as exc:
|
|
159
|
+
raw = exc.read()
|
|
160
|
+
data = json.loads(raw)
|
|
161
|
+
err = (data.get("ResponseMetadata") or {}).get("Error")
|
|
162
|
+
if err:
|
|
163
|
+
raise ApiError(action, str(err.get("Code")), str(err.get("Message")))
|
|
164
|
+
return data.get("Result") or {}
|
|
165
|
+
|
|
166
|
+
def call_ok(self, service, action, version, body, *, ok=("Exist", "Duplicate", "Conflict", "AlreadyExist")):
|
|
167
|
+
"""Like :meth:`call` but swallow 'already exists'-style errors (idempotent ensure)."""
|
|
168
|
+
try:
|
|
169
|
+
return self.call(service, action, version, body)
|
|
170
|
+
except ApiError as exc:
|
|
171
|
+
if any(tok.lower() in exc.code.lower() for tok in ok):
|
|
172
|
+
return {}
|
|
173
|
+
raise
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Secret redaction for log/error output.
|
|
16
|
+
|
|
17
|
+
Auth flows shuttle tokens and STS secrets around; any of them can end up in an
|
|
18
|
+
exception body or a debug print. :func:`redact` scrubs the high-entropy strings
|
|
19
|
+
(JWTs, bearer/STS tokens, ``ak/sk`` style secrets) before they are surfaced.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import re
|
|
25
|
+
|
|
26
|
+
# JWTs: three base64url segments separated by dots.
|
|
27
|
+
_JWT = re.compile(r"\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b")
|
|
28
|
+
# Volcengine STS / access tokens and long opaque secrets (>= 16 url-safe chars).
|
|
29
|
+
_OPAQUE = re.compile(r"\b[A-Za-z0-9/+_-]{16,}={0,2}\b")
|
|
30
|
+
# Explicit secret-bearing query/JSON/header fields.
|
|
31
|
+
_FIELD = re.compile(
|
|
32
|
+
r"(?i)(\"?(?:access_token|refresh_token|id_token|client_secret|secret_access_key"
|
|
33
|
+
r"|secretkey|accesskeyid|accesskey|sessiontoken|session_token|authorization"
|
|
34
|
+
r"|apikey|api_key|token|password)\"?\s*[:=]\s*\"?(?:bearer\s+)?)"
|
|
35
|
+
r"([^\"&\s,}]+)"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def redact(text: str) -> str:
|
|
40
|
+
"""Return ``text`` with credential-looking substrings replaced by ``***``."""
|
|
41
|
+
if not text:
|
|
42
|
+
return text
|
|
43
|
+
text = _FIELD.sub(lambda m: m.group(1) + "***", text)
|
|
44
|
+
text = _JWT.sub("***", text)
|
|
45
|
+
text = _OPAQUE.sub("***", text)
|
|
46
|
+
return text
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def mask(secret: str | None, *, keep: int = 4) -> str:
|
|
50
|
+
"""Mask a secret, keeping only the last ``keep`` characters for recognition."""
|
|
51
|
+
if not secret:
|
|
52
|
+
return "<none>"
|
|
53
|
+
if len(secret) <= keep:
|
|
54
|
+
return "*" * len(secret)
|
|
55
|
+
return "*" * (len(secret) - keep) + secret[-keep:]
|