agentshim 0.15.7__tar.gz → 0.17.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 (113) hide show
  1. {agentshim-0.15.7 → agentshim-0.17.0}/CHANGELOG.md +48 -0
  2. {agentshim-0.15.7 → agentshim-0.17.0}/PKG-INFO +1 -1
  3. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/__init__.py +31 -1
  4. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/__init__.py +32 -0
  5. agentshim-0.17.0/agentshim/core/auth.py +594 -0
  6. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/profile.py +17 -0
  7. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/status.py +6 -0
  8. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/probe.py +1 -0
  9. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/probe.py +21 -2
  10. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/provider.py +36 -0
  11. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/probe.py +10 -1
  12. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/provider.py +22 -1
  13. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/provider.py +8 -0
  14. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/provider.py +23 -0
  15. {agentshim-0.15.7 → agentshim-0.17.0}/pyproject.toml +1 -1
  16. {agentshim-0.15.7 → agentshim-0.17.0}/.gitignore +0 -0
  17. {agentshim-0.15.7 → agentshim-0.17.0}/LICENSE +0 -0
  18. {agentshim-0.15.7 → agentshim-0.17.0}/README.md +0 -0
  19. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/agent.py +0 -0
  20. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/_files.py +0 -0
  21. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/checkpoints.py +0 -0
  22. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/clock.py +0 -0
  23. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/conversation.py +0 -0
  24. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/env.py +0 -0
  25. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/errors.py +0 -0
  26. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/events.py +0 -0
  27. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/home.py +0 -0
  28. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/ids.py +0 -0
  29. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/mcp.py +0 -0
  30. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/permissions.py +0 -0
  31. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/pricing.py +0 -0
  32. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/provider.py +0 -0
  33. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/schema.py +0 -0
  34. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/session_policy.py +0 -0
  35. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/skills.py +0 -0
  36. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/stream.py +0 -0
  37. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/turn.py +0 -0
  38. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/core/usage.py +0 -0
  39. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/__init__.py +0 -0
  40. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/confinement.py +0 -0
  41. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/docker.py +0 -0
  42. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/executor.py +0 -0
  43. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/host.py +0 -0
  44. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/process.py +0 -0
  45. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/execution/transform.py +0 -0
  46. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/oneshot.py +0 -0
  47. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/__init__.py +0 -0
  48. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/__init__.py +0 -0
  49. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/events.py +0 -0
  50. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/failures.py +0 -0
  51. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/hooks/__init__.py +0 -0
  52. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/hooks/confine_reads.py +0 -0
  53. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/parser.py +0 -0
  54. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/rate_limits.py +0 -0
  55. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/sandbox.py +0 -0
  56. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/scripted.py +0 -0
  57. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/stream_argv.py +0 -0
  58. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/stream_transport.py +0 -0
  59. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/claude/user_hooks.py +0 -0
  60. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/__init__.py +0 -0
  61. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/_toml.py +0 -0
  62. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/__init__.py +0 -0
  63. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/_wire.py +0 -0
  64. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/approvals.py +0 -0
  65. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/channel.py +0 -0
  66. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/errors.py +0 -0
  67. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/items.py +0 -0
  68. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/mcp.py +0 -0
  69. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/permissions.py +0 -0
  70. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/profile.py +0 -0
  71. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/protocol.py +0 -0
  72. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/rate_limits.py +0 -0
  73. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/transport.py +0 -0
  74. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/app_server/usage.py +0 -0
  75. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/events.py +0 -0
  76. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/failures.py +0 -0
  77. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/mcp_scope.py +0 -0
  78. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/parser.py +0 -0
  79. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/rules.py +0 -0
  80. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/sandbox.py +0 -0
  81. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/scripted.py +0 -0
  82. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/codex/skills.py +0 -0
  83. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/__init__.py +0 -0
  84. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/events.py +0 -0
  85. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/parser.py +0 -0
  86. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/probe.py +0 -0
  87. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/copilot/scripted.py +0 -0
  88. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/__init__.py +0 -0
  89. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/events.py +0 -0
  90. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/parser.py +0 -0
  91. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/probe.py +0 -0
  92. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/gemini/scripted.py +0 -0
  93. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/__init__.py +0 -0
  94. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/events.py +0 -0
  95. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/parser.py +0 -0
  96. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/probe.py +0 -0
  97. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/provider.py +0 -0
  98. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/providers/opencode/scripted.py +0 -0
  99. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/py.typed +0 -0
  100. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/runtime.py +0 -0
  101. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/session.py +0 -0
  102. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/__init__.py +0 -0
  103. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/claude_stream.py +0 -0
  104. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/clock.py +0 -0
  105. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/codex_app_server.py +0 -0
  106. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/confinement.py +0 -0
  107. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/contracts.py +0 -0
  108. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/conversation.py +0 -0
  109. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/probe.py +0 -0
  110. {agentshim-0.15.7 → agentshim-0.17.0}/agentshim/testing/process.py +0 -0
  111. {agentshim-0.15.7 → agentshim-0.17.0}/tests/fixtures/claude_stream/README.md +0 -0
  112. {agentshim-0.15.7 → agentshim-0.17.0}/tests/fixtures/codex/README.md +0 -0
  113. {agentshim-0.15.7 → agentshim-0.17.0}/tests/fixtures/codex_app_server/README.md +0 -0
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.0 (2026-10-15)
4
+
5
+ ### Added
6
+
7
+ - `host_auth_plan(profile, env=, home=)` returns the `AuthPlan` that reproduces how the
8
+ CLI logs in by itself on a host: the first present credential source of any kind, plus
9
+ the host's endpoint variables exactly as set, so a confined copy given only the plan
10
+ sends the same credential to the same place. A host base URL is reproduced, not
11
+ validated, and a credential goes to the host's endpoint whatever its kind (Claude Code
12
+ sends `CLAUDE_CODE_OAUTH_TOKEN` to a custom `ANTHROPIC_BASE_URL`). It raises
13
+ `HostAuthUnplannableError`, whose `reason` (`HostAuthGap`) is `UNCLASSIFIED`,
14
+ `NO_CREDENTIAL`, `EXTERNAL_CREDENTIAL` or `SETTINGS_ENV`, when no plan can reproduce
15
+ the host's login.
16
+ - `ExternalCredential`, a `CredentialSource` for a way the CLI logs in that no plan can
17
+ hand over, detected by variables, paths or settings keys. Claude declares a cloud
18
+ provider (`CLAUDE_CODE_USE_BEDROCK`, `_VERTEX`, `_FOUNDRY`), `apiKeyHelper`, and
19
+ Anthropic profiles at their documented places in its precedence; Gemini declares an
20
+ auth type selected in settings or by variable, and `.gemini/.env`.
21
+ - `ProviderProfile.settings` (`SettingsSpec`): the settings files a CLI reads at start
22
+ that can change how it logs in, and the key of the block it applies over its
23
+ environment (Claude's `env`).
24
+
25
+ ### Changed
26
+
27
+ - `CredentialSource` is now `EnvCredential | FileCredential | ExternalCredential`;
28
+ code that matched on two variants must handle the third. `plan_auth` never chooses an
29
+ `ExternalCredential` and names a present one in `AuthPlan.withheld`.
30
+
31
+ ## 0.16.0 (2026-10-14)
32
+
33
+ ### Added
34
+
35
+ - `plan_auth(profile, AuthPolicy, env=, home=)` chooses the one credential a CLI logs in
36
+ with and returns an `AuthPlan`: the exact variables and files to hand it, and the names
37
+ of the credentials it withheld. `AuthPolicy` names the allowed `CredentialKind`s
38
+ (`API_KEY`, `SUBSCRIPTION`) and an optional endpoint; with no endpoint, a base URL in
39
+ the environment is withheld. `AuthUnavailableError` names what is missing.
40
+ - `ProviderProfile.credential_sources` (`EnvCredential`, `FileCredential`, in the CLI's
41
+ precedence order) and `ProviderProfile.endpoint` (`EndpointSpec`) declare each CLI's
42
+ credentials as data. opencode declares none, so no policy can be enforced for it.
43
+ - `ProviderStatus.credential`: the kind of credential the CLI reports it is using (Claude
44
+ from `claude auth status`'s `authMethod`, Codex from `codex login status`), or `None`.
45
+
46
+ ### Changed
47
+
48
+ - `auth_env_vars` lists `CLAUDE_CODE_OAUTH_TOKEN` (claude) and `CODEX_API_KEY` (codex),
49
+ which the CLIs and their readiness probes already honoured.
50
+
3
51
  ## 0.15.7 (2026-10-09)
4
52
 
5
53
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentshim
3
- Version: 0.15.7
3
+ Version: 0.17.0
4
4
  Summary: Provider-agnostic coding-agent CLI shims
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -15,7 +15,10 @@ from .core import (
15
15
  ApprovalPolicy,
16
16
  ArgvContext,
17
17
  AssistantText,
18
+ AuthPlan,
19
+ AuthPolicy,
18
20
  AuthState,
21
+ AuthUnavailableError,
19
22
  Checkpoint,
20
23
  CheckpointStore,
21
24
  CliCheckError,
@@ -32,9 +35,17 @@ from .core import (
32
35
  ContinuityError,
33
36
  Conversation,
34
37
  ConversationSpec,
38
+ CredentialKind,
39
+ CredentialSource,
40
+ EndpointSpec,
41
+ EnvCredential,
35
42
  EventHandlerBase,
43
+ ExternalCredential,
36
44
  FailureKind,
45
+ FileCredential,
37
46
  FlagsInstallation,
47
+ HostAuthGap,
48
+ HostAuthUnplannableError,
38
49
  HttpMcpServer,
39
50
  IdAllocator,
40
51
  InMemoryCheckpointStore,
@@ -80,12 +91,14 @@ from .core import (
80
91
  SessionStarted,
81
92
  SessionState,
82
93
  SessionStateError,
94
+ SettingsSpec,
83
95
  SkillInvoked,
84
96
  SkillScope,
85
97
  SkillsDiscovered,
86
98
  SkillSignal,
87
99
  SkillSummary,
88
100
  SkillTracker,
101
+ StagedCredentialFile,
89
102
  Stderr,
90
103
  StdioMcpServer,
91
104
  SteerableConversation,
@@ -114,12 +127,14 @@ from .core import (
114
127
  cost_usd,
115
128
  default_pricing,
116
129
  dialect_problems,
130
+ host_auth_plan,
117
131
  install_config_file,
118
132
  interactive_env,
119
133
  materialize,
120
134
  normalize,
121
135
  normalized_usage,
122
136
  parse_json_object,
137
+ plan_auth,
123
138
  prepare_config_home,
124
139
  price_for,
125
140
  )
@@ -156,7 +171,7 @@ from .providers.opencode import OpencodeProvider
156
171
  from .runtime import Agent
157
172
  from .session import Session, Turn, TurnTicket, map_mcp_servers
158
173
 
159
- __version__ = "0.15.7"
174
+ __version__ = "0.17.0"
160
175
 
161
176
  __all__ = [
162
177
  "Agent",
@@ -168,7 +183,10 @@ __all__ = [
168
183
  "ApprovalPolicy",
169
184
  "ArgvContext",
170
185
  "AssistantText",
186
+ "AuthPlan",
187
+ "AuthPolicy",
171
188
  "AuthState",
189
+ "AuthUnavailableError",
172
190
  "CallbackCommandStreamSink",
173
191
  "Checkpoint",
174
192
  "CheckpointStore",
@@ -200,11 +218,19 @@ __all__ = [
200
218
  "Conversation",
201
219
  "ConversationSpec",
202
220
  "CopilotProvider",
221
+ "CredentialKind",
222
+ "CredentialSource",
203
223
  "DockerExecConfinement",
224
+ "EndpointSpec",
225
+ "EnvCredential",
204
226
  "EventHandlerBase",
227
+ "ExternalCredential",
205
228
  "FailureKind",
229
+ "FileCredential",
206
230
  "FlagsInstallation",
207
231
  "GeminiProvider",
232
+ "HostAuthGap",
233
+ "HostAuthUnplannableError",
208
234
  "HostCommandExecutor",
209
235
  "HostProcess",
210
236
  "HttpMcpServer",
@@ -260,6 +286,7 @@ __all__ = [
260
286
  "SessionStarted",
261
287
  "SessionState",
262
288
  "SessionStateError",
289
+ "SettingsSpec",
263
290
  "SkillInvoked",
264
291
  "SkillScope",
265
292
  "SkillSignal",
@@ -267,6 +294,7 @@ __all__ = [
267
294
  "SkillTracker",
268
295
  "SkillsDiscovered",
269
296
  "SpawnRequest",
297
+ "StagedCredentialFile",
270
298
  "Stderr",
271
299
  "StderrLine",
272
300
  "StdioMcpServer",
@@ -303,6 +331,7 @@ __all__ = [
303
331
  "default_pricing",
304
332
  "dialect_problems",
305
333
  "get_provider",
334
+ "host_auth_plan",
306
335
  "install_config_file",
307
336
  "interactive_env",
308
337
  "map_mcp_servers",
@@ -310,6 +339,7 @@ __all__ = [
310
339
  "normalize",
311
340
  "normalized_usage",
312
341
  "parse_json_object",
342
+ "plan_auth",
313
343
  "prepare_config_home",
314
344
  "price_for",
315
345
  "probe_provider",
@@ -7,6 +7,23 @@ this package may not do.
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
+ from .auth import (
11
+ AuthPlan,
12
+ AuthPolicy,
13
+ AuthUnavailableError,
14
+ CredentialKind,
15
+ CredentialSource,
16
+ EndpointSpec,
17
+ EnvCredential,
18
+ ExternalCredential,
19
+ FileCredential,
20
+ HostAuthGap,
21
+ HostAuthUnplannableError,
22
+ SettingsSpec,
23
+ StagedCredentialFile,
24
+ host_auth_plan,
25
+ plan_auth,
26
+ )
10
27
  from .checkpoints import Checkpoint, CheckpointStore, InMemoryCheckpointStore
11
28
  from .clock import Clock, StopSignal, SystemClock
12
29
  from .conversation import (
@@ -116,7 +133,10 @@ __all__ = [
116
133
  "ApprovalPolicy",
117
134
  "ArgvContext",
118
135
  "AssistantText",
136
+ "AuthPlan",
137
+ "AuthPolicy",
119
138
  "AuthState",
139
+ "AuthUnavailableError",
120
140
  "Checkpoint",
121
141
  "CheckpointStore",
122
142
  "CliCheckError",
@@ -133,9 +153,17 @@ __all__ = [
133
153
  "ContinuityError",
134
154
  "Conversation",
135
155
  "ConversationSpec",
156
+ "CredentialKind",
157
+ "CredentialSource",
158
+ "EndpointSpec",
159
+ "EnvCredential",
136
160
  "EventHandlerBase",
161
+ "ExternalCredential",
137
162
  "FailureKind",
163
+ "FileCredential",
138
164
  "FlagsInstallation",
165
+ "HostAuthGap",
166
+ "HostAuthUnplannableError",
139
167
  "HttpMcpServer",
140
168
  "IdAllocator",
141
169
  "InMemoryCheckpointStore",
@@ -181,12 +209,14 @@ __all__ = [
181
209
  "SessionStarted",
182
210
  "SessionState",
183
211
  "SessionStateError",
212
+ "SettingsSpec",
184
213
  "SkillInvoked",
185
214
  "SkillScope",
186
215
  "SkillSignal",
187
216
  "SkillSummary",
188
217
  "SkillTracker",
189
218
  "SkillsDiscovered",
219
+ "StagedCredentialFile",
190
220
  "Stderr",
191
221
  "StdioMcpServer",
192
222
  "SteerConsumed",
@@ -215,12 +245,14 @@ __all__ = [
215
245
  "cost_usd",
216
246
  "default_pricing",
217
247
  "dialect_problems",
248
+ "host_auth_plan",
218
249
  "install_config_file",
219
250
  "interactive_env",
220
251
  "materialize",
221
252
  "normalize",
222
253
  "normalized_usage",
223
254
  "parse_json_object",
255
+ "plan_auth",
224
256
  "prepare_config_home",
225
257
  "price_for",
226
258
  ]