agentkit-sdk-python 0.5.10__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.
Files changed (224) hide show
  1. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/PKG-INFO +2 -1
  2. agentkit_sdk_python-0.6.0/agentkit/auth/__init__.py +100 -0
  3. agentkit_sdk_python-0.6.0/agentkit/auth/_openapi.py +173 -0
  4. agentkit_sdk_python-0.6.0/agentkit/auth/_redact.py +55 -0
  5. agentkit_sdk_python-0.6.0/agentkit/auth/_sigv4.py +95 -0
  6. agentkit_sdk_python-0.6.0/agentkit/auth/admin.py +500 -0
  7. agentkit_sdk_python-0.6.0/agentkit/auth/credential_hosting.py +529 -0
  8. agentkit_sdk_python-0.6.0/agentkit/auth/errors.py +41 -0
  9. agentkit_sdk_python-0.6.0/agentkit/auth/oauth.py +221 -0
  10. agentkit_sdk_python-0.6.0/agentkit/auth/profile.py +161 -0
  11. agentkit_sdk_python-0.6.0/agentkit/auth/providers.py +87 -0
  12. agentkit_sdk_python-0.6.0/agentkit/auth/resolve.py +184 -0
  13. agentkit_sdk_python-0.6.0/agentkit/auth/session.py +218 -0
  14. agentkit_sdk_python-0.6.0/agentkit/auth/ssl_trust.py +109 -0
  15. agentkit_sdk_python-0.6.0/agentkit/auth/sso.py +153 -0
  16. agentkit_sdk_python-0.6.0/agentkit/auth/store.py +127 -0
  17. agentkit_sdk_python-0.6.0/agentkit/auth/sts.py +141 -0
  18. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/client/base_service_client.py +3 -1
  19. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/configuration.py +68 -6
  20. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/client.py +2 -4
  21. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/types.py +110 -126
  22. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli.py +16 -0
  23. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/cli_auth.py +538 -0
  24. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/__init__.py +29 -0
  25. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli.py +36 -0
  26. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_create.py +344 -0
  27. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_exec.py +334 -0
  28. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_get.py +106 -0
  29. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/cli_shell.py +106 -0
  30. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/session_create.py +361 -0
  31. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/session_sync.py +101 -0
  32. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/tool_resolve.py +237 -0
  33. agentkit_sdk_python-0.6.0/agentkit/toolkit/cli/sandbox/utils.py +381 -0
  34. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/tos_service.py +107 -0
  35. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/version.py +1 -1
  36. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/PKG-INFO +2 -1
  37. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/SOURCES.txt +27 -0
  38. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/requires.txt +1 -0
  39. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/pyproject.toml +2 -1
  40. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/LICENSE +0 -0
  41. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/MANIFEST.in +0 -0
  42. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/README.md +0 -0
  43. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/__init__.py +0 -0
  44. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/__init__.py +0 -0
  45. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/__init__.py +0 -0
  46. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/a2a_app.py +0 -0
  47. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/a2a_app/telemetry.py +0 -0
  48. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/__init__.py +0 -0
  49. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/agent_server_app.py +0 -0
  50. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/middleware.py +0 -0
  51. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/origin.py +0 -0
  52. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/agent_server_app/telemetry.py +0 -0
  53. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/base_app.py +0 -0
  54. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/__init__.py +0 -0
  55. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/mcp_app.py +0 -0
  56. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/mcp_app/telemetry.py +0 -0
  57. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/__init__.py +0 -0
  58. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/simple_app.py +0 -0
  59. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/simple_app_handlers.py +0 -0
  60. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/simple_app/telemetry.py +0 -0
  61. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/apps/utils.py +0 -0
  62. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/client/__init__.py +0 -0
  63. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/client/base_agentkit_client.py +0 -0
  64. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/client/base_iam_client.py +0 -0
  65. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/__init__.py +0 -0
  66. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/console_urls.py +0 -0
  67. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/constants.py +0 -0
  68. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/context.py +0 -0
  69. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/platform/provider.py +0 -0
  70. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/__init__.py +0 -0
  71. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/account/client.py +0 -0
  72. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/account/types.py +0 -0
  73. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/identity/__init__.py +0 -0
  74. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/identity/auth.py +0 -0
  75. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/__init__.py +0 -0
  76. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/client.py +0 -0
  77. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/knowledge/types.py +0 -0
  78. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/__init__.py +0 -0
  79. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/client.py +0 -0
  80. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/mcp/types.py +0 -0
  81. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/__init__.py +0 -0
  82. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/client.py +0 -0
  83. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/memory/types.py +0 -0
  84. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/__init__.py +0 -0
  85. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/client.py +0 -0
  86. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/runtime/types.py +0 -0
  87. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/__init__.py +0 -0
  88. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/client.py +0 -0
  89. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/skills/types.py +0 -0
  90. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/sdk/tools/__init__.py +0 -0
  91. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/__init__.py +0 -0
  92. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/__init__.py +0 -0
  93. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/base.py +0 -0
  94. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/local_docker.py +0 -0
  95. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/builders/ve_pipeline.py +0 -0
  96. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/__init__.py +0 -0
  97. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/__main__.py +0 -0
  98. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_build.py +0 -0
  99. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_config.py +0 -0
  100. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_deploy.py +0 -0
  101. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_destroy.py +0 -0
  102. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_init.py +0 -0
  103. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_invoke.py +0 -0
  104. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_knowledge.py +0 -0
  105. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_launch.py +0 -0
  106. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_memory.py +0 -0
  107. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_runtime.py +0 -0
  108. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_skills.py +0 -0
  109. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_skills_workflow.py +0 -0
  110. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_status.py +0 -0
  111. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_tools.py +0 -0
  112. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/cli_version.py +0 -0
  113. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/console_reporter.py +0 -0
  114. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/interactive_config.py +0 -0
  115. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/cli/utils.py +0 -0
  116. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/__init__.py +0 -0
  117. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/choice_resolvers.py +0 -0
  118. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/cloud_provider.py +0 -0
  119. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config.py +0 -0
  120. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config_handler.py +0 -0
  121. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/config_validator.py +0 -0
  122. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/constants.py +0 -0
  123. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/dataclass_utils.py +0 -0
  124. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/docker_build_config.py +0 -0
  125. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/global_config.py +0 -0
  126. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/region_defaults.py +0 -0
  127. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/region_resolver.py +0 -0
  128. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/strategy_configs.py +0 -0
  129. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/config/utils.py +0 -0
  130. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/context.py +0 -0
  131. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/__init__.py +0 -0
  132. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/base_images.py +0 -0
  133. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/container.py +0 -0
  134. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -0
  135. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
  136. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
  137. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/docker/utils.py +0 -0
  138. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/errors.py +0 -0
  139. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/__init__.py +0 -0
  140. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/base_executor.py +0 -0
  141. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/build_executor.py +0 -0
  142. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/deploy_executor.py +0 -0
  143. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/init_executor.py +0 -0
  144. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/invoke_executor.py +0 -0
  145. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/lifecycle_executor.py +0 -0
  146. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/executors/status_executor.py +0 -0
  147. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/models.py +0 -0
  148. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/reporter.py +0 -0
  149. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
  150. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
  151. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
  152. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
  153. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/a2a.py +0 -0
  154. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/agent_server.py +0 -0
  155. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/basic.py +0 -0
  156. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
  157. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
  158. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
  159. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
  160. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
  161. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
  162. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
  163. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
  164. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/langchain_basic_stream.py +0 -0
  165. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
  166. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
  167. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/agent.go +0 -0
  168. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/build.sh +0 -0
  169. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.mod +0 -0
  170. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.sum +0 -0
  171. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_a2a/main.go +0 -0
  172. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/agent.go +0 -0
  173. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/build.sh +0 -0
  174. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/go.mod +0 -0
  175. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/go.sum +0 -0
  176. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/samples/veadk_go_basic/main.go +0 -0
  177. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
  178. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
  179. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
  180. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
  181. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
  182. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/__init__.py +0 -0
  183. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/base.py +0 -0
  184. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/local_docker.py +0 -0
  185. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/runners/ve_agentkit.py +0 -0
  186. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/__init__.py +0 -0
  187. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
  188. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
  189. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/builder.py +0 -0
  190. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/client.py +0 -0
  191. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/config.py +0 -0
  192. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/deployer.py +0 -0
  193. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/initializer.py +0 -0
  194. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/invoker.py +0 -0
  195. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/lifecycle.py +0 -0
  196. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/sdk/status.py +0 -0
  197. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/__init__.py +0 -0
  198. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/base_strategy.py +0 -0
  199. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/cloud_strategy.py +0 -0
  200. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/hybrid_strategy.py +0 -0
  201. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/strategies/local_strategy.py +0 -0
  202. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/utils/__init__.py +0 -0
  203. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/utils/agent_parser.py +0 -0
  204. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/__init__.py +0 -0
  205. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
  206. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/cr.py +0 -0
  207. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/iam.py +0 -0
  208. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
  209. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
  210. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/sts.py +0 -0
  211. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
  212. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
  213. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/__init__.py +0 -0
  214. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/global_config_io.py +0 -0
  215. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/logging_config.py +0 -0
  216. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/misc.py +0 -0
  217. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/request.py +0 -0
  218. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/template_utils.py +0 -0
  219. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit/utils/ve_sign.py +0 -0
  220. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
  221. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
  222. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
  223. {agentkit_sdk_python-0.5.10 → agentkit_sdk_python-0.6.0}/setup.cfg +0 -0
  224. {agentkit_sdk_python-0.5.10 → 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.5.10
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
@@ -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:]
@@ -0,0 +1,95 @@
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
+ """Volcengine SigV4 (HMAC-SHA256) request signer — stdlib only.
16
+
17
+ A minimal, self-contained signer so :mod:`agentkit.auth` has no dependency on the
18
+ ``volcengine`` base SDK. Critically it supports an **STS session token**
19
+ (``X-Security-Token``), which the base SDK's helpers do not always expose, so STS
20
+ short-lived credentials can sign control-plane calls.
21
+ """
22
+
23
+ from __future__ import annotations
24
+
25
+ import datetime
26
+ import hashlib
27
+ import hmac
28
+ import urllib.parse
29
+
30
+
31
+ def _hmac(key: bytes, msg: str) -> bytes:
32
+ return hmac.new(key, msg.encode("utf-8"), hashlib.sha256).digest()
33
+
34
+
35
+ def sign_headers(
36
+ method: str,
37
+ host: str,
38
+ query: dict[str, str],
39
+ body: bytes,
40
+ *,
41
+ access_key: str,
42
+ secret_key: str,
43
+ service: str,
44
+ region: str,
45
+ session_token: str | None = None,
46
+ content_type: str = "application/json",
47
+ path: str = "/",
48
+ ) -> dict[str, str]:
49
+ """Sign a Volcengine OpenAPI request and return the full set of HTTP headers.
50
+
51
+ The returned dict can be replayed verbatim by any HTTP client; the signature
52
+ commits to ``content_type`` exactly, so callers must send that content type.
53
+ """
54
+ now = datetime.datetime.now(datetime.timezone.utc)
55
+ xdate = now.strftime("%Y%m%dT%H%M%SZ")
56
+ datestamp = xdate[:8]
57
+ payload_hash = hashlib.sha256(body).hexdigest()
58
+
59
+ signed: dict[str, str] = {
60
+ "content-type": content_type,
61
+ "host": host,
62
+ "x-content-sha256": payload_hash,
63
+ "x-date": xdate,
64
+ }
65
+ if session_token:
66
+ signed["x-security-token"] = session_token
67
+
68
+ signed_headers = ";".join(sorted(signed))
69
+ canon_headers = "".join(f"{k}:{signed[k]}\n" for k in sorted(signed))
70
+ canon_query = "&".join(
71
+ f"{urllib.parse.quote(k, safe='-_.~')}={urllib.parse.quote(str(v), safe='-_.~')}"
72
+ for k, v in sorted(query.items())
73
+ )
74
+ canon_req = f"{method}\n{path}\n{canon_query}\n{canon_headers}\n{signed_headers}\n{payload_hash}"
75
+
76
+ scope = f"{datestamp}/{region}/{service}/request"
77
+ string_to_sign = "\n".join(
78
+ ["HMAC-SHA256", xdate, scope, hashlib.sha256(canon_req.encode("utf-8")).hexdigest()]
79
+ )
80
+ k_signing = _hmac(_hmac(_hmac(_hmac(secret_key.encode("utf-8"), datestamp), region), service), "request")
81
+ signature = hmac.new(k_signing, string_to_sign.encode("utf-8"), hashlib.sha256).hexdigest()
82
+
83
+ headers = {
84
+ "Content-Type": content_type,
85
+ "Host": host,
86
+ "X-Date": xdate,
87
+ "X-Content-Sha256": payload_hash,
88
+ "Authorization": (
89
+ f"HMAC-SHA256 Credential={access_key}/{scope}, "
90
+ f"SignedHeaders={signed_headers}, Signature={signature}"
91
+ ),
92
+ }
93
+ if session_token:
94
+ headers["X-Security-Token"] = session_token
95
+ return headers