agent-runtime-kit 0.2.0__tar.gz → 0.3.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 (71) hide show
  1. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/.gitignore +9 -1
  2. agent_runtime_kit-0.3.0/CHANGELOG.md +218 -0
  3. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/PKG-INFO +53 -19
  4. agent_runtime_kit-0.3.0/README.md +122 -0
  5. agent_runtime_kit-0.3.0/docs/api-stability.md +56 -0
  6. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/docs/capability-matrix.md +26 -11
  7. agent_runtime_kit-0.3.0/docs/providers.md +171 -0
  8. agent_runtime_kit-0.3.0/docs/quickstart.md +47 -0
  9. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/docs/sdk-evolution-agent-design.md +30 -9
  10. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/docs/sdk-evolution-agent.md +32 -9
  11. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/run_same_task.py +6 -4
  12. agent_runtime_kit-0.3.0/examples/sdk_evolution_agent/__init__.py +24 -0
  13. agent_runtime_kit-0.3.0/examples/sdk_evolution_agent/auth.py +189 -0
  14. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/behavior.py +50 -5
  15. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/cli.py +174 -124
  16. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/models.py +3 -1
  17. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/release_notes.py +198 -12
  18. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/snapshots.py +31 -1
  19. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/stages.py +47 -9
  20. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/pyproject.toml +65 -9
  21. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/__init__.py +4 -0
  22. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/_errors.py +6 -6
  23. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/_runtime.py +9 -0
  24. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/_types.py +149 -8
  25. agent_runtime_kit-0.3.0/src/agent_runtime_kit/adapters/_common.py +334 -0
  26. agent_runtime_kit-0.3.0/src/agent_runtime_kit/adapters/antigravity.py +982 -0
  27. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/adapters/claude.py +304 -63
  28. agent_runtime_kit-0.3.0/src/agent_runtime_kit/adapters/codex.py +740 -0
  29. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/events.py +67 -23
  30. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/registry.py +6 -3
  31. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/testing/fakes.py +9 -0
  32. agent_runtime_kit-0.3.0/tests/test_adapter_protocol.py +102 -0
  33. agent_runtime_kit-0.3.0/tests/test_antigravity_adapter.py +1276 -0
  34. agent_runtime_kit-0.3.0/tests/test_claude_adapter.py +826 -0
  35. agent_runtime_kit-0.3.0/tests/test_codex_adapter.py +958 -0
  36. agent_runtime_kit-0.3.0/tests/test_core.py +192 -0
  37. agent_runtime_kit-0.3.0/tests/test_events.py +204 -0
  38. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_sdk_evolution_agent.py +669 -16
  39. agent_runtime_kit-0.2.0/README.md +0 -88
  40. agent_runtime_kit-0.2.0/docs/providers.md +0 -73
  41. agent_runtime_kit-0.2.0/docs/publish-checklist.md +0 -77
  42. agent_runtime_kit-0.2.0/docs/quickstart.md +0 -34
  43. agent_runtime_kit-0.2.0/examples/sdk_evolution_agent/__init__.py +0 -14
  44. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/_common.py +0 -181
  45. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/antigravity.py +0 -558
  46. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/codex.py +0 -485
  47. agent_runtime_kit-0.2.0/tests/test_antigravity_adapter.py +0 -458
  48. agent_runtime_kit-0.2.0/tests/test_claude_adapter.py +0 -342
  49. agent_runtime_kit-0.2.0/tests/test_codex_adapter.py +0 -393
  50. agent_runtime_kit-0.2.0/tests/test_core.py +0 -53
  51. agent_runtime_kit-0.2.0/tests/test_events.py +0 -99
  52. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/LICENSE +0 -0
  53. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/docs/live-smoke.md +0 -0
  54. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/docs/mestre-migration.md +0 -0
  55. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/__init__.py +0 -0
  56. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/__main__.py +0 -0
  57. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/collectors.py +0 -0
  58. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/current_state.py +0 -0
  59. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/events.py +0 -0
  60. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/pr.py +0 -0
  61. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/report.py +0 -0
  62. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/examples/sdk_evolution_agent/schemas.py +0 -0
  63. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/adapters/__init__.py +0 -0
  64. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/adapters/diagnostics.py +0 -0
  65. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/py.typed +0 -0
  66. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/src/agent_runtime_kit/testing/__init__.py +0 -0
  67. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_live_smoke.py +0 -0
  68. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_mestre_compatibility.py +0 -0
  69. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_optional_dependencies.py +0 -0
  70. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_provider_diagnostics.py +0 -0
  71. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.3.0}/tests/test_sdk_contract.py +0 -0
@@ -13,7 +13,15 @@ htmlcov/
13
13
  .DS_Store
14
14
 
15
15
  # Local generated reports
16
- reports/sdk-evolution/
16
+ reports/
17
+
18
+ # Local review artifacts
19
+ CODE-REVIEW.md
20
+ REVIEW.md
21
+
22
+ # Secrets / local environment
23
+ .env
24
+ .env.*
17
25
 
18
26
  # Virtual environments
19
27
  .venv
@@ -0,0 +1,218 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 0.3.0 - 2026-07-02
9
+
10
+ ### Added
11
+
12
+ - Codex runtimes can now opt into reusable SDK process lifecycle with
13
+ `CodexAgentRuntime(reuse_process=True)`, `await runtime.aclose()`, or
14
+ `async with CodexAgentRuntime(..., reuse_process=True)`. Reuse keeps the Codex
15
+ app-server process alive across compatible tasks without implicitly reusing
16
+ Codex threads or sessions.
17
+ - Claude and Antigravity runtimes can now opt into adapter-owned SDK process
18
+ lifecycle with the same `reuse_process=True`, `aclose()`, and async context
19
+ manager shape. Claude reuses `ClaudeSDKClient` while preserving per-task
20
+ stream session IDs; Antigravity only reuses for explicit conversation IDs
21
+ because its SDK process is conversation-scoped.
22
+ - The SDK evolution agent now enables vendor process reuse for multi-stage
23
+ SDK-backed runs and closes internally owned runtimes when the run exits.
24
+ - `FinishReason` enum of the canonical `finish_reason` values, plus first-class
25
+ `AgentTask.model` and `AgentTask.reasoning_effort` fields (keyword-only, so
26
+ the positional layout that predates them is unchanged; the
27
+ `metadata["model"]`/`metadata["reasoning_effort"]` aliases keep working).
28
+ `model` is honored by all three adapters. `reasoning_effort` maps to the
29
+ Claude and Codex `effort` options; Antigravity has no reasoning-effort
30
+ control and rejects the field with a typed error instead of silently
31
+ ignoring it.
32
+ - Third-party runtime kinds: `AgentRuntimeKind.coerce` and the registry accept
33
+ namespaced strings (e.g. `"x-myorg-agent"`), and `runtime_kind_value()`
34
+ returns the wire form of either shape.
35
+ - Tool observability parity: the Codex adapter emits `agent.tool.requested` /
36
+ `agent.tool.completed` events, Claude tool audits carry `result_preview`, and
37
+ Antigravity audits are recorded per call rather than collapsed by tool name.
38
+ - Claude reports the effective vendor permission mode in
39
+ `AgentResult.metadata["permission_mode"]`, and the Codex/Antigravity adapters
40
+ record SDK kwargs dropped for compatibility in
41
+ `AgentResult.metadata["dropped_options"]`.
42
+ - `docs/api-stability.md` documents the public surface, the 0.x compatibility
43
+ policy, and the vendor SDK pinning policy.
44
+
45
+ ### Changed
46
+
47
+ - BREAKING: the `AgentRuntime` protocol now requires `aclose()` and async
48
+ context-manager support, and `kind` is typed `AgentRuntimeKind | str` so
49
+ third-party runtimes can conform without forking the enum.
50
+ - BREAKING: mapping fields on `AgentTask`, `AgentResult`, and related models are
51
+ copied at construction and read-only at the top level afterwards (in-place
52
+ mutation of the mapping itself raises `TypeError`; the freeze is shallow, so
53
+ nested containers are not copied or frozen); `dataclasses.asdict`,
54
+ `copy.deepcopy`, `pickle`, and JSON serialization keep working.
55
+ - Claude: `CAUTIOUS` now maps to the vendor `default` permission mode instead of
56
+ `acceptEdits` (it was looser than `DEFAULT`), and a `READ_ONLY` filesystem
57
+ forces `plan` mode.
58
+ - Claude: an unsatisfied `output_schema` or an empty completion now returns
59
+ `finish_reason="failed"` instead of silent success.
60
+ - Codex: `Usage` reports the executed turn rather than cumulative
61
+ across-the-thread totals when resuming sessions.
62
+ - All adapters: `AgentResult.session_id` falls back to the task-supplied session
63
+ handle when the SDK response omits one.
64
+ - Antigravity: explicit `vertex=True` takes precedence over ambient API keys,
65
+ combining a `READ_ONLY` filesystem or `STRICT` mode with non-read-only
66
+ `allowed_tools` is rejected instead of silently granted, and vendor stop
67
+ reasons map to `max_tokens`/`failed` finish reasons.
68
+ - BREAKING: Antigravity deny-lists are now subtractive in every mode.
69
+ `disabled_tools` means "enable everything else", which re-enabled write and
70
+ destructive tools past the mode's baseline; now only `PERMISSIVE` (whose
71
+ baseline is every tool) still takes that route, while `READ_ONLY`/`STRICT`
72
+ get the read-only toolset minus the denied tools and `DEFAULT`/`CAUTIOUS`
73
+ the nondestructive toolset minus the denied tools.
74
+ - Vendor SDK dependencies now carry pre-1.0 upper bounds (`claude-agent-sdk<0.3`,
75
+ `openai-codex<0.2`, `google-antigravity<0.2`) so a breaking upstream minor
76
+ cannot reach fresh installs before adapters are revalidated.
77
+ - BREAKING: permission-critical SDK options fail closed under vendor drift. If
78
+ the installed SDK cannot accept Claude's `permission_mode` (or a requested
79
+ tool allow/deny list), Codex's `sandbox`/`approval_mode`, or Antigravity's
80
+ `capabilities`/`policies`/workspace scoping, `run()` raises
81
+ `UnsupportedTaskInputError` instead of silently running under the SDK's
82
+ default (more permissive) posture. A requested `budget_usd` fails closed the
83
+ same way if the installed Claude SDK stops accepting `max_budget_usd`, so a
84
+ spend cap can never silently vanish. Non-security drift is still tolerated
85
+ and recorded in `AgentResult.metadata["dropped_options"]`.
86
+
87
+ - Installation docs now lead with `agent-runtime-kit[all]` for the easiest
88
+ full-provider setup and explain provider extras as dependency isolation, not a
89
+ separate API.
90
+ - README and package metadata now include clearer About copy and searchable
91
+ tags for agent runtime, coding-agent, Claude Code, Codex, Antigravity, MCP,
92
+ typed Python, and async Python use cases.
93
+ - The source distribution now allowlists individual public docs instead of the
94
+ whole `docs/` directory.
95
+
96
+ ### Removed
97
+
98
+ - Removed the stale internal publish checklist from public documentation.
99
+ - BREAKING: removed the dead `AgentCapabilities.sdk_turn_limit` field (no
100
+ adapter ever read it).
101
+
102
+ ### Fixed
103
+
104
+ - Reused vendor SDK clients are evicted when a run is interrupted or cancelled
105
+ mid-flight, and `aclose()` no longer races an in-flight run on the same
106
+ runtime instance.
107
+ - Codex: a turn ending in the SDK's non-terminal `inProgress` status — or any
108
+ future unknown status — now fails closed as `finish_reason="failed"` instead
109
+ of reading as success with partial output.
110
+ - Codex: `Usage.input_tokens` now excludes cached input tokens, which are
111
+ reported separately in `cache_read_tokens` (matching the documented `Usage`
112
+ contract and the Antigravity adapter) instead of being double-counted across
113
+ both fields.
114
+ - Event redaction now covers camelCase secret keys (e.g. `accessToken`) and
115
+ separator-less ones (e.g. `accesstoken`, `SESSIONTOKEN`) while keeping plural
116
+ usage counters (`inputTokens`, `totaltokens`) visible, and the event
117
+ sanitizer bounds recursion depth and detects reference cycles so pathological
118
+ metadata cannot abort a run.
119
+ - SDK evolution example: inspecting candidate SDK versions (which pip-installs
120
+ and imports freshly downloaded upstream code) is now opt-in via
121
+ `--inspect-candidates` and runs in a credential-scrubbed environment — and
122
+ the behavior probes now honor the same gate and scrub instead of installing
123
+ candidates unconditionally with the caller's full environment (skipped
124
+ candidates are recorded explicitly). `--draft-pr` no longer fails when the
125
+ report directory is gitignored.
126
+ - SDK evolution example: release-note links extracted from fetched pages are
127
+ only followed when they resolve to `https://github.com` (a protocol-relative
128
+ href in user-generated discussion markup could otherwise trigger an off-site
129
+ request), and a configured-but-failing GitHub GraphQL token now surfaces on
130
+ the source instead of silently downgrading to the unauthenticated scrape.
131
+
132
+ ## 0.2.0 - 2026-06-23
133
+
134
+ ### Added
135
+
136
+ - Added the local SDK evolution agent example, including runtime-backed
137
+ direction analysis, architecture decision, reviewer stages, report generation,
138
+ and optional draft PR creation.
139
+ - Added release-note collection, candidate API snapshots/diffs, behavior probes,
140
+ current-state promotion manifests, and deterministic implementation gates for
141
+ SDK update runs.
142
+ - Added documentation for running the SDK evolution agent locally with supported
143
+ vendor credentials and reviewing generated evidence.
144
+
145
+ ### Changed
146
+
147
+ - Updated the lockfile to the resolver-selected current Claude and Antigravity
148
+ SDK versions after the evolution agent validated adapter-contract behavior:
149
+ `claude-agent-sdk` 0.2.106 and `google-antigravity` 0.1.4.
150
+ - SDK evolution current-state manifests now record repo-relative checked-in
151
+ artifact paths rather than machine-local absolute paths.
152
+
153
+ ## 0.1.1 - 2026-06-11
154
+
155
+ ### Fixed
156
+
157
+ - **Codex approval-mode mapping was inverted** and is now corrected. `STRICT` and
158
+ `CAUTIOUS` map to `deny_all` (never escalate beyond the sandbox); `DEFAULT` and
159
+ `PERMISSIVE` map to `auto_review` (escalations are auto-adjudicated). Previously a
160
+ `STRICT` caller could have escalations auto-approved and a `PERMISSIVE` caller had
161
+ them hard-denied — exactly backwards.
162
+ - Antigravity MCP stdio server configuration no longer crashes: the required `name`
163
+ field is now passed to the SDK model.
164
+ - The `mypy` strict gate now passes identically in core-only and all-extras
165
+ environments (per-module import overrides replace inline ignores).
166
+ - Claude reports `finish_reason="max_turns"` when a turn is truncated by the
167
+ max-turns limit instead of a generic failure.
168
+ - Codex honors `TurnResult.status`: a `failed` or `interrupted` turn maps to the
169
+ matching `finish_reason` and surfaces the structured error message instead of being
170
+ reported as success.
171
+
172
+ ### Changed
173
+
174
+ - **Antigravity DEFAULT permission posture is now safer.** With no `allowed_tools`,
175
+ `DEFAULT` (and `CAUTIOUS`) now use the nondestructive toolset (no `run_command`)
176
+ instead of granting all tools plus an allow-all policy. `STRICT` (or any read-only
177
+ filesystem) uses the read-only toolset with no `allow_all` policy; `PERMISSIVE`
178
+ keeps all tools.
179
+ - **Unsupported task fields now raise `UnsupportedTaskInputError` instead of being
180
+ silently ignored.** Codex rejects `allowed_tools`, `disallowed_tools`, `budget_usd`,
181
+ and `permissions.network` (MCP was already rejected); Antigravity rejects
182
+ `budget_usd` and `permissions.network`, and rejects combining an allow-list with a
183
+ deny-list (the SDK requires them to be mutually exclusive); Claude rejects
184
+ `permissions.network`. Only Claude maps `budget_usd`.
185
+ - Missing-SDK and missing-credential paths now raise the typed
186
+ `AgentRuntimeUnavailableError` instead of a bare `RuntimeError`.
187
+ - Antigravity session and app-data storage moved from a world-shared
188
+ `/tmp/agent-runtime-kit` path to `$XDG_CACHE_HOME/agent-runtime-kit` (default
189
+ `~/.cache/agent-runtime-kit`, created `0o700`), overridable via
190
+ `AntigravityAgentRuntime(data_dir=...)`. Sessions now survive reboots and are not
191
+ exposed to other users on multi-user machines.
192
+ - Antigravity maps `disallowed_tools` to `CapabilitiesConfig.disabled_tools` and
193
+ validates tool names against the `BuiltinTools` enum, raising a typed error for an
194
+ unknown name instead of leaking a raw validation error.
195
+ - Build now requires `hatchling>=1.26` (for the PEP 639 `license = "MIT"` string),
196
+ and the deprecated `License :: OSI Approved :: MIT License` classifier was removed.
197
+
198
+ ### Added
199
+
200
+ - Claude streaming is now real: incremental output deltas and
201
+ `tool_requested`/`tool_completed` events are emitted while the SDK runs.
202
+ - Codex tool audits are now produced, parsed from `TurnResult.items` (command
203
+ executions, MCP tool calls, dynamic tool calls, and web searches).
204
+ - Claude records vendor-option kwargs it had to drop due to SDK drift in
205
+ `AgentResult.metadata["dropped_options"]`, keeping silent omissions observable.
206
+ - A continuous-integration workflow runs `ruff`, `mypy`, and `pytest` across
207
+ Python 3.10–3.13 in both the core-only and all-extras dependency lanes, and the
208
+ PyPI publish workflow now gates on a test job before building.
209
+ - `tests/test_sdk_contract.py` introspects the real vendor SDK surfaces and
210
+ auto-skips when the SDKs are not installed.
211
+ - An sdist allowlist ensures only `src`, `tests`, `docs`, `examples`, `README.md`,
212
+ `LICENSE`, and `pyproject.toml` are packaged for PyPI (internal planning
213
+ artifacts, `uv.lock`, and caches are no longer shipped).
214
+
215
+ ## 0.1.0
216
+
217
+ - Initial release: one typed async runtime API for the Claude, Codex, and
218
+ Antigravity agent SDKs, with capability diagnostics, event sinks, and adapters.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-runtime-kit
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: One typed runtime API for Claude, Codex, and Antigravity agent SDKs.
5
5
  Project-URL: Homepage, https://github.com/ebarti/agent-runtime-kit
6
6
  Project-URL: Repository, https://github.com/ebarti/agent-runtime-kit
@@ -8,7 +8,7 @@ Project-URL: Issues, https://github.com/ebarti/agent-runtime-kit/issues
8
8
  Author: Eloi Barti
9
9
  License-Expression: MIT
10
10
  License-File: LICENSE
11
- Keywords: agents,antigravity,claude,codex,sdk
11
+ Keywords: agent-runtime,agent-sdk,agents,antigravity,async-python,claude,claude-code,codex,coding-agents,developer-tools,google-antigravity,mcp,openai-codex,runtime-api,sdk,typed-python
12
12
  Classifier: Development Status :: 3 - Alpha
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Programming Language :: Python :: 3
@@ -19,15 +19,15 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Typing :: Typed
20
20
  Requires-Python: >=3.10
21
21
  Provides-Extra: all
22
- Requires-Dist: claude-agent-sdk>=0.2.87; extra == 'all'
23
- Requires-Dist: google-antigravity>=0.1.2; extra == 'all'
24
- Requires-Dist: openai-codex>=0.1.0b3; extra == 'all'
22
+ Requires-Dist: claude-agent-sdk<0.3,>=0.2.87; extra == 'all'
23
+ Requires-Dist: google-antigravity<0.2,>=0.1.2; extra == 'all'
24
+ Requires-Dist: openai-codex<0.2,>=0.1.0b3; extra == 'all'
25
25
  Provides-Extra: antigravity
26
- Requires-Dist: google-antigravity>=0.1.2; extra == 'antigravity'
26
+ Requires-Dist: google-antigravity<0.2,>=0.1.2; extra == 'antigravity'
27
27
  Provides-Extra: claude
28
- Requires-Dist: claude-agent-sdk>=0.2.87; extra == 'claude'
28
+ Requires-Dist: claude-agent-sdk<0.3,>=0.2.87; extra == 'claude'
29
29
  Provides-Extra: codex
30
- Requires-Dist: openai-codex>=0.1.0b3; extra == 'codex'
30
+ Requires-Dist: openai-codex<0.2,>=0.1.0b3; extra == 'codex'
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
  # agent-runtime-kit
@@ -37,6 +37,22 @@ applications one typed async API for dispatching an agentic task through Claude
37
37
  Agent SDK, OpenAI Codex SDK, or Google Antigravity SDK while keeping provider
38
38
  capabilities visible.
39
39
 
40
+ **Tags:** `agent-sdk` `agent-runtime` `coding-agents` `claude-code`
41
+ `openai-codex` `google-antigravity` `mcp` `typed-python` `async-python`
42
+ `developer-tools`
43
+
44
+ ## About
45
+
46
+ `agent-runtime-kit` is for Python developers who want to run coding-agent tasks
47
+ through vendor runtimes without rewriting their application around each SDK. It
48
+ normalizes the runtime boundary: task inputs, capability checks, event streams,
49
+ tool audits, availability diagnostics, and typed results.
50
+
51
+ The library keeps vendor differences visible. Claude, Codex, and Antigravity
52
+ still expose different capabilities, permission models, setup requirements, and
53
+ unsupported fields. `agent-runtime-kit` gives those differences a consistent
54
+ shape instead of hiding them behind a lowest-common-denominator wrapper.
55
+
40
56
  The package is intentionally not a router, benchmark harness, queue, hosted
41
57
  service, or full agent framework. It is the reusable layer underneath those
42
58
  systems: task models, runtime capabilities, event sinks, availability
@@ -44,21 +60,34 @@ diagnostics, and adapters.
44
60
 
45
61
  ## Install
46
62
 
47
- Core only:
63
+ If you want all first-party runtimes available, install the `all` extra:
64
+
65
+ ```bash
66
+ pip install "agent-runtime-kit[all]"
67
+ ```
68
+
69
+ Install the dependency-free core when you only need the public models, fake
70
+ runtime, registry, diagnostics types, or you plan to add provider SDKs later:
48
71
 
49
72
  ```bash
50
73
  pip install agent-runtime-kit
51
74
  ```
52
75
 
53
- Provider extras:
76
+ Install a single provider extra when your application only dispatches through
77
+ one vendor runtime:
54
78
 
55
79
  ```bash
56
80
  pip install "agent-runtime-kit[claude]"
57
81
  pip install "agent-runtime-kit[codex]"
58
82
  pip install "agent-runtime-kit[antigravity]"
59
- pip install "agent-runtime-kit[all]"
60
83
  ```
61
84
 
85
+ Provider extras are a packaging boundary, not a separate API. They keep the
86
+ core importable without vendor SDKs, avoid forcing every user to install every
87
+ CLI binary or compiled runtime wheel, and contain dependency drift when one
88
+ fast-moving vendor SDK changes independently of the others. Missing adapters
89
+ raise typed setup errors that point to the matching extra.
90
+
62
91
  ```python
63
92
  import asyncio
64
93
 
@@ -100,21 +129,26 @@ asyncio.run(main())
100
129
 
101
130
  ## Runtime Fields
102
131
 
103
- `AgentTask` supports goal, system prompt, working directory, permission profile,
104
- MCP stdio servers, session/resume handles, output schema, budget, metadata, and
105
- an async event sink. Where a runtime cannot honor a field (for example only
106
- Claude maps `budget_usd`; Codex and Antigravity reject it with a typed
107
- `UnsupportedTaskInputError`) the adapter raises rather than silently dropping it.
132
+ `AgentTask` supports goal, system prompt, model, reasoning effort, working
133
+ directory, permission profile, MCP stdio servers, session/resume handles, output
134
+ schema, budget, metadata, and an async event sink. (`model` and
135
+ `reasoning_effort` are first-class fields; the legacy `metadata["model"]` /
136
+ `metadata["reasoning_effort"]` aliases still work.) Where a runtime cannot honor
137
+ a field (for example only Claude maps `budget_usd`; Codex and Antigravity reject
138
+ it with a typed `UnsupportedTaskInputError`) the adapter raises rather than
139
+ silently dropping it.
108
140
 
109
- `AgentResult` returns output, finish reason, parsed structured output, usage,
110
- cost, session id, artifacts, tool-call audits, and provider metadata.
141
+ `AgentResult` returns output, finish reason (see `FinishReason`), parsed
142
+ structured output, usage, cost, session id, tool-call audits, and provider
143
+ metadata. `artifacts` is a reserved field: no built-in runtime populates it yet,
144
+ so it is always an empty tuple today.
111
145
 
112
146
  ## Docs
113
147
 
114
148
  - [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
115
149
  - [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
116
150
  - [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
151
+ - [API stability](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/api-stability.md)
117
152
  - [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
118
153
  - [Mestre migration notes](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/mestre-migration.md)
119
- - [Publish checklist](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/publish-checklist.md)
120
154
  - [SDK evolution agent](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/sdk-evolution-agent.md)
@@ -0,0 +1,122 @@
1
+ # agent-runtime-kit
2
+
3
+ `agent-runtime-kit` is a small Python runtime layer for agent SDKs. It gives
4
+ applications one typed async API for dispatching an agentic task through Claude
5
+ Agent SDK, OpenAI Codex SDK, or Google Antigravity SDK while keeping provider
6
+ capabilities visible.
7
+
8
+ **Tags:** `agent-sdk` `agent-runtime` `coding-agents` `claude-code`
9
+ `openai-codex` `google-antigravity` `mcp` `typed-python` `async-python`
10
+ `developer-tools`
11
+
12
+ ## About
13
+
14
+ `agent-runtime-kit` is for Python developers who want to run coding-agent tasks
15
+ through vendor runtimes without rewriting their application around each SDK. It
16
+ normalizes the runtime boundary: task inputs, capability checks, event streams,
17
+ tool audits, availability diagnostics, and typed results.
18
+
19
+ The library keeps vendor differences visible. Claude, Codex, and Antigravity
20
+ still expose different capabilities, permission models, setup requirements, and
21
+ unsupported fields. `agent-runtime-kit` gives those differences a consistent
22
+ shape instead of hiding them behind a lowest-common-denominator wrapper.
23
+
24
+ The package is intentionally not a router, benchmark harness, queue, hosted
25
+ service, or full agent framework. It is the reusable layer underneath those
26
+ systems: task models, runtime capabilities, event sinks, availability
27
+ diagnostics, and adapters.
28
+
29
+ ## Install
30
+
31
+ If you want all first-party runtimes available, install the `all` extra:
32
+
33
+ ```bash
34
+ pip install "agent-runtime-kit[all]"
35
+ ```
36
+
37
+ Install the dependency-free core when you only need the public models, fake
38
+ runtime, registry, diagnostics types, or you plan to add provider SDKs later:
39
+
40
+ ```bash
41
+ pip install agent-runtime-kit
42
+ ```
43
+
44
+ Install a single provider extra when your application only dispatches through
45
+ one vendor runtime:
46
+
47
+ ```bash
48
+ pip install "agent-runtime-kit[claude]"
49
+ pip install "agent-runtime-kit[codex]"
50
+ pip install "agent-runtime-kit[antigravity]"
51
+ ```
52
+
53
+ Provider extras are a packaging boundary, not a separate API. They keep the
54
+ core importable without vendor SDKs, avoid forcing every user to install every
55
+ CLI binary or compiled runtime wheel, and contain dependency drift when one
56
+ fast-moving vendor SDK changes independently of the others. Missing adapters
57
+ raise typed setup errors that point to the matching extra.
58
+
59
+ ```python
60
+ import asyncio
61
+
62
+ from agent_runtime_kit import AgentTask, FakeAgentRuntime
63
+
64
+
65
+ async def main() -> None:
66
+ runtime = FakeAgentRuntime(output="done")
67
+ result = await runtime.run(AgentTask(goal="Summarize this repository"))
68
+ print(result.output)
69
+
70
+
71
+ asyncio.run(main())
72
+ ```
73
+
74
+ The core package has no Claude, Codex, or Antigravity dependency. Vendor SDKs
75
+ are added through optional extras.
76
+
77
+ ## Real Providers
78
+
79
+ ```python
80
+ import asyncio
81
+
82
+ from agent_runtime_kit import AgentTask
83
+ from agent_runtime_kit.adapters import ClaudeAgentRuntime
84
+
85
+
86
+ async def main() -> None:
87
+ runtime = ClaudeAgentRuntime(default_model="claude-sonnet-4-6")
88
+ diagnostic = runtime.availability()
89
+ if not diagnostic.available:
90
+ raise RuntimeError(diagnostic.message)
91
+ result = await runtime.run(AgentTask(goal="Summarize this repository"))
92
+ print(result.output)
93
+
94
+
95
+ asyncio.run(main())
96
+ ```
97
+
98
+ ## Runtime Fields
99
+
100
+ `AgentTask` supports goal, system prompt, model, reasoning effort, working
101
+ directory, permission profile, MCP stdio servers, session/resume handles, output
102
+ schema, budget, metadata, and an async event sink. (`model` and
103
+ `reasoning_effort` are first-class fields; the legacy `metadata["model"]` /
104
+ `metadata["reasoning_effort"]` aliases still work.) Where a runtime cannot honor
105
+ a field (for example only Claude maps `budget_usd`; Codex and Antigravity reject
106
+ it with a typed `UnsupportedTaskInputError`) the adapter raises rather than
107
+ silently dropping it.
108
+
109
+ `AgentResult` returns output, finish reason (see `FinishReason`), parsed
110
+ structured output, usage, cost, session id, tool-call audits, and provider
111
+ metadata. `artifacts` is a reserved field: no built-in runtime populates it yet,
112
+ so it is always an empty tuple today.
113
+
114
+ ## Docs
115
+
116
+ - [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
117
+ - [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
118
+ - [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
119
+ - [API stability](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/api-stability.md)
120
+ - [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
121
+ - [Mestre migration notes](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/mestre-migration.md)
122
+ - [SDK evolution agent](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/sdk-evolution-agent.md)
@@ -0,0 +1,56 @@
1
+ # API stability & versioning
2
+
3
+ `agent-runtime-kit` is pre-1.0 (`0.x`) and follows semantic versioning with the
4
+ usual pre-1.0 caveat: **breaking changes may land in a minor release** (`0.N`)
5
+ while the API is being shaped toward 1.0. Patch releases (`0.N.P`) are additive
6
+ or bug-fix only.
7
+
8
+ ## Public API
9
+
10
+ The supported surface is exactly what `agent_runtime_kit.__all__` exports (and
11
+ the vendor adapters under `agent_runtime_kit.adapters`). Anything whose module or
12
+ name begins with an underscore (`agent_runtime_kit._types`,
13
+ `agent_runtime_kit._runtime`, etc.) is internal and may change without notice —
14
+ import the names from the top-level package instead.
15
+
16
+ `agent_runtime_kit.testing` is public and intended for downstream test suites
17
+ (fake runtimes and event sinks).
18
+
19
+ ## Compatibility guarantees within a 0.x line
20
+
21
+ - **Runtime kinds are open.** `AgentRuntimeKind.coerce` accepts namespaced
22
+ strings (e.g. `"x-myorg-agent"`), and the registry stores them, so a third
23
+ party can ship an adapter for a new runtime without forking the enum.
24
+ - **Every runtime exposes the async lifecycle** (`aclose`, `async with`) declared
25
+ by the `AgentRuntime` protocol. Stateless runtimes implement it as a no-op.
26
+ - **`finish_reason` values** come from `FinishReason`. The field is typed `str`
27
+ for forward-compatibility, so new reasons can be added without a type break;
28
+ compare against `FinishReason` members rather than bare literals.
29
+ - **Result/task mappings are read-only at the top level.** `AgentTask`/`AgentResult`
30
+ copy `Mapping` fields into read-only dicts at construction; in-place writes to
31
+ the mapping itself raise `TypeError`. The freeze is shallow — nested containers
32
+ are not copied or frozen — so treat the whole structure as immutable by
33
+ convention and compare by value. The wrappers remain plain `dict` subclasses,
34
+ so `dataclasses.asdict`, `pickle`, `copy.deepcopy`, and JSON serialization
35
+ keep working.
36
+ - **Unsupported inputs raise, they are not dropped.** An adapter that cannot honor
37
+ a task field raises `UnsupportedTaskInputError`; the one exception is
38
+ vendor-option drift, which is recorded in
39
+ `AgentResult.metadata["dropped_options"]` instead.
40
+
41
+ ## Vendor SDK version policy
42
+
43
+ The vendor SDK extras are pinned with cautious upper bounds (e.g.
44
+ `claude-agent-sdk>=0.2.87,<0.3`) because those SDKs are themselves pre-1.0 and
45
+ have shipped breaking changes within a minor series. The bounds are raised
46
+ deliberately — after the contract tests and the SDK-evolution agent verify a new
47
+ version — rather than left unbounded. A weekly CI lane installs the latest vendor
48
+ SDKs *within the declared caps*, so drift inside an allowed range surfaces before
49
+ it reaches installed users; a release above a cap is by design invisible to that
50
+ lane until the cap is raised. A separate lane installs every direct dependency at
51
+ its declared floor so a stale minimum cannot sit undetected in the metadata.
52
+
53
+ ## Deprecation
54
+
55
+ When a public name is slated for removal it will be kept working for at least one
56
+ minor release with a `DeprecationWarning` before it is dropped.
@@ -9,10 +9,11 @@
9
9
  | Structured output | Native `output_format` when available | Native output schema / JSON parse fallback | Native response schema / JSON parse fallback |
10
10
  | MCP stdio servers | Yes | No per-task MCP config | Yes, without per-server env |
11
11
  | Permission mapping | `permission_mode` | approval mode + sandbox | capabilities + policies |
12
- | Streaming output events | Yes — incremental output/tool events while the SDK runs | Not enabled in v1 adapter | Yes — from response chunks |
13
- | Tool audit events | Yes — from streamed message blocks | Yes — parsed from `TurnResult` items | Yes — from tool chunks |
12
+ | Streaming output events | Yes — incremental `output.delta` while the SDK runs | No — a single `output.delta` at the end (non-streaming SDK) | Yes — from response chunks |
13
+ | Tool audit events | Yes — streamed from message blocks | Yes — emitted from parsed `TurnResult` items after the turn | Yes — from tool chunks |
14
+ | `vendor.turn` events | No | No | Yes — from thought/unknown chunks |
14
15
  | Missing package diagnostics | Yes (`AgentRuntimeUnavailableError`) | Yes (`AgentRuntimeUnavailableError`) | Yes (`AgentRuntimeUnavailableError`) |
15
- | Missing credential diagnostics | Provider-owned/local auth, including API key, Bedrock, Vertex, AWS, and Azure modes | Provider-owned/local auth, including ChatGPT/API key/custom providers/Bedrock | API key or Google ADC / Vertex config |
16
+ | Missing credential diagnostics | No — `availability()` reports available with an `auth_source` label; auth failures surface at `run()` | No — same as Claude (`auth_source` label; deferred) | Yes — `availability()` returns `MISSING_CREDENTIALS` when no API key / ADC-Vertex project is configured |
16
17
  | Live smoke test | Opt-in | Opt-in | Opt-in |
17
18
 
18
19
  The matrix is intentionally not a lowest-common-denominator contract. Adapters
@@ -28,19 +29,30 @@ review this table before assuming a mode is equivalent everywhere.
28
29
  | `PermissionMode` | Claude `permission_mode` | Codex `approval_mode` + sandbox | Antigravity toolset + policy |
29
30
  |------------------|--------------------------|---------------------------------|------------------------------|
30
31
  | `STRICT` | `plan` | `deny_all` (never escalate) | read-only toolset, no `allow_all` policy |
31
- | `CAUTIOUS` | `acceptEdits` | `deny_all` (never escalate) | nondestructive toolset (no `run_command`), `allow_all` policy |
32
+ | `CAUTIOUS` | `default` | `deny_all` (never escalate) | nondestructive toolset (no `run_command`), `allow_all` policy |
32
33
  | `DEFAULT` | `default` | `auto_review` (escalations auto-adjudicated) | nondestructive toolset (no `run_command`), `allow_all` policy |
33
34
  | `PERMISSIVE` | `bypassPermissions` | `auto_review` (escalations auto-adjudicated) | all tools, `allow_all` policy |
34
35
 
36
+ The ladder is monotonic: `CAUTIOUS` is never looser than `DEFAULT` on any
37
+ backend. Claude has no distinct cautious-execution tier, so `CAUTIOUS` and
38
+ `DEFAULT` both map to `default` (no auto-approval); `acceptEdits` is not used, as
39
+ it would auto-approve edits and in-cwd deletes. Claude's effective
40
+ `permission_mode` is echoed in `AgentResult.metadata["permission_mode"]`.
41
+
35
42
  Codex sandbox is derived from `FilesystemAccess`, independent of the approval
36
43
  mode: `READ_ONLY` → `read_only`, `WORKSPACE_WRITE` → `workspace_write`,
37
- `FULL_ACCESS` → `full_access`.
44
+ `FULL_ACCESS` → `full_access`. On Claude, a `READ_ONLY` filesystem forces
45
+ `plan` mode (no writes) regardless of `PermissionMode`.
38
46
 
39
47
  Antigravity toolset notes: the table above describes the default posture when
40
48
  `allowed_tools` is empty. A `READ_ONLY` filesystem forces the read-only toolset
41
- regardless of mode. User-supplied `allowed_tools`/`disallowed_tools` override the
42
- defaults and are validated against the `BuiltinTools` enum (for example
43
- `"view_file"`, not `"Read"`); an unknown name raises `UnsupportedTaskInputError`.
49
+ regardless of mode. User-supplied `allowed_tools`/`disallowed_tools` are
50
+ validated against the `BuiltinTools` enum (for example `"view_file"`, not
51
+ `"Read"`); an unknown name raises `UnsupportedTaskInputError`. An allow-list
52
+ naming a non-read-only tool under a `READ_ONLY` filesystem or `STRICT` mode is
53
+ rejected, and a deny-list subtracts from the mode's baseline toolset rather
54
+ than re-enabling everything else (only `PERMISSIVE`, whose baseline is every
55
+ tool, uses the SDK's `disabled_tools` route).
44
56
 
45
57
  ## Rejected inputs
46
58
 
@@ -49,9 +61,10 @@ surface to honor, rather than dropping them silently.
49
61
 
50
62
  | Field | Claude | Codex | Antigravity |
51
63
  |-------|--------|-------|-------------|
52
- | `budget_usd` | Mapped (`max_budget_usd`) | Rejected | Rejected |
64
+ | `budget_usd` | Mapped (`max_budget_usd`, fails closed under SDK drift) | Rejected | Rejected |
65
+ | `reasoning_effort` | Mapped (`effort`) | Mapped (`effort`) | Rejected (no SDK surface) |
53
66
  | `permissions.network` | Rejected | Rejected | Rejected |
54
- | `allowed_tools` / `disallowed_tools` | Mapped | Rejected | Mapped (`disallowed_tools` → `disabled_tools`); allow-list and deny-list are mutually exclusive and rejected if combined |
67
+ | `allowed_tools` / `disallowed_tools` | Mapped | Rejected | Mapped; deny-lists subtract from the mode's baseline (only `PERMISSIVE` uses `disabled_tools`), and allow-list plus deny-list together is rejected |
55
68
  | `mcp_servers` | Mapped | Rejected (no per-task MCP) | Mapped, without per-server `env` |
56
69
 
57
70
  Two task fields are informational only and not enforced by any built-in adapter:
@@ -60,7 +73,9 @@ Two task fields are informational only and not enforced by any built-in adapter:
60
73
 
61
74
  Claude additionally records any vendor-option kwargs it had to drop due to SDK
62
75
  drift in `AgentResult.metadata["dropped_options"]`, so silent omission stays
63
- observable.
76
+ observable. Permission-critical options are exempt from that drift tolerance:
77
+ when the installed SDK cannot accept them, the run fails with a typed error
78
+ rather than running with weaker permissions than requested.
64
79
 
65
80
  ## Session storage (Antigravity)
66
81