keystone-cli 0.2.0__tar.gz → 0.2.1__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 (153) hide show
  1. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/PKG-INFO +1 -1
  2. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/pyproject.toml +2 -2
  3. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/auth/token_store.py +22 -4
  4. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/PKG-INFO +1 -1
  5. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_config_env_mismatch.py +48 -0
  6. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/setup.cfg +0 -0
  7. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/__init__.py +0 -0
  8. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/__main__.py +0 -0
  9. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/_build_env.py +0 -0
  10. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/_stdio.py +0 -0
  11. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/_version.py +0 -0
  12. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/agent_logs.py +0 -0
  13. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/agent_skills.py +0 -0
  14. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/auth/__init__.py +0 -0
  15. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/auth/device_flow.py +0 -0
  16. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/__init__.py +0 -0
  17. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/agent.py +0 -0
  18. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/dev.py +0 -0
  19. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/kb.py +0 -0
  20. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/kb_metadata.py +0 -0
  21. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/login.py +0 -0
  22. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/skills.py +0 -0
  23. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/tool_credentials.py +0 -0
  24. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/whoami.py +0 -0
  25. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/commands/workspace.py +0 -0
  26. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/devloop.py +0 -0
  27. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/platform_client.py +0 -0
  28. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/run_debug.py +0 -0
  29. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/runner.py +0 -0
  30. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/scaffold.py +0 -0
  31. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/skills/keystone-debug/SKILL.md +0 -0
  32. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/README.md.tmpl +0 -0
  33. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/agent.yaml.tmpl +0 -0
  34. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/env.tmpl +0 -0
  35. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/gitignore.tmpl +0 -0
  36. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/pkg/__init__.py.tmpl +0 -0
  37. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/pkg/graph.py.tmpl +0 -0
  38. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/blank/pyproject.toml.tmpl +0 -0
  39. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/README.md.tmpl +0 -0
  40. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/agent.yaml.tmpl +0 -0
  41. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/env.tmpl +0 -0
  42. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/gitignore.tmpl +0 -0
  43. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/pkg/__init__.py.tmpl +0 -0
  44. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/pkg/graph.py.tmpl +0 -0
  45. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/guardrails/pyproject.toml.tmpl +0 -0
  46. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/README.md.tmpl +0 -0
  47. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/agent.yaml.tmpl +0 -0
  48. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/env.tmpl +0 -0
  49. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/gitignore.tmpl +0 -0
  50. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/pkg/__init__.py.tmpl +0 -0
  51. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/pkg/graph.py.tmpl +0 -0
  52. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/hitl/pyproject.toml.tmpl +0 -0
  53. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/README.md.tmpl +0 -0
  54. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/agent.yaml.tmpl +0 -0
  55. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/env.tmpl +0 -0
  56. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/gitignore.tmpl +0 -0
  57. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/pkg/__init__.py.tmpl +0 -0
  58. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/pkg/graph.py.tmpl +0 -0
  59. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/kb-builder/pyproject.toml.tmpl +0 -0
  60. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/README.md.tmpl +0 -0
  61. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/agent.yaml.tmpl +0 -0
  62. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/env.tmpl +0 -0
  63. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/gitignore.tmpl +0 -0
  64. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/pkg/__init__.py.tmpl +0 -0
  65. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/pkg/graph.py.tmpl +0 -0
  66. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm/pyproject.toml.tmpl +0 -0
  67. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/README.md.tmpl +0 -0
  68. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/agent.yaml.tmpl +0 -0
  69. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/env.tmpl +0 -0
  70. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/gitignore.tmpl +0 -0
  71. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/pkg/__init__.py.tmpl +0 -0
  72. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/pkg/graph.py.tmpl +0 -0
  73. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/llm-streaming/pyproject.toml.tmpl +0 -0
  74. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/README.md.tmpl +0 -0
  75. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/agent.yaml.tmpl +0 -0
  76. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/env.tmpl +0 -0
  77. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/gitignore.tmpl +0 -0
  78. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/pkg/__init__.py.tmpl +0 -0
  79. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/pkg/graph.py.tmpl +0 -0
  80. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory/pyproject.toml.tmpl +0 -0
  81. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/README.md.tmpl +0 -0
  82. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/agent.yaml.tmpl +0 -0
  83. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/env.tmpl +0 -0
  84. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/gitignore.tmpl +0 -0
  85. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/pkg/__init__.py.tmpl +0 -0
  86. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/pkg/graph.py.tmpl +0 -0
  87. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/memory-service/pyproject.toml.tmpl +0 -0
  88. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/README.md.tmpl +0 -0
  89. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/agent.yaml.tmpl +0 -0
  90. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/env.tmpl +0 -0
  91. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/gitignore.tmpl +0 -0
  92. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/pkg/__init__.py.tmpl +0 -0
  93. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/pkg/graph.py.tmpl +0 -0
  94. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/ocr/pyproject.toml.tmpl +0 -0
  95. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/README.md.tmpl +0 -0
  96. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/agent.yaml.tmpl +0 -0
  97. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/env.tmpl +0 -0
  98. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/gitignore.tmpl +0 -0
  99. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/pkg/__init__.py.tmpl +0 -0
  100. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/pkg/graph.py.tmpl +0 -0
  101. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/rag-qa/pyproject.toml.tmpl +0 -0
  102. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/README.md.tmpl +0 -0
  103. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/agent.yaml.tmpl +0 -0
  104. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/env.tmpl +0 -0
  105. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/gitignore.tmpl +0 -0
  106. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/pkg/__init__.py.tmpl +0 -0
  107. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/pkg/graph.py.tmpl +0 -0
  108. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/skill/pyproject.toml.tmpl +0 -0
  109. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/README.md.tmpl +0 -0
  110. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/agent.yaml.tmpl +0 -0
  111. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/env.tmpl +0 -0
  112. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/gitignore.tmpl +0 -0
  113. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/pkg/__init__.py.tmpl +0 -0
  114. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/pkg/graph.py.tmpl +0 -0
  115. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli/templates/tool-agent/pyproject.toml.tmpl +0 -0
  116. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/SOURCES.txt +0 -0
  117. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/dependency_links.txt +0 -0
  118. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/entry_points.txt +0 -0
  119. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/requires.txt +0 -0
  120. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/src/keystone_cli.egg-info/top_level.txt +0 -0
  121. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_agent.py +0 -0
  122. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_assistant_provenance_and_flags.py +0 -0
  123. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_auth.py +0 -0
  124. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_build_progress.py +0 -0
  125. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_ci_token.py +0 -0
  126. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_deploy.py +0 -0
  127. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_dev.py +0 -0
  128. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_doctor.py +0 -0
  129. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_encoding.py +0 -0
  130. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_help_quality.py +0 -0
  131. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_hitl_approver_cli.py +0 -0
  132. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_hitl_decisions_cli.py +0 -0
  133. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_init.py +0 -0
  134. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_invoke.py +0 -0
  135. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_invoke_stream.py +0 -0
  136. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_kb_commands.py +0 -0
  137. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_kb_metadata_commands.py +0 -0
  138. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_login_command.py +0 -0
  139. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_logs.py +0 -0
  140. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_offline.py +0 -0
  141. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_platform_client.py +0 -0
  142. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_publish.py +0 -0
  143. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_retire_delete.py +0 -0
  144. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_run_debug.py +0 -0
  145. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_runs.py +0 -0
  146. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_skills.py +0 -0
  147. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_status.py +0 -0
  148. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_stdio.py +0 -0
  149. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_threads.py +0 -0
  150. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_tool_credentials.py +0 -0
  151. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_traces.py +0 -0
  152. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_version.py +0 -0
  153. {keystone_cli-0.2.0 → keystone_cli-0.2.1}/tests/test_workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keystone-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Keystone pro-code agent CLI — build, test, deploy and operate agents on the Keystone platform.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: keystone-agent-sdk<0.14,>=0.13.3
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "keystone-cli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Keystone pro-code agent CLI — build, test, deploy and operate agents on the Keystone platform."
9
9
  requires-python = ">=3.12"
10
10
  dependencies = [
@@ -45,7 +45,7 @@ where = ["src"]
45
45
  keystone_cli = ["templates/*/*.tmpl", "templates/*/pkg/*.tmpl", "skills/*/SKILL.md"]
46
46
 
47
47
  [tool.ruff]
48
- target-version = "0.2.0"
48
+ target-version = "0.2.1"
49
49
  line-length = 120
50
50
 
51
51
  [tool.ruff.lint]
@@ -44,16 +44,33 @@ _ENV_DEFAULTS: dict[str, tuple[str, str, str]] = {
44
44
  "https://keystone-agent-api-staging.aws.int.onenexus.dev",
45
45
  ),
46
46
  # prod Keycloak is a SEPARATE host on `.onemount.com` (note: .com, not the nonprod .dev), realm `aip`.
47
- # prod Kong edge is on `.aws.int.onenexus.tech` (note: .tech, not nonprod's .dev) and drops the
48
- # per-env suffix (`keystone-api`, not `keystone-api-prod`). Confirmed with Ops 2026-08-28.
47
+ # prod Kong edge drops the per-env suffix (`keystone-api`, not `keystone-api-prod`). The CLI uses the
48
+ # `.ops.onenexus.tech` hosts (FDP-6328 / SP-14079): same Kong routes + plugins as `.aws.int`, but
49
+ # reachable from customer networks (TCB) through Cloudflare. `.aws.int` stays for in-cluster callers.
49
50
  "prod": (
50
51
  "https://keycloak-platform.ops.onemount.com/realms/aip",
51
- "https://keystone-api.aws.int.onenexus.tech",
52
- "https://keystone-agent-api.aws.int.onenexus.tech",
52
+ "https://keystone-api.ops.onenexus.tech",
53
+ "https://keystone-agent-api.ops.onenexus.tech",
53
54
  ),
54
55
  }
55
56
  DEFAULT_ISSUER, DEFAULT_API_BASE, DEFAULT_AGENT_API_BASE = _ENV_DEFAULTS.get(BUILD_ENV, _ENV_DEFAULTS["dev"])
56
57
 
58
+ # FDP-6328 — hosts an older CLI baked and cached in config.json, mapped to their replacement. `login`
59
+ # keeps a same-env cache and prod's issuer did not change, so without this rewrite an existing prod
60
+ # user would keep calling `.aws.int` (unreachable from a customer network) after upgrading.
61
+ _RETIRED_HOSTS: dict[str, str] = {
62
+ "https://keystone-api.aws.int.onenexus.tech": "https://keystone-api.ops.onenexus.tech",
63
+ "https://keystone-agent-api.aws.int.onenexus.tech": "https://keystone-agent-api.ops.onenexus.tech",
64
+ }
65
+
66
+
67
+ def _migrate_retired_hosts(cfg: AuthConfig) -> None:
68
+ """Point a cached endpoint at a retired host to its replacement (in memory; the next save persists it)."""
69
+ for name in ("api_base", "agent_api_base"):
70
+ current = getattr(cfg, name).rstrip("/")
71
+ if current in _RETIRED_HOSTS:
72
+ setattr(cfg, name, _RETIRED_HOSTS[current])
73
+
57
74
 
58
75
  @dataclass
59
76
  class AuthConfig:
@@ -142,6 +159,7 @@ def load() -> AuthConfig:
142
159
  data = json.loads(path.read_text(encoding="utf-8"))
143
160
  known = {f.name for f in fields(AuthConfig)}
144
161
  cfg = AuthConfig(**{k: v for k, v in data.items() if k in known})
162
+ _migrate_retired_hosts(cfg)
145
163
  _warn_if_other_env(cfg)
146
164
  return cfg
147
165
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keystone-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Keystone pro-code agent CLI — build, test, deploy and operate agents on the Keystone platform.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: keystone-agent-sdk<0.14,>=0.13.3
@@ -100,3 +100,51 @@ def test_login_resets_a_prod_stamped_config_holding_dev_endpoints(tmp_path, monk
100
100
  assert saved["env"] == "prod"
101
101
  assert (saved["issuer"], saved["api_base"], saved["agent_api_base"]) == (PROD_ISSUER, PROD_API, PROD_AGENT)
102
102
  assert saved["workspace_id"] == "" # the dev workspace must not survive into prod
103
+
104
+
105
+ # FDP-6328 — prod moved from the `.aws.int` hosts to `.ops`. Prod's issuer did not change, so a cached
106
+ # prod config is "same env" and `login` keeps it; the retired hosts must be rewritten on load.
107
+ OLD_PROD_API = "https://keystone-api.aws.int.onenexus.tech"
108
+ OLD_PROD_AGENT = "https://keystone-agent-api.aws.int.onenexus.tech"
109
+
110
+
111
+ def test_prod_defaults_use_the_ops_hosts() -> None:
112
+ assert (PROD_API, PROD_AGENT) == (
113
+ "https://keystone-api.ops.onenexus.tech",
114
+ "https://keystone-agent-api.ops.onenexus.tech",
115
+ )
116
+
117
+
118
+ def test_load_rewrites_retired_prod_hosts_and_keeps_the_session(tmp_path, capsys) -> None:
119
+ _write(
120
+ tmp_path,
121
+ env="prod",
122
+ issuer=PROD_ISSUER,
123
+ api_base=OLD_PROD_API + "/",
124
+ agent_api_base=OLD_PROD_AGENT,
125
+ refresh_token="rt",
126
+ workspace_id="ws-1",
127
+ )
128
+
129
+ cfg = ts.load()
130
+
131
+ assert (cfg.api_base, cfg.agent_api_base) == (PROD_API, PROD_AGENT)
132
+ assert (cfg.refresh_token, cfg.workspace_id) == ("rt", "ws-1") # no re-login, workspace kept
133
+ assert capsys.readouterr().err == "" # still prod — not flagged as another env
134
+
135
+
136
+ def test_load_leaves_custom_and_current_hosts_alone(tmp_path) -> None:
137
+ _write(tmp_path, env="prod", issuer=PROD_ISSUER, api_base="http://localhost:8080", agent_api_base=PROD_AGENT)
138
+
139
+ cfg = ts.load()
140
+
141
+ assert (cfg.api_base, cfg.agent_api_base) == ("http://localhost:8080", PROD_AGENT)
142
+
143
+
144
+ def test_save_after_load_persists_the_new_hosts(tmp_path) -> None:
145
+ _write(tmp_path, env="prod", issuer=PROD_ISSUER, api_base=OLD_PROD_API, agent_api_base=OLD_PROD_AGENT)
146
+
147
+ ts.save(ts.load())
148
+
149
+ saved = json.loads((tmp_path / "config.json").read_text(encoding="utf-8"))
150
+ assert (saved["api_base"], saved["agent_api_base"]) == (PROD_API, PROD_AGENT)
File without changes