agent-runtime-kit 0.2.0__tar.gz → 0.4.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 (78) hide show
  1. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/.gitignore +9 -1
  2. agent_runtime_kit-0.4.0/CHANGELOG.md +244 -0
  3. agent_runtime_kit-0.4.0/PKG-INFO +189 -0
  4. agent_runtime_kit-0.4.0/README.md +157 -0
  5. agent_runtime_kit-0.4.0/docs/api-stability.md +64 -0
  6. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/docs/capability-matrix.md +26 -11
  7. agent_runtime_kit-0.4.0/docs/providers.md +171 -0
  8. agent_runtime_kit-0.4.0/docs/quickstart.md +122 -0
  9. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/docs/sdk-evolution-agent-design.md +30 -9
  10. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/docs/sdk-evolution-agent.md +32 -9
  11. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/run_same_task.py +6 -4
  12. agent_runtime_kit-0.4.0/examples/sdk_evolution_agent/__init__.py +24 -0
  13. agent_runtime_kit-0.4.0/examples/sdk_evolution_agent/auth.py +189 -0
  14. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/behavior.py +50 -5
  15. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/cli.py +174 -124
  16. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/models.py +3 -1
  17. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/release_notes.py +198 -12
  18. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/snapshots.py +31 -1
  19. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/stages.py +47 -9
  20. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/pyproject.toml +65 -9
  21. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/__init__.py +11 -0
  22. agent_runtime_kit-0.4.0/src/agent_runtime_kit/_errors.py +46 -0
  23. agent_runtime_kit-0.4.0/src/agent_runtime_kit/_kit.py +426 -0
  24. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/_runtime.py +9 -0
  25. agent_runtime_kit-0.4.0/src/agent_runtime_kit/_schema.py +272 -0
  26. agent_runtime_kit-0.4.0/src/agent_runtime_kit/_types.py +462 -0
  27. agent_runtime_kit-0.4.0/src/agent_runtime_kit/adapters/_common.py +334 -0
  28. agent_runtime_kit-0.4.0/src/agent_runtime_kit/adapters/antigravity.py +982 -0
  29. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/adapters/claude.py +304 -63
  30. agent_runtime_kit-0.4.0/src/agent_runtime_kit/adapters/codex.py +740 -0
  31. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/events.py +67 -23
  32. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/registry.py +6 -3
  33. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/testing/fakes.py +9 -0
  34. agent_runtime_kit-0.4.0/tests/test_adapter_protocol.py +102 -0
  35. agent_runtime_kit-0.4.0/tests/test_antigravity_adapter.py +1276 -0
  36. agent_runtime_kit-0.4.0/tests/test_claude_adapter.py +826 -0
  37. agent_runtime_kit-0.4.0/tests/test_codex_adapter.py +958 -0
  38. agent_runtime_kit-0.4.0/tests/test_core.py +219 -0
  39. agent_runtime_kit-0.4.0/tests/test_events.py +204 -0
  40. agent_runtime_kit-0.4.0/tests/test_kit.py +340 -0
  41. agent_runtime_kit-0.4.0/tests/test_schema.py +200 -0
  42. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/tests/test_sdk_evolution_agent.py +669 -16
  43. agent_runtime_kit-0.2.0/PKG-INFO +0 -120
  44. agent_runtime_kit-0.2.0/README.md +0 -88
  45. agent_runtime_kit-0.2.0/docs/providers.md +0 -73
  46. agent_runtime_kit-0.2.0/docs/publish-checklist.md +0 -77
  47. agent_runtime_kit-0.2.0/docs/quickstart.md +0 -34
  48. agent_runtime_kit-0.2.0/examples/sdk_evolution_agent/__init__.py +0 -14
  49. agent_runtime_kit-0.2.0/src/agent_runtime_kit/_errors.py +0 -34
  50. agent_runtime_kit-0.2.0/src/agent_runtime_kit/_types.py +0 -267
  51. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/_common.py +0 -181
  52. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/antigravity.py +0 -558
  53. agent_runtime_kit-0.2.0/src/agent_runtime_kit/adapters/codex.py +0 -485
  54. agent_runtime_kit-0.2.0/tests/test_antigravity_adapter.py +0 -458
  55. agent_runtime_kit-0.2.0/tests/test_claude_adapter.py +0 -342
  56. agent_runtime_kit-0.2.0/tests/test_codex_adapter.py +0 -393
  57. agent_runtime_kit-0.2.0/tests/test_core.py +0 -53
  58. agent_runtime_kit-0.2.0/tests/test_events.py +0 -99
  59. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/LICENSE +0 -0
  60. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/docs/live-smoke.md +0 -0
  61. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/docs/mestre-migration.md +0 -0
  62. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/__init__.py +0 -0
  63. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/__main__.py +0 -0
  64. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/collectors.py +0 -0
  65. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/current_state.py +0 -0
  66. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/events.py +0 -0
  67. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/pr.py +0 -0
  68. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/report.py +0 -0
  69. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/examples/sdk_evolution_agent/schemas.py +0 -0
  70. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/adapters/__init__.py +0 -0
  71. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/adapters/diagnostics.py +0 -0
  72. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/py.typed +0 -0
  73. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/src/agent_runtime_kit/testing/__init__.py +0 -0
  74. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/tests/test_live_smoke.py +0 -0
  75. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/tests/test_mestre_compatibility.py +0 -0
  76. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/tests/test_optional_dependencies.py +0 -0
  77. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.0}/tests/test_provider_diagnostics.py +0 -0
  78. {agent_runtime_kit-0.2.0 → agent_runtime_kit-0.4.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,244 @@
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.4.0 - 2026-07-02
9
+
10
+ ### Added
11
+
12
+ - `AgentKit`, a FastAPI-flavored hub over the registry: keyword-native
13
+ `await kit.run("claude", goal=..., permissions="strict", ...)` assembling
14
+ the frozen `AgentTask` internally (a prebuilt `task=` still passes through),
15
+ short aliases for the built-in kinds via the documented `KIND_ALIASES`
16
+ mapping, per-kind runtime caching closed by `aclose()`/`async with`,
17
+ `@kit.on(...)` sync/async event handlers that tee alongside a task's own
18
+ sink and can never break a run, and `@kit.runtime(...)` decorator
19
+ registration for third-party kinds.
20
+ - Typed structured output: `kit.run(..., output_type=SomeType)` derives the
21
+ wire schema from a dataclass/`TypedDict` (dependency-free, bounded subset,
22
+ fail-closed via the new `OutputTypeError`) or from a Pydantic-style model's
23
+ own `model_json_schema`, and validates `parsed_output` back into the type.
24
+ The result is `ParsedResult[T]` — a runtime-identical `AgentResult`
25
+ subclass with a typed `parsed` accessor; `AgentResult` itself stays
26
+ non-generic. Non-conforming payloads yield `finish_reason="failed"`, the
27
+ adapters' own structured-output convention.
28
+ - `PermissionProfile` accepts string literals for `mode`/`filesystem`
29
+ ("strict", "read-only", ...) and coerces them to real enum members at
30
+ construction; unknown values raise `ValueError` listing the vocabulary.
31
+ Previously a bare string silently matched none of the adapters' identity
32
+ checks and ran at the default posture.
33
+
34
+ ## 0.3.0 - 2026-07-02
35
+
36
+ ### Added
37
+
38
+ - Codex runtimes can now opt into reusable SDK process lifecycle with
39
+ `CodexAgentRuntime(reuse_process=True)`, `await runtime.aclose()`, or
40
+ `async with CodexAgentRuntime(..., reuse_process=True)`. Reuse keeps the Codex
41
+ app-server process alive across compatible tasks without implicitly reusing
42
+ Codex threads or sessions.
43
+ - Claude and Antigravity runtimes can now opt into adapter-owned SDK process
44
+ lifecycle with the same `reuse_process=True`, `aclose()`, and async context
45
+ manager shape. Claude reuses `ClaudeSDKClient` while preserving per-task
46
+ stream session IDs; Antigravity only reuses for explicit conversation IDs
47
+ because its SDK process is conversation-scoped.
48
+ - The SDK evolution agent now enables vendor process reuse for multi-stage
49
+ SDK-backed runs and closes internally owned runtimes when the run exits.
50
+ - `FinishReason` enum of the canonical `finish_reason` values, plus first-class
51
+ `AgentTask.model` and `AgentTask.reasoning_effort` fields (keyword-only, so
52
+ the positional layout that predates them is unchanged; the
53
+ `metadata["model"]`/`metadata["reasoning_effort"]` aliases keep working).
54
+ `model` is honored by all three adapters. `reasoning_effort` maps to the
55
+ Claude and Codex `effort` options; Antigravity has no reasoning-effort
56
+ control and rejects the field with a typed error instead of silently
57
+ ignoring it.
58
+ - Third-party runtime kinds: `AgentRuntimeKind.coerce` and the registry accept
59
+ namespaced strings (e.g. `"x-myorg-agent"`), and `runtime_kind_value()`
60
+ returns the wire form of either shape.
61
+ - Tool observability parity: the Codex adapter emits `agent.tool.requested` /
62
+ `agent.tool.completed` events, Claude tool audits carry `result_preview`, and
63
+ Antigravity audits are recorded per call rather than collapsed by tool name.
64
+ - Claude reports the effective vendor permission mode in
65
+ `AgentResult.metadata["permission_mode"]`, and the Codex/Antigravity adapters
66
+ record SDK kwargs dropped for compatibility in
67
+ `AgentResult.metadata["dropped_options"]`.
68
+ - `docs/api-stability.md` documents the public surface, the 0.x compatibility
69
+ policy, and the vendor SDK pinning policy.
70
+
71
+ ### Changed
72
+
73
+ - BREAKING: the `AgentRuntime` protocol now requires `aclose()` and async
74
+ context-manager support, and `kind` is typed `AgentRuntimeKind | str` so
75
+ third-party runtimes can conform without forking the enum.
76
+ - BREAKING: mapping fields on `AgentTask`, `AgentResult`, and related models are
77
+ copied at construction and read-only at the top level afterwards (in-place
78
+ mutation of the mapping itself raises `TypeError`; the freeze is shallow, so
79
+ nested containers are not copied or frozen); `dataclasses.asdict`,
80
+ `copy.deepcopy`, `pickle`, and JSON serialization keep working.
81
+ - Claude: `CAUTIOUS` now maps to the vendor `default` permission mode instead of
82
+ `acceptEdits` (it was looser than `DEFAULT`), and a `READ_ONLY` filesystem
83
+ forces `plan` mode.
84
+ - Claude: an unsatisfied `output_schema` or an empty completion now returns
85
+ `finish_reason="failed"` instead of silent success.
86
+ - Codex: `Usage` reports the executed turn rather than cumulative
87
+ across-the-thread totals when resuming sessions.
88
+ - All adapters: `AgentResult.session_id` falls back to the task-supplied session
89
+ handle when the SDK response omits one.
90
+ - Antigravity: explicit `vertex=True` takes precedence over ambient API keys,
91
+ combining a `READ_ONLY` filesystem or `STRICT` mode with non-read-only
92
+ `allowed_tools` is rejected instead of silently granted, and vendor stop
93
+ reasons map to `max_tokens`/`failed` finish reasons.
94
+ - BREAKING: Antigravity deny-lists are now subtractive in every mode.
95
+ `disabled_tools` means "enable everything else", which re-enabled write and
96
+ destructive tools past the mode's baseline; now only `PERMISSIVE` (whose
97
+ baseline is every tool) still takes that route, while `READ_ONLY`/`STRICT`
98
+ get the read-only toolset minus the denied tools and `DEFAULT`/`CAUTIOUS`
99
+ the nondestructive toolset minus the denied tools.
100
+ - Vendor SDK dependencies now carry pre-1.0 upper bounds (`claude-agent-sdk<0.3`,
101
+ `openai-codex<0.2`, `google-antigravity<0.2`) so a breaking upstream minor
102
+ cannot reach fresh installs before adapters are revalidated.
103
+ - BREAKING: permission-critical SDK options fail closed under vendor drift. If
104
+ the installed SDK cannot accept Claude's `permission_mode` (or a requested
105
+ tool allow/deny list), Codex's `sandbox`/`approval_mode`, or Antigravity's
106
+ `capabilities`/`policies`/workspace scoping, `run()` raises
107
+ `UnsupportedTaskInputError` instead of silently running under the SDK's
108
+ default (more permissive) posture. A requested `budget_usd` fails closed the
109
+ same way if the installed Claude SDK stops accepting `max_budget_usd`, so a
110
+ spend cap can never silently vanish. Non-security drift is still tolerated
111
+ and recorded in `AgentResult.metadata["dropped_options"]`.
112
+
113
+ - Installation docs now lead with `agent-runtime-kit[all]` for the easiest
114
+ full-provider setup and explain provider extras as dependency isolation, not a
115
+ separate API.
116
+ - README and package metadata now include clearer About copy and searchable
117
+ tags for agent runtime, coding-agent, Claude Code, Codex, Antigravity, MCP,
118
+ typed Python, and async Python use cases.
119
+ - The source distribution now allowlists individual public docs instead of the
120
+ whole `docs/` directory.
121
+
122
+ ### Removed
123
+
124
+ - Removed the stale internal publish checklist from public documentation.
125
+ - BREAKING: removed the dead `AgentCapabilities.sdk_turn_limit` field (no
126
+ adapter ever read it).
127
+
128
+ ### Fixed
129
+
130
+ - Reused vendor SDK clients are evicted when a run is interrupted or cancelled
131
+ mid-flight, and `aclose()` no longer races an in-flight run on the same
132
+ runtime instance.
133
+ - Codex: a turn ending in the SDK's non-terminal `inProgress` status — or any
134
+ future unknown status — now fails closed as `finish_reason="failed"` instead
135
+ of reading as success with partial output.
136
+ - Codex: `Usage.input_tokens` now excludes cached input tokens, which are
137
+ reported separately in `cache_read_tokens` (matching the documented `Usage`
138
+ contract and the Antigravity adapter) instead of being double-counted across
139
+ both fields.
140
+ - Event redaction now covers camelCase secret keys (e.g. `accessToken`) and
141
+ separator-less ones (e.g. `accesstoken`, `SESSIONTOKEN`) while keeping plural
142
+ usage counters (`inputTokens`, `totaltokens`) visible, and the event
143
+ sanitizer bounds recursion depth and detects reference cycles so pathological
144
+ metadata cannot abort a run.
145
+ - SDK evolution example: inspecting candidate SDK versions (which pip-installs
146
+ and imports freshly downloaded upstream code) is now opt-in via
147
+ `--inspect-candidates` and runs in a credential-scrubbed environment — and
148
+ the behavior probes now honor the same gate and scrub instead of installing
149
+ candidates unconditionally with the caller's full environment (skipped
150
+ candidates are recorded explicitly). `--draft-pr` no longer fails when the
151
+ report directory is gitignored.
152
+ - SDK evolution example: release-note links extracted from fetched pages are
153
+ only followed when they resolve to `https://github.com` (a protocol-relative
154
+ href in user-generated discussion markup could otherwise trigger an off-site
155
+ request), and a configured-but-failing GitHub GraphQL token now surfaces on
156
+ the source instead of silently downgrading to the unauthenticated scrape.
157
+
158
+ ## 0.2.0 - 2026-06-23
159
+
160
+ ### Added
161
+
162
+ - Added the local SDK evolution agent example, including runtime-backed
163
+ direction analysis, architecture decision, reviewer stages, report generation,
164
+ and optional draft PR creation.
165
+ - Added release-note collection, candidate API snapshots/diffs, behavior probes,
166
+ current-state promotion manifests, and deterministic implementation gates for
167
+ SDK update runs.
168
+ - Added documentation for running the SDK evolution agent locally with supported
169
+ vendor credentials and reviewing generated evidence.
170
+
171
+ ### Changed
172
+
173
+ - Updated the lockfile to the resolver-selected current Claude and Antigravity
174
+ SDK versions after the evolution agent validated adapter-contract behavior:
175
+ `claude-agent-sdk` 0.2.106 and `google-antigravity` 0.1.4.
176
+ - SDK evolution current-state manifests now record repo-relative checked-in
177
+ artifact paths rather than machine-local absolute paths.
178
+
179
+ ## 0.1.1 - 2026-06-11
180
+
181
+ ### Fixed
182
+
183
+ - **Codex approval-mode mapping was inverted** and is now corrected. `STRICT` and
184
+ `CAUTIOUS` map to `deny_all` (never escalate beyond the sandbox); `DEFAULT` and
185
+ `PERMISSIVE` map to `auto_review` (escalations are auto-adjudicated). Previously a
186
+ `STRICT` caller could have escalations auto-approved and a `PERMISSIVE` caller had
187
+ them hard-denied — exactly backwards.
188
+ - Antigravity MCP stdio server configuration no longer crashes: the required `name`
189
+ field is now passed to the SDK model.
190
+ - The `mypy` strict gate now passes identically in core-only and all-extras
191
+ environments (per-module import overrides replace inline ignores).
192
+ - Claude reports `finish_reason="max_turns"` when a turn is truncated by the
193
+ max-turns limit instead of a generic failure.
194
+ - Codex honors `TurnResult.status`: a `failed` or `interrupted` turn maps to the
195
+ matching `finish_reason` and surfaces the structured error message instead of being
196
+ reported as success.
197
+
198
+ ### Changed
199
+
200
+ - **Antigravity DEFAULT permission posture is now safer.** With no `allowed_tools`,
201
+ `DEFAULT` (and `CAUTIOUS`) now use the nondestructive toolset (no `run_command`)
202
+ instead of granting all tools plus an allow-all policy. `STRICT` (or any read-only
203
+ filesystem) uses the read-only toolset with no `allow_all` policy; `PERMISSIVE`
204
+ keeps all tools.
205
+ - **Unsupported task fields now raise `UnsupportedTaskInputError` instead of being
206
+ silently ignored.** Codex rejects `allowed_tools`, `disallowed_tools`, `budget_usd`,
207
+ and `permissions.network` (MCP was already rejected); Antigravity rejects
208
+ `budget_usd` and `permissions.network`, and rejects combining an allow-list with a
209
+ deny-list (the SDK requires them to be mutually exclusive); Claude rejects
210
+ `permissions.network`. Only Claude maps `budget_usd`.
211
+ - Missing-SDK and missing-credential paths now raise the typed
212
+ `AgentRuntimeUnavailableError` instead of a bare `RuntimeError`.
213
+ - Antigravity session and app-data storage moved from a world-shared
214
+ `/tmp/agent-runtime-kit` path to `$XDG_CACHE_HOME/agent-runtime-kit` (default
215
+ `~/.cache/agent-runtime-kit`, created `0o700`), overridable via
216
+ `AntigravityAgentRuntime(data_dir=...)`. Sessions now survive reboots and are not
217
+ exposed to other users on multi-user machines.
218
+ - Antigravity maps `disallowed_tools` to `CapabilitiesConfig.disabled_tools` and
219
+ validates tool names against the `BuiltinTools` enum, raising a typed error for an
220
+ unknown name instead of leaking a raw validation error.
221
+ - Build now requires `hatchling>=1.26` (for the PEP 639 `license = "MIT"` string),
222
+ and the deprecated `License :: OSI Approved :: MIT License` classifier was removed.
223
+
224
+ ### Added
225
+
226
+ - Claude streaming is now real: incremental output deltas and
227
+ `tool_requested`/`tool_completed` events are emitted while the SDK runs.
228
+ - Codex tool audits are now produced, parsed from `TurnResult.items` (command
229
+ executions, MCP tool calls, dynamic tool calls, and web searches).
230
+ - Claude records vendor-option kwargs it had to drop due to SDK drift in
231
+ `AgentResult.metadata["dropped_options"]`, keeping silent omissions observable.
232
+ - A continuous-integration workflow runs `ruff`, `mypy`, and `pytest` across
233
+ Python 3.10–3.13 in both the core-only and all-extras dependency lanes, and the
234
+ PyPI publish workflow now gates on a test job before building.
235
+ - `tests/test_sdk_contract.py` introspects the real vendor SDK surfaces and
236
+ auto-skips when the SDKs are not installed.
237
+ - An sdist allowlist ensures only `src`, `tests`, `docs`, `examples`, `README.md`,
238
+ `LICENSE`, and `pyproject.toml` are packaged for PyPI (internal planning
239
+ artifacts, `uv.lock`, and caches are no longer shipped).
240
+
241
+ ## 0.1.0
242
+
243
+ - Initial release: one typed async runtime API for the Claude, Codex, and
244
+ Antigravity agent SDKs, with capability diagnostics, event sinks, and adapters.
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-runtime-kit
3
+ Version: 0.4.0
4
+ Summary: One typed runtime API for Claude, Codex, and Antigravity agent SDKs.
5
+ Project-URL: Homepage, https://github.com/ebarti/agent-runtime-kit
6
+ Project-URL: Repository, https://github.com/ebarti/agent-runtime-kit
7
+ Project-URL: Issues, https://github.com/ebarti/agent-runtime-kit/issues
8
+ Author: Eloi Barti
9
+ License-Expression: MIT
10
+ License-File: LICENSE
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
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.10
21
+ Provides-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
+ Provides-Extra: antigravity
26
+ Requires-Dist: google-antigravity<0.2,>=0.1.2; extra == 'antigravity'
27
+ Provides-Extra: claude
28
+ Requires-Dist: claude-agent-sdk<0.3,>=0.2.87; extra == 'claude'
29
+ Provides-Extra: codex
30
+ Requires-Dist: openai-codex<0.2,>=0.1.0b3; extra == 'codex'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # agent-runtime-kit
34
+
35
+ `agent-runtime-kit` is a small Python runtime layer for agent SDKs. It gives
36
+ applications one typed async API for dispatching an agentic task through Claude
37
+ Agent SDK, OpenAI Codex SDK, or Google Antigravity SDK while keeping provider
38
+ capabilities visible.
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
+
56
+ The package is intentionally not a router, benchmark harness, queue, hosted
57
+ service, or full agent framework. It is the reusable layer underneath those
58
+ systems: task models, runtime capabilities, event sinks, availability
59
+ diagnostics, and adapters.
60
+
61
+ ## Install
62
+
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:
71
+
72
+ ```bash
73
+ pip install agent-runtime-kit
74
+ ```
75
+
76
+ Install a single provider extra when your application only dispatches through
77
+ one vendor runtime:
78
+
79
+ ```bash
80
+ pip install "agent-runtime-kit[claude]"
81
+ pip install "agent-runtime-kit[codex]"
82
+ pip install "agent-runtime-kit[antigravity]"
83
+ ```
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
+
91
+ ```python
92
+ import asyncio
93
+
94
+ from agent_runtime_kit import AgentTask, FakeAgentRuntime
95
+
96
+
97
+ async def main() -> None:
98
+ runtime = FakeAgentRuntime(output="done")
99
+ result = await runtime.run(AgentTask(goal="Summarize this repository"))
100
+ print(result.output)
101
+
102
+
103
+ asyncio.run(main())
104
+ ```
105
+
106
+ The core package has no Claude, Codex, or Antigravity dependency. Vendor SDKs
107
+ are added through optional extras.
108
+
109
+ ## Real Providers
110
+
111
+ `AgentKit` is the keyword-native hub: it registers the built-in runtimes,
112
+ caches them per kind, and turns Python types into structured output.
113
+
114
+ ```python
115
+ import asyncio
116
+ from dataclasses import dataclass
117
+
118
+ from agent_runtime_kit import AgentKit
119
+
120
+
121
+ @dataclass
122
+ class RepoSummary:
123
+ name: str
124
+ languages: list[str]
125
+
126
+
127
+ async def main() -> None:
128
+ async with AgentKit() as kit:
129
+ diagnostic = kit.availability_for("claude")
130
+ if not diagnostic.available:
131
+ raise RuntimeError(diagnostic.message)
132
+ result = await kit.run(
133
+ "claude",
134
+ goal="Summarize this repository",
135
+ permissions="strict",
136
+ output_type=RepoSummary,
137
+ )
138
+ print(result.parsed.languages if result.parsed else result.error)
139
+
140
+
141
+ asyncio.run(main())
142
+ ```
143
+
144
+ Adapters also work standalone when you need vendor-specific configuration:
145
+
146
+ ```python
147
+ import asyncio
148
+
149
+ from agent_runtime_kit import AgentTask
150
+ from agent_runtime_kit.adapters import ClaudeAgentRuntime
151
+
152
+
153
+ async def main() -> None:
154
+ runtime = ClaudeAgentRuntime(default_model="claude-sonnet-4-6")
155
+ diagnostic = runtime.availability()
156
+ if not diagnostic.available:
157
+ raise RuntimeError(diagnostic.message)
158
+ result = await runtime.run(AgentTask(goal="Summarize this repository"))
159
+ print(result.output)
160
+
161
+
162
+ asyncio.run(main())
163
+ ```
164
+
165
+ ## Runtime Fields
166
+
167
+ `AgentTask` supports goal, system prompt, model, reasoning effort, working
168
+ directory, permission profile, MCP stdio servers, session/resume handles, output
169
+ schema, budget, metadata, and an async event sink. (`model` and
170
+ `reasoning_effort` are first-class fields; the legacy `metadata["model"]` /
171
+ `metadata["reasoning_effort"]` aliases still work.) Where a runtime cannot honor
172
+ a field (for example only Claude maps `budget_usd`; Codex and Antigravity reject
173
+ it with a typed `UnsupportedTaskInputError`) the adapter raises rather than
174
+ silently dropping it.
175
+
176
+ `AgentResult` returns output, finish reason (see `FinishReason`), parsed
177
+ structured output, usage, cost, session id, tool-call audits, and provider
178
+ metadata. `artifacts` is a reserved field: no built-in runtime populates it yet,
179
+ so it is always an empty tuple today.
180
+
181
+ ## Docs
182
+
183
+ - [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
184
+ - [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
185
+ - [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
186
+ - [API stability](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/api-stability.md)
187
+ - [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
188
+ - [Mestre migration notes](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/mestre-migration.md)
189
+ - [SDK evolution agent](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/sdk-evolution-agent.md)
@@ -0,0 +1,157 @@
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
+ `AgentKit` is the keyword-native hub: it registers the built-in runtimes,
80
+ caches them per kind, and turns Python types into structured output.
81
+
82
+ ```python
83
+ import asyncio
84
+ from dataclasses import dataclass
85
+
86
+ from agent_runtime_kit import AgentKit
87
+
88
+
89
+ @dataclass
90
+ class RepoSummary:
91
+ name: str
92
+ languages: list[str]
93
+
94
+
95
+ async def main() -> None:
96
+ async with AgentKit() as kit:
97
+ diagnostic = kit.availability_for("claude")
98
+ if not diagnostic.available:
99
+ raise RuntimeError(diagnostic.message)
100
+ result = await kit.run(
101
+ "claude",
102
+ goal="Summarize this repository",
103
+ permissions="strict",
104
+ output_type=RepoSummary,
105
+ )
106
+ print(result.parsed.languages if result.parsed else result.error)
107
+
108
+
109
+ asyncio.run(main())
110
+ ```
111
+
112
+ Adapters also work standalone when you need vendor-specific configuration:
113
+
114
+ ```python
115
+ import asyncio
116
+
117
+ from agent_runtime_kit import AgentTask
118
+ from agent_runtime_kit.adapters import ClaudeAgentRuntime
119
+
120
+
121
+ async def main() -> None:
122
+ runtime = ClaudeAgentRuntime(default_model="claude-sonnet-4-6")
123
+ diagnostic = runtime.availability()
124
+ if not diagnostic.available:
125
+ raise RuntimeError(diagnostic.message)
126
+ result = await runtime.run(AgentTask(goal="Summarize this repository"))
127
+ print(result.output)
128
+
129
+
130
+ asyncio.run(main())
131
+ ```
132
+
133
+ ## Runtime Fields
134
+
135
+ `AgentTask` supports goal, system prompt, model, reasoning effort, working
136
+ directory, permission profile, MCP stdio servers, session/resume handles, output
137
+ schema, budget, metadata, and an async event sink. (`model` and
138
+ `reasoning_effort` are first-class fields; the legacy `metadata["model"]` /
139
+ `metadata["reasoning_effort"]` aliases still work.) Where a runtime cannot honor
140
+ a field (for example only Claude maps `budget_usd`; Codex and Antigravity reject
141
+ it with a typed `UnsupportedTaskInputError`) the adapter raises rather than
142
+ silently dropping it.
143
+
144
+ `AgentResult` returns output, finish reason (see `FinishReason`), parsed
145
+ structured output, usage, cost, session id, tool-call audits, and provider
146
+ metadata. `artifacts` is a reserved field: no built-in runtime populates it yet,
147
+ so it is always an empty tuple today.
148
+
149
+ ## Docs
150
+
151
+ - [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
152
+ - [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
153
+ - [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
154
+ - [API stability](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/api-stability.md)
155
+ - [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
156
+ - [Mestre migration notes](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/mestre-migration.md)
157
+ - [SDK evolution agent](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/sdk-evolution-agent.md)
@@ -0,0 +1,64 @@
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
+ - **`AgentKit` is sugar, not a second API.** The hub assembles the same frozen
41
+ `AgentTask` and returns the same `AgentResult` the runtimes produce
42
+ (`ParsedResult` is a runtime-identical subclass adding only the typed
43
+ `parsed` accessor). Kind aliases are limited to the documented
44
+ `KIND_ALIASES` mapping; exact kind strings always work. `output_type=`
45
+ supports a bounded, documented subset of the typing system and raises
46
+ `OutputTypeError` on anything outside it (Pydantic-style models are used
47
+ through their own `model_json_schema`/`model_validate` when present).
48
+
49
+ ## Vendor SDK version policy
50
+
51
+ The vendor SDK extras are pinned with cautious upper bounds (e.g.
52
+ `claude-agent-sdk>=0.2.87,<0.3`) because those SDKs are themselves pre-1.0 and
53
+ have shipped breaking changes within a minor series. The bounds are raised
54
+ deliberately — after the contract tests and the SDK-evolution agent verify a new
55
+ version — rather than left unbounded. A weekly CI lane installs the latest vendor
56
+ SDKs *within the declared caps*, so drift inside an allowed range surfaces before
57
+ it reaches installed users; a release above a cap is by design invisible to that
58
+ lane until the cap is raised. A separate lane installs every direct dependency at
59
+ its declared floor so a stale minimum cannot sit undetected in the metadata.
60
+
61
+ ## Deprecation
62
+
63
+ When a public name is slated for removal it will be kept working for at least one
64
+ minor release with a `DeprecationWarning` before it is dropped.