agentkit-sdk-python 0.7.2__tar.gz → 0.7.4__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 (260) hide show
  1. {agentkit_sdk_python-0.7.2/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.7.4}/PKG-INFO +8 -1
  2. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/model_login.py +87 -105
  3. agentkit_sdk_python-0.7.4/agentkit/frameworks/__init__.py +29 -0
  4. agentkit_sdk_python-0.7.4/agentkit/frameworks/_common.py +136 -0
  5. agentkit_sdk_python-0.7.4/agentkit/frameworks/langchain.py +170 -0
  6. agentkit_sdk_python-0.7.4/agentkit/frameworks/langgraph.py +349 -0
  7. agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/__init__.py +6 -0
  8. agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/fastapi_mount.py +65 -0
  9. agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/langserve.py +502 -0
  10. agentkit_sdk_python-0.7.4/agentkit/toolkit/cli/sandbox/a2a_client.py +407 -0
  11. agentkit_sdk_python-0.7.4/agentkit/toolkit/cli/sandbox/agentkit_client.py +248 -0
  12. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli.py +5 -0
  13. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_create.py +219 -165
  14. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_exec.py +2 -70
  15. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_file.py +1 -1
  16. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_get.py +2 -6
  17. agentkit_sdk_python-0.7.4/agentkit/toolkit/cli/sandbox/cli_invoke.py +375 -0
  18. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_model_login.py +57 -70
  19. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_mount.py +1 -1
  20. agentkit_sdk_python-0.7.4/agentkit/toolkit/cli/sandbox/env_config.py +798 -0
  21. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/model_config.py +90 -29
  22. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/session_create.py +94 -168
  23. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/session_sync.py +1 -1
  24. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/tool_resolve.py +37 -73
  25. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/version.py +1 -1
  26. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4/agentkit_sdk_python.egg-info}/PKG-INFO +8 -1
  27. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/SOURCES.txt +11 -0
  28. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/requires.txt +10 -0
  29. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/pyproject.toml +4 -1
  30. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/LICENSE +0 -0
  31. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/MANIFEST.in +0 -0
  32. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/README.md +0 -0
  33. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/__init__.py +0 -0
  34. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/__init__.py +0 -0
  35. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/__init__.py +0 -0
  36. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/a2a_app.py +0 -0
  37. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/telemetry.py +0 -0
  38. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/__init__.py +0 -0
  39. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/agent_server_app.py +0 -0
  40. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/middleware.py +0 -0
  41. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/origin.py +0 -0
  42. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/telemetry.py +0 -0
  43. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/base_app.py +0 -0
  44. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/__init__.py +0 -0
  45. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/mcp_app.py +0 -0
  46. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/telemetry.py +0 -0
  47. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/__init__.py +0 -0
  48. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/simple_app.py +0 -0
  49. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/simple_app_handlers.py +0 -0
  50. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/telemetry.py +0 -0
  51. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/apps/utils.py +0 -0
  52. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/__init__.py +0 -0
  53. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/_openapi.py +0 -0
  54. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/_redact.py +0 -0
  55. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/_sigv4.py +0 -0
  56. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/admin.py +0 -0
  57. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/credential_hosting.py +0 -0
  58. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/errors.py +0 -0
  59. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/oauth.py +0 -0
  60. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/profile.py +0 -0
  61. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/providers.py +0 -0
  62. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/resolve.py +0 -0
  63. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/session.py +0 -0
  64. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/ssl_trust.py +0 -0
  65. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/sso.py +0 -0
  66. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/store.py +0 -0
  67. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/auth/sts.py +0 -0
  68. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/client/__init__.py +0 -0
  69. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/client/base_agentkit_client.py +0 -0
  70. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/client/base_iam_client.py +0 -0
  71. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/client/base_service_client.py +0 -0
  72. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/errors.py +0 -0
  73. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/__init__.py +0 -0
  74. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/configuration.py +0 -0
  75. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/console_urls.py +0 -0
  76. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/constants.py +0 -0
  77. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/context.py +0 -0
  78. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/platform/provider.py +0 -0
  79. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/__init__.py +0 -0
  80. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/account/client.py +0 -0
  81. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/account/types.py +0 -0
  82. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/__init__.py +0 -0
  83. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/auth.py +0 -0
  84. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/client.py +0 -0
  85. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/types.py +0 -0
  86. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/__init__.py +0 -0
  87. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/client.py +0 -0
  88. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/types.py +0 -0
  89. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/__init__.py +0 -0
  90. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/client.py +0 -0
  91. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/types.py +0 -0
  92. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/__init__.py +0 -0
  93. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/client.py +0 -0
  94. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/types.py +0 -0
  95. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/__init__.py +0 -0
  96. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/client.py +0 -0
  97. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/types.py +0 -0
  98. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/__init__.py +0 -0
  99. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/client.py +0 -0
  100. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/types.py +0 -0
  101. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/__init__.py +0 -0
  102. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/client.py +0 -0
  103. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/types.py +0 -0
  104. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/__init__.py +0 -0
  105. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/__init__.py +0 -0
  106. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/base.py +0 -0
  107. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/local_docker.py +0 -0
  108. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/ve_pipeline.py +0 -0
  109. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/__init__.py +0 -0
  110. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/__main__.py +0 -0
  111. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli.py +0 -0
  112. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_add.py +0 -0
  113. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_auth.py +0 -0
  114. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_build.py +0 -0
  115. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_config.py +0 -0
  116. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_delete.py +0 -0
  117. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_deploy.py +0 -0
  118. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_destroy.py +0 -0
  119. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_init.py +0 -0
  120. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_invoke.py +0 -0
  121. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_knowledge.py +0 -0
  122. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_launch.py +0 -0
  123. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_list.py +0 -0
  124. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_logs.py +0 -0
  125. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_memory.py +0 -0
  126. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_runtime.py +0 -0
  127. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skill.py +0 -0
  128. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skills.py +0 -0
  129. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skills_workflow.py +0 -0
  130. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_status.py +0 -0
  131. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_tools.py +0 -0
  132. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_version.py +0 -0
  133. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/console_reporter.py +0 -0
  134. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/interactive_config.py +0 -0
  135. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/__init__.py +0 -0
  136. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_run.py +0 -0
  137. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_shell.py +0 -0
  138. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_web.py +0 -0
  139. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/git_config.py +0 -0
  140. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/sandbox_client.py +0 -0
  141. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/tos_config.py +0 -0
  142. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/utils.py +0 -0
  143. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/__init__.py +0 -0
  144. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/choice_resolvers.py +0 -0
  145. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/cloud_provider.py +0 -0
  146. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config.py +0 -0
  147. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config_handler.py +0 -0
  148. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config_validator.py +0 -0
  149. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/constants.py +0 -0
  150. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/dataclass_utils.py +0 -0
  151. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/docker_build_config.py +0 -0
  152. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/global_config.py +0 -0
  153. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/region_defaults.py +0 -0
  154. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/region_resolver.py +0 -0
  155. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/strategy_configs.py +0 -0
  156. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/utils.py +0 -0
  157. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/context.py +0 -0
  158. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/__init__.py +0 -0
  159. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/base_images.py +0 -0
  160. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/container.py +0 -0
  161. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -0
  162. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
  163. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
  164. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/utils.py +0 -0
  165. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/errors.py +0 -0
  166. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/__init__.py +0 -0
  167. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/base_executor.py +0 -0
  168. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/build_executor.py +0 -0
  169. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/deploy_executor.py +0 -0
  170. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/init_executor.py +0 -0
  171. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/invoke_executor.py +0 -0
  172. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/lifecycle_executor.py +0 -0
  173. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/status_executor.py +0 -0
  174. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/__init__.py +0 -0
  175. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/config_builder.py +0 -0
  176. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/deploy.py +0 -0
  177. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/env_mapping.py +0 -0
  178. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/models.py +0 -0
  179. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/reporter.py +0 -0
  180. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
  181. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
  182. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
  183. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
  184. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/a2a.py +0 -0
  185. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/agent_server.py +0 -0
  186. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/basic.py +0 -0
  187. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
  188. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
  189. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
  190. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
  191. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
  192. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
  193. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
  194. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
  195. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/langchain_basic_stream.py +0 -0
  196. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
  197. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
  198. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/agent.go +0 -0
  199. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/build.sh +0 -0
  200. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.mod +0 -0
  201. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.sum +0 -0
  202. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/main.go +0 -0
  203. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/agent.go +0 -0
  204. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/build.sh +0 -0
  205. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/go.mod +0 -0
  206. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/go.sum +0 -0
  207. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/main.go +0 -0
  208. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
  209. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
  210. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
  211. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
  212. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
  213. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/__init__.py +0 -0
  214. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/base.py +0 -0
  215. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/local_docker.py +0 -0
  216. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/ve_agentkit.py +0 -0
  217. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/__init__.py +0 -0
  218. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
  219. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
  220. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/builder.py +0 -0
  221. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/client.py +0 -0
  222. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/config.py +0 -0
  223. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/deployer.py +0 -0
  224. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/initializer.py +0 -0
  225. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/invoker.py +0 -0
  226. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/lifecycle.py +0 -0
  227. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/status.py +0 -0
  228. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/__init__.py +0 -0
  229. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/base_strategy.py +0 -0
  230. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/cloud_strategy.py +0 -0
  231. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/hybrid_strategy.py +0 -0
  232. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/local_strategy.py +0 -0
  233. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/utils/__init__.py +0 -0
  234. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/utils/agent_parser.py +0 -0
  235. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/__init__.py +0 -0
  236. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/apmplus_logs.py +0 -0
  237. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
  238. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/cr.py +0 -0
  239. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/iam.py +0 -0
  240. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
  241. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
  242. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/tos_service.py +0 -0
  243. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/sts.py +0 -0
  244. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
  245. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
  246. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/__init__.py +0 -0
  247. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/global_config_io.py +0 -0
  248. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/http_defaults.py +0 -0
  249. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/logging_config.py +0 -0
  250. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/misc.py +0 -0
  251. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/redact.py +0 -0
  252. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/request.py +0 -0
  253. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/template_utils.py +0 -0
  254. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit/utils/ve_sign.py +0 -0
  255. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
  256. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
  257. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
  258. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/setup.cfg +0 -0
  259. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/tests/test_client_uses_platform_context.py +0 -0
  260. {agentkit_sdk_python-0.7.2 → agentkit_sdk_python-0.7.4}/tests/test_error_hierarchy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentkit-sdk-python
3
- Version: 0.7.2
3
+ Version: 0.7.4
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
@@ -244,6 +244,13 @@ Requires-Dist: pyreadline3; sys_platform == "win32"
244
244
  Provides-Extra: extensions
245
245
  Provides-Extra: toolkit
246
246
  Provides-Extra: dev
247
+ Provides-Extra: langchain
248
+ Requires-Dist: langchain; extra == "langchain"
249
+ Provides-Extra: langgraph
250
+ Requires-Dist: langgraph; extra == "langgraph"
251
+ Provides-Extra: frameworks
252
+ Requires-Dist: langchain; extra == "frameworks"
253
+ Requires-Dist: langgraph; extra == "frameworks"
247
254
  Dynamic: license-file
248
255
 
249
256
  <div align="center">
@@ -12,28 +12,19 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Bring a user's *own* third-party model subscription into the sandbox.
16
-
17
- Many foreign models (ChatGPT/Codex, Claude Code) are used via a JWT obtained by an
18
- interactive SSO login, not a static API key. A user who subscribed to one of those
19
- plans wants the **sandbox's** codex to run on *their* subscription.
20
-
21
- The agentkit UserPool does not (and need not) federate with OpenAI/Anthropic. Codex
22
- already supports SSO **locally**; in the sandbox it is "remote", so the agreed design
23
- is dead simple and is what this module implements:
24
-
25
- 1. The user runs the provider's native SSO **on their PC** (``codex login`` for
26
- Codex/ChatGPT, ``claude`` for Claude Code). That writes the provider's native
27
- credential file:
28
- Codex -> $CODEX_HOME/auth.json (default ~/.codex/auth.json)
29
- Claude -> ~/.claude/.credentials.json (or the macOS Keychain)
30
- 2. We read that file verbatim and inject it into the **same native path inside
31
- the user's private sandbox** — so the sandbox's codex finds its token exactly
32
- where it natively looks. No proxy, no federation: the sandbox refreshes the
33
- token itself against the provider, just like a local install would.
34
-
35
- This module is pure (stdlib only) and side-effect-light so it is unit-testable; the
36
- network/forwarding lives in the CLI layer (``cli_accesscontrol.py``).
15
+ """Read a local model-subscription login and inject it into a sandbox.
16
+
17
+ Codex/ChatGPT and Claude Code log in over OAuth and store the token in a local file
18
+ ($CODEX_HOME/auth.json for codex, ~/.claude/.credentials.json or the macOS Keychain for
19
+ Claude). This reads that file and writes the token to the same path inside the sandbox,
20
+ so the sandbox's codex runs on the user's subscription. codex refreshes the token itself.
21
+
22
+ Only the OAuth token is injected. The same file can also hold a long-lived API key
23
+ (codex: OPENAI_API_KEY); that is stripped before injection and an api-key-only file is
24
+ rejected, so a long-lived key never reaches the sandbox. See sanitize_*_for_injection.
25
+
26
+ The sandbox transport configures a codex_login provider for OAuth auth. Stdlib only; the
27
+ sandbox transport lives in sandbox/cli_model_login.py.
37
28
  """
38
29
 
39
30
  from __future__ import annotations
@@ -42,18 +33,19 @@ import base64
42
33
  import datetime
43
34
  import json
44
35
  import os
45
- import re
46
36
  import sys
47
37
  from pathlib import Path
48
38
  from typing import Callable, Optional
49
39
 
50
- # ── Codex / ChatGPT facts ────────────────────────────────────────────────────
40
+ # Codex / ChatGPT facts
51
41
  CODEX_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann" # codex CLI's public OAuth client (the id_token aud)
52
42
  CODEX_OAUTH_NAMESPACE = "https://api.openai.com/auth" # claim namespace holding the ChatGPT plan
53
- DEFAULT_SANDBOX_CODEX_HOME = "/home/gem/.codex" # informational; the shell resolves ${CODEX_HOME:-$HOME/.codex}
43
+ CODEX_BUILTIN_PROVIDER = "openai" # codex's reserved built-in provider that uses ChatGPT auth
54
44
  CODEX_INJECT_MARKER = "AGENTKIT_CODEX_INJECTED"
55
45
  CLAUDE_INJECT_MARKER = "AGENTKIT_CLAUDE_INJECTED"
56
46
  CLAUDE_KEYCHAIN_SERVICE = "Claude Code-credentials"
47
+ # codex auth.json OAuth token fields we carry into the sandbox (everything else is dropped).
48
+ CODEX_OAUTH_TOKEN_FIELDS = ("id_token", "access_token", "refresh_token", "account_id")
57
49
 
58
50
  PROVIDERS = ("codex", "claude")
59
51
 
@@ -62,9 +54,9 @@ class ModelLoginError(RuntimeError):
62
54
  """A user-facing failure resolving or injecting a model subscription token."""
63
55
 
64
56
 
65
- # ── small helpers ────────────────────────────────────────────────────────────
57
+ # small helpers
66
58
  def b64(data: str | bytes) -> str:
67
- """Standard base64 (single line, no newlines) safe to embed in a shell ``printf``."""
59
+ """Standard base64 (single line, no newlines) - safe to embed in a shell ``printf``."""
68
60
  if isinstance(data, str):
69
61
  data = data.encode("utf-8")
70
62
  return base64.b64encode(data).decode("ascii")
@@ -86,7 +78,7 @@ def decode_jwt_claims(jwt: str) -> dict:
86
78
  raise ModelLoginError(f"cannot decode JWT claims: {exc}") from exc
87
79
 
88
80
 
89
- # ── Codex (ChatGPT) ──────────────────────────────────────────────────────────
81
+ # Codex (ChatGPT)
90
82
  def codex_home_path(explicit: Optional[str] = None) -> Path:
91
83
  """Resolve the LOCAL codex home: --codex-home > $CODEX_HOME > ~/.codex."""
92
84
  if explicit:
@@ -110,15 +102,40 @@ def read_codex_auth(path: str | Path) -> dict:
110
102
  return data
111
103
 
112
104
 
113
- def validate_codex_auth(data: dict) -> None:
114
- """A usable codex auth has ChatGPT tokens (SSO) or an API key."""
105
+ def codex_has_oauth(data: dict) -> bool:
115
106
  tokens = data.get("tokens")
116
- has_tokens = isinstance(tokens, dict) and bool(tokens.get("id_token") or tokens.get("access_token"))
117
- has_key = bool(data.get("OPENAI_API_KEY"))
118
- if not (has_tokens or has_key):
107
+ return isinstance(tokens, dict) and bool(tokens.get("id_token") or tokens.get("access_token"))
108
+
109
+
110
+ def validate_codex_auth(data: dict) -> None:
111
+ """A usable codex auth has ChatGPT OAuth tokens or an API key. Only the OAuth path is
112
+ injected; api-key-only auth is rejected in sanitize_codex_auth_for_injection."""
113
+ if not (codex_has_oauth(data) or data.get("OPENAI_API_KEY")):
114
+ raise ModelLoginError(
115
+ "codex auth.json has neither ChatGPT tokens nor an API key; run `codex login` first"
116
+ )
117
+
118
+
119
+ def sanitize_codex_auth_for_injection(data: dict) -> dict:
120
+ """Return only the OAuth token material to inject, dropping any API key.
121
+
122
+ codex keeps a long-lived OPENAI_API_KEY in the same auth.json as the OAuth tokens.
123
+ This returns just the tokens with OPENAI_API_KEY set to null; an api-key-only auth
124
+ (no OAuth login) is rejected.
125
+ """
126
+ if not codex_has_oauth(data):
119
127
  raise ModelLoginError(
120
- "codex auth.json has neither ChatGPT tokens nor an API key run `codex login` first"
128
+ "no ChatGPT OAuth login in your codex auth. An API key is not injected into the "
129
+ "sandbox; run `codex login` (ChatGPT SSO) first."
121
130
  )
131
+ tokens = data.get("tokens") or {}
132
+ safe_tokens = {k: tokens[k] for k in CODEX_OAUTH_TOKEN_FIELDS if tokens.get(k) is not None}
133
+ return {
134
+ "OPENAI_API_KEY": None, # do not inject the API key
135
+ "auth_mode": "chatgpt",
136
+ "tokens": safe_tokens,
137
+ "last_refresh": data.get("last_refresh"),
138
+ }
122
139
 
123
140
 
124
141
  def codex_auth_summary(data: dict) -> dict:
@@ -127,6 +144,8 @@ def codex_auth_summary(data: dict) -> dict:
127
144
  summary: dict = {
128
145
  "provider": "codex (ChatGPT)",
129
146
  "auth_mode": data.get("auth_mode") or ("chatgpt" if tokens else "apikey"),
147
+ "has_oauth_login": codex_has_oauth(data),
148
+ "has_local_api_key": bool(data.get("OPENAI_API_KEY")), # present locally; NOT injected
130
149
  "has_refresh_token": bool(tokens.get("refresh_token")),
131
150
  "account_id": tokens.get("account_id"),
132
151
  }
@@ -160,7 +179,7 @@ def run_codex_login(
160
179
  subprocess.run([codex_bin, "login"], env=env, timeout=timeout, check=True) # noqa: S603
161
180
  except FileNotFoundError as exc:
162
181
  raise ModelLoginError(
163
- f"`{codex_bin}` not found on PATH install the Codex CLI and run `codex login`, "
182
+ f"`{codex_bin}` not found on PATH - install the Codex CLI and run `codex login`, "
164
183
  f"or pass --auth-file <path-to-your-auth.json>"
165
184
  ) from exc
166
185
  except subprocess.CalledProcessError as exc:
@@ -191,7 +210,7 @@ def resolve_local_codex_auth(
191
210
  if not path.exists():
192
211
  if not allow_login:
193
212
  raise ModelLoginError(
194
- f"no codex auth at {path} run `codex login` (or pass --auth-file / --no-login off)"
213
+ f"no codex auth at {path} - run `codex login` (or pass --auth-file / drop --no-login)"
195
214
  )
196
215
  (login_runner or run_codex_login)(codex_home=home, timeout=login_timeout)
197
216
  if not path.exists():
@@ -201,76 +220,25 @@ def resolve_local_codex_auth(
201
220
  return path, data
202
221
 
203
222
 
204
- # ── Codex config.toml: switch the sandbox codex to the ChatGPT subscription ──
205
- _TOP_MODEL_PIN = re.compile(r"^\s*(model|model_provider|review_model)\s*=")
206
- _AUTH_METHOD = re.compile(r"^\s*preferred_auth_method\s*=")
207
- _TABLE_HEADER = re.compile(r"^\s*\[")
208
-
209
-
210
- def rewrite_codex_config_for_chatgpt(toml_text: str) -> str:
211
- """Switch an existing codex config.toml to ChatGPT-subscription auth, preserving everything else.
212
-
213
- The sandbox's default config pins a custom ``model_provider``/``model`` to a Volcengine Ark
214
- endpoint that authenticates with an API key (``env_key``); in that mode codex never looks at the
215
- injected ChatGPT token. To use the subscription we:
216
- * drop the top-level ``model`` / ``model_provider`` / ``review_model`` pins, so codex falls back
217
- to its built-in ``openai`` provider and the subscription's default model, and
218
- * force ``preferred_auth_method = "chatgpt"`` so the OAuth token wins over any stray API key.
219
- Tables (``[tui]``, ``[projects.*]``, ``[mcp_servers.*]``, ``[model_providers.*]``) and other
220
- top-level keys (approval_policy, sandbox_mode, model_reasoning_effort, …) are kept verbatim.
221
- """
222
- out: list[str] = []
223
- seen_table = False
224
- for line in toml_text.splitlines():
225
- if _TABLE_HEADER.match(line):
226
- seen_table = True
227
- if _AUTH_METHOD.match(line):
228
- continue # re-added at the top
229
- if not seen_table and _TOP_MODEL_PIN.match(line):
230
- continue
231
- out.append(line)
232
- body = "\n".join(out).strip("\n")
233
- return 'preferred_auth_method = "chatgpt"\n' + (body + "\n" if body else "")
234
-
235
-
236
- def minimal_chatgpt_codex_config() -> str:
237
- """A config.toml for a sandbox that has no codex config yet — ChatGPT auth, headless-friendly."""
223
+ def build_codex_injection_command(*, auth_data: dict) -> str:
224
+ """POSIX-sh command that writes the sanitized auth.json (OAuth only, API key stripped) into
225
+ ${CODEX_HOME:-$HOME/.codex} at 0600 and prints a marker. auth_data is sanitized here so the
226
+ transport cannot inject an API key."""
227
+ payload = json.dumps(sanitize_codex_auth_for_injection(auth_data), ensure_ascii=False)
238
228
  return "\n".join(
239
229
  [
240
- 'preferred_auth_method = "chatgpt"',
241
- 'approval_policy = "never"',
242
- 'sandbox_mode = "danger-full-access"',
243
- "",
244
- '[projects."/home/gem"]',
245
- 'trust_level = "trusted"',
246
- "",
230
+ "set -e",
231
+ 'CH="${CODEX_HOME:-$HOME/.codex}"',
232
+ 'mkdir -p "$CH"',
233
+ "umask 077",
234
+ f"printf %s '{b64(payload)}' | base64 -d > \"$CH/auth.json\"",
235
+ 'chmod 600 "$CH/auth.json"',
236
+ f'echo "{CODEX_INJECT_MARKER} $CH"',
247
237
  ]
248
238
  )
249
239
 
250
240
 
251
- def read_codex_config_command() -> str:
252
- """Shell command that prints the sandbox's current codex config.toml (empty if none)."""
253
- return 'cat "${CODEX_HOME:-$HOME/.codex}/config.toml" 2>/dev/null || true'
254
-
255
-
256
- def build_codex_injection_command(*, auth_json: str, config_toml: Optional[str] = None) -> str:
257
- """A single POSIX-sh command that writes auth.json (and optionally config.toml) into the
258
- sandbox's native codex home (``${CODEX_HOME:-$HOME/.codex}``), 0600, and prints a marker."""
259
- lines = [
260
- "set -e",
261
- 'CH="${CODEX_HOME:-$HOME/.codex}"',
262
- 'mkdir -p "$CH"',
263
- "umask 077",
264
- f"printf %s '{b64(auth_json)}' | base64 -d > \"$CH/auth.json\"",
265
- 'chmod 600 "$CH/auth.json"',
266
- ]
267
- if config_toml is not None:
268
- lines.append(f"printf %s '{b64(config_toml)}' | base64 -d > \"$CH/config.toml\"")
269
- lines.append(f'echo "{CODEX_INJECT_MARKER} $CH"')
270
- return "\n".join(lines)
271
-
272
-
273
- # ── Claude Code ──────────────────────────────────────────────────────────────
241
+ # Claude Code
274
242
  def claude_creds_path(explicit: Optional[str] = None) -> Path:
275
243
  if explicit:
276
244
  return Path(explicit).expanduser()
@@ -308,7 +276,7 @@ def read_claude_creds(*, creds_file: Optional[str] = None, allow_keychain: bool
308
276
  raw = _read_macos_keychain(CLAUDE_KEYCHAIN_SERVICE)
309
277
  if not raw:
310
278
  raise ModelLoginError(
311
- "no Claude Code credentials in ~/.claude/.credentials.json or the macOS Keychain "
279
+ "no Claude Code credentials in ~/.claude/.credentials.json or the macOS Keychain - "
312
280
  "run `claude` and log in with your subscription first"
313
281
  )
314
282
  try:
@@ -317,7 +285,7 @@ def read_claude_creds(*, creds_file: Optional[str] = None, allow_keychain: bool
317
285
  raise ModelLoginError("Claude Keychain entry is not valid JSON") from exc
318
286
  else:
319
287
  raise ModelLoginError(
320
- "no Claude Code credentials at ~/.claude/.credentials.json "
288
+ "no Claude Code credentials at ~/.claude/.credentials.json - "
321
289
  "run `claude` and log in with your subscription first"
322
290
  )
323
291
  if not isinstance(data, dict):
@@ -331,6 +299,18 @@ def validate_claude_creds(data: dict) -> None:
331
299
  raise ModelLoginError("Claude credentials missing claudeAiOauth.accessToken")
332
300
 
333
301
 
302
+ def sanitize_claude_creds_for_injection(data: dict) -> dict:
303
+ """Return only the claudeAiOauth object; other top-level fields (e.g. a stored API key)
304
+ are dropped."""
305
+ oauth = data.get("claudeAiOauth")
306
+ if not (isinstance(oauth, dict) and oauth.get("accessToken")):
307
+ raise ModelLoginError(
308
+ "no Claude OAuth login found. An API key is not injected into the sandbox; "
309
+ "run `claude` and log in with your subscription first."
310
+ )
311
+ return {"claudeAiOauth": oauth}
312
+
313
+
334
314
  def claude_creds_summary(data: dict) -> dict:
335
315
  oauth = data.get("claudeAiOauth") or {}
336
316
  summary: dict = {
@@ -345,15 +325,17 @@ def claude_creds_summary(data: dict) -> dict:
345
325
  return {k: v for k, v in summary.items() if v is not None}
346
326
 
347
327
 
348
- def build_claude_injection_command(*, creds_json: str) -> str:
349
- """A single POSIX-sh command that writes Claude Code creds into ``$HOME/.claude``, 0600."""
328
+ def build_claude_injection_command(*, creds_data: dict) -> str:
329
+ """POSIX-sh command that writes the sanitized Claude creds into
330
+ $HOME/.claude/.credentials.json at 0600."""
331
+ payload = json.dumps(sanitize_claude_creds_for_injection(creds_data), ensure_ascii=False)
350
332
  return "\n".join(
351
333
  [
352
334
  "set -e",
353
335
  'CD="$HOME/.claude"',
354
336
  'mkdir -p "$CD"',
355
337
  "umask 077",
356
- f"printf %s '{b64(creds_json)}' | base64 -d > \"$CD/.credentials.json\"",
338
+ f"printf %s '{b64(payload)}' | base64 -d > \"$CD/.credentials.json\"",
357
339
  'chmod 600 "$CD/.credentials.json"',
358
340
  f'echo "{CLAUDE_INJECT_MARKER} $CD"',
359
341
  ]
@@ -0,0 +1,29 @@
1
+ """Framework adapters for running third-party agents in AgentKit apps."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ from agentkit.frameworks._common import (
8
+ FrameworkBridgeError,
9
+ UnsupportedFrameworkAgentError,
10
+ )
11
+
12
+ __all__ = [
13
+ "FrameworkBridgeError",
14
+ "LangChainAgentkitBridge",
15
+ "LangGraphAgentkitBridge",
16
+ "UnsupportedFrameworkAgentError",
17
+ ]
18
+
19
+
20
+ def __getattr__(name: str) -> Any:
21
+ if name == "LangChainAgentkitBridge":
22
+ from agentkit.frameworks.langchain import LangChainAgentkitBridge
23
+
24
+ return LangChainAgentkitBridge
25
+ if name == "LangGraphAgentkitBridge":
26
+ from agentkit.frameworks.langgraph import LangGraphAgentkitBridge
27
+
28
+ return LangGraphAgentkitBridge
29
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1,136 @@
1
+ """Shared helpers for framework-to-ADK adapters."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import inspect
6
+ import json
7
+ from typing import Any
8
+
9
+ from google.adk.agents.invocation_context import InvocationContext
10
+ from google.adk.events import Event
11
+ from google.genai import types
12
+
13
+
14
+ class FrameworkBridgeError(RuntimeError):
15
+ """Base error raised by AgentKit framework adapters."""
16
+
17
+
18
+ class UnsupportedFrameworkAgentError(FrameworkBridgeError):
19
+ """Raised when an entry object does not expose a supported agent protocol."""
20
+
21
+
22
+ def user_text(ctx: InvocationContext) -> str:
23
+ content = ctx.user_content
24
+ if content is None or not content.parts:
25
+ return ""
26
+ texts: list[str] = []
27
+ for part in content.parts:
28
+ text = getattr(part, "text", None)
29
+ if text:
30
+ texts.append(text)
31
+ return "\n".join(texts)
32
+
33
+
34
+ def json_text(value: Any) -> str:
35
+ try:
36
+ return json.dumps(value, ensure_ascii=False, default=str)
37
+ except Exception:
38
+ return str(value)
39
+
40
+
41
+ def content_to_text(content: Any) -> str:
42
+ if content is None:
43
+ return ""
44
+ if isinstance(content, str):
45
+ return content
46
+ if isinstance(content, dict):
47
+ for key in ("text", "content", "output", "answer"):
48
+ if key in content:
49
+ text = content_to_text(content[key])
50
+ if text:
51
+ return text
52
+ return json_text(content)
53
+ if isinstance(content, list):
54
+ return "".join(content_to_text(item) for item in content)
55
+ text = getattr(content, "text", None)
56
+ if isinstance(text, str):
57
+ return text
58
+ return str(content)
59
+
60
+
61
+ def chunk_to_text(value: Any) -> str:
62
+ if value is None:
63
+ return ""
64
+ if isinstance(value, str):
65
+ return value
66
+ content = getattr(value, "content", None)
67
+ if content is not None:
68
+ return content_to_text(content)
69
+ text = getattr(value, "text", None)
70
+ if isinstance(text, str):
71
+ return text
72
+ if isinstance(value, dict):
73
+ for key in ("output", "answer", "text", "content"):
74
+ if key in value:
75
+ text = chunk_to_text(value[key])
76
+ if text:
77
+ return text
78
+ messages = value.get("messages")
79
+ if isinstance(messages, (list, tuple)) and messages:
80
+ return chunk_to_text(messages[-1])
81
+ for nested in value.values():
82
+ text = chunk_to_text(nested)
83
+ if text:
84
+ return text
85
+ return json_text(value)
86
+ if isinstance(value, (list, tuple)):
87
+ for item in reversed(value):
88
+ text = chunk_to_text(item)
89
+ if text:
90
+ return text
91
+ return ""
92
+ return str(value)
93
+
94
+
95
+ def adk_event(
96
+ ctx: InvocationContext,
97
+ author: str,
98
+ text: str,
99
+ *,
100
+ partial: bool,
101
+ ) -> Event:
102
+ return Event(
103
+ invocation_id=ctx.invocation_id,
104
+ author=author,
105
+ branch=ctx.branch,
106
+ partial=partial,
107
+ content=types.Content(role="model", parts=[types.Part(text=text)]),
108
+ )
109
+
110
+
111
+ async def maybe_await(value: Any) -> Any:
112
+ if inspect.isawaitable(value):
113
+ return await value
114
+ return value
115
+
116
+
117
+ def is_input_shape_error(exc: Exception) -> bool:
118
+ message = str(exc)
119
+ name = exc.__class__.__name__
120
+ return (
121
+ name == "InvalidUpdateError"
122
+ or "Invalid input type" in message
123
+ or "Must be a PromptValue, str, or list of BaseMessages" in message
124
+ or "Expected dict" in message
125
+ or "string indices must be integers" in message
126
+ or "'str' object is not subscriptable" in message
127
+ or "Input to ChatPromptTemplate is missing variables" in message
128
+ )
129
+
130
+
131
+ def chunk_delta(accumulated: str, text: str) -> str:
132
+ if not accumulated:
133
+ return text
134
+ if text.startswith(accumulated):
135
+ return text[len(accumulated) :]
136
+ return text
@@ -0,0 +1,170 @@
1
+ """LangChain adapter for AgentKit apps."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import AsyncGenerator
6
+ from typing import Any
7
+
8
+ from google.adk.agents.base_agent import BaseAgent
9
+ from google.adk.agents.invocation_context import InvocationContext
10
+ from google.adk.events import Event
11
+ from pydantic import PrivateAttr
12
+
13
+ from agentkit.frameworks._common import (
14
+ UnsupportedFrameworkAgentError,
15
+ adk_event,
16
+ chunk_delta,
17
+ chunk_to_text,
18
+ is_input_shape_error,
19
+ maybe_await,
20
+ user_text,
21
+ )
22
+
23
+
24
+ try:
25
+ from langchain_core.messages import HumanMessage
26
+ except ImportError: # pragma: no cover - depends on optional packages.
27
+ HumanMessage = None # type: ignore[assignment]
28
+
29
+
30
+ class LangChainAgentkitBridge(BaseAgent):
31
+ """Adapt a LangChain Runnable or callable to AgentKit's ADK runtime boundary."""
32
+
33
+ _runnable: Any = PrivateAttr()
34
+ _input_key: str = PrivateAttr(default="input")
35
+
36
+ def __init__(
37
+ self,
38
+ runnable: Any,
39
+ *,
40
+ name: str = "langchain_agent",
41
+ description: str = "LangChain agent adapted for AgentKit runtime",
42
+ input_key: str = "input",
43
+ ) -> None:
44
+ super().__init__(name=name, description=description)
45
+ self._runnable = runnable
46
+ self._input_key = input_key
47
+
48
+ def _input_candidates(self, payload: dict[str, Any], text_input: str) -> list[Any]:
49
+ candidates: list[Any] = [payload, text_input]
50
+ if HumanMessage is not None:
51
+ message = HumanMessage(content=text_input)
52
+ candidates.extend(([message], {"messages": [message]}))
53
+ return candidates
54
+
55
+ async def _call_once(self, payload: dict[str, Any], text_input: str) -> Any:
56
+ candidates = self._input_candidates(payload, text_input)
57
+ ainvoke = getattr(self._runnable, "ainvoke", None)
58
+ if callable(ainvoke):
59
+ last_error: Exception | None = None
60
+ for candidate in candidates:
61
+ try:
62
+ return await ainvoke(candidate)
63
+ except Exception as exc:
64
+ if not is_input_shape_error(exc):
65
+ raise
66
+ last_error = exc
67
+ if last_error is not None:
68
+ raise last_error
69
+
70
+ invoke = getattr(self._runnable, "invoke", None)
71
+ if callable(invoke):
72
+ last_error = None
73
+ for candidate in candidates:
74
+ try:
75
+ return invoke(candidate)
76
+ except Exception as exc:
77
+ if not is_input_shape_error(exc):
78
+ raise
79
+ last_error = exc
80
+ if last_error is not None:
81
+ raise last_error
82
+
83
+ if callable(self._runnable):
84
+ last_error = None
85
+ for candidate in candidates:
86
+ try:
87
+ return await maybe_await(self._runnable(candidate))
88
+ except Exception as exc:
89
+ if not is_input_shape_error(exc):
90
+ raise
91
+ last_error = exc
92
+ if last_error is not None:
93
+ raise last_error
94
+
95
+ raise UnsupportedFrameworkAgentError(
96
+ "LangChain entry must be a Runnable-like object exposing "
97
+ "astream, stream, ainvoke, or invoke, or a callable that accepts the user input."
98
+ )
99
+
100
+ async def _stream_chunks(self, payload: dict[str, Any], text_input: str):
101
+ astream = getattr(self._runnable, "astream", None)
102
+ if callable(astream):
103
+ last_error: Exception | None = None
104
+ for candidate in self._input_candidates(payload, text_input):
105
+ emitted = False
106
+ try:
107
+ async for chunk in astream(candidate):
108
+ emitted = True
109
+ yield chunk
110
+ return
111
+ except Exception as exc:
112
+ if emitted:
113
+ raise
114
+ if not is_input_shape_error(exc):
115
+ raise
116
+ last_error = exc
117
+ if last_error is not None:
118
+ raise last_error
119
+ return
120
+
121
+ stream = getattr(self._runnable, "stream", None)
122
+ if callable(stream):
123
+ last_error = None
124
+ for candidate in self._input_candidates(payload, text_input):
125
+ emitted = False
126
+ try:
127
+ for chunk in stream(candidate):
128
+ emitted = True
129
+ yield chunk
130
+ return
131
+ except Exception as exc:
132
+ if emitted:
133
+ raise
134
+ if not is_input_shape_error(exc):
135
+ raise
136
+ last_error = exc
137
+ if last_error is not None:
138
+ raise last_error
139
+
140
+ async def _run_async_impl(
141
+ self,
142
+ ctx: InvocationContext,
143
+ ) -> AsyncGenerator[Event, None]:
144
+ text_input = user_text(ctx)
145
+ payload = {self._input_key: text_input}
146
+ accumulated_text = ""
147
+ has_output = False
148
+ last_text = ""
149
+ streamed = False
150
+
151
+ async for chunk in self._stream_chunks(payload, text_input):
152
+ streamed = True
153
+ text = chunk_to_text(chunk)
154
+ if not text:
155
+ continue
156
+ delta = chunk_delta(accumulated_text, text)
157
+ if not delta:
158
+ continue
159
+ accumulated_text += delta
160
+ has_output = True
161
+ last_text = accumulated_text
162
+ yield adk_event(ctx, self.name, delta, partial=True)
163
+
164
+ if not streamed:
165
+ result = await self._call_once(payload, text_input)
166
+ last_text = chunk_to_text(result)
167
+
168
+ final_text = accumulated_text if has_output else last_text
169
+ if final_text:
170
+ yield adk_event(ctx, self.name, final_text, partial=False)