agent-runtime-kit 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/PKG-INFO +12 -11
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/README.md +9 -7
- agent_runtime_kit-0.1.1/docs/capability-matrix.md +72 -0
- agent_runtime_kit-0.1.1/docs/providers.md +55 -0
- agent_runtime_kit-0.1.1/docs/publish-checklist.md +77 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/pyproject.toml +24 -5
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/_types.py +18 -2
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/_common.py +63 -5
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/antigravity.py +135 -36
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/claude.py +174 -39
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/codex.py +144 -12
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/events.py +15 -2
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/registry.py +10 -2
- agent_runtime_kit-0.1.1/tests/test_antigravity_adapter.py +369 -0
- agent_runtime_kit-0.1.1/tests/test_claude_adapter.py +306 -0
- agent_runtime_kit-0.1.1/tests/test_codex_adapter.py +351 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_events.py +17 -3
- agent_runtime_kit-0.1.1/tests/test_sdk_contract.py +168 -0
- agent_runtime_kit-0.1.0/.planning/PROJECT.md +0 -140
- agent_runtime_kit-0.1.0/.planning/REQUIREMENTS.md +0 -196
- agent_runtime_kit-0.1.0/.planning/ROADMAP.md +0 -124
- agent_runtime_kit-0.1.0/.planning/STATE.md +0 -100
- agent_runtime_kit-0.1.0/.planning/config.json +0 -68
- agent_runtime_kit-0.1.0/.planning/phases/01-core-runtime-skeleton/01-CONTEXT.md +0 -71
- agent_runtime_kit-0.1.0/.planning/phases/01-core-runtime-skeleton/01-PLAN.md +0 -19
- agent_runtime_kit-0.1.0/.planning/phases/01-core-runtime-skeleton/01-SUMMARY.md +0 -12
- agent_runtime_kit-0.1.0/.planning/phases/01-core-runtime-skeleton/01-VERIFICATION.md +0 -17
- agent_runtime_kit-0.1.0/.planning/phases/02-events-and-test-harness/02-CONTEXT.md +0 -64
- agent_runtime_kit-0.1.0/.planning/phases/02-events-and-test-harness/02-PLAN.md +0 -20
- agent_runtime_kit-0.1.0/.planning/phases/02-events-and-test-harness/02-SUMMARY.md +0 -11
- agent_runtime_kit-0.1.0/.planning/phases/02-events-and-test-harness/02-VERIFICATION.md +0 -18
- agent_runtime_kit-0.1.0/.planning/phases/03-claude-and-codex-runtimes/03-CONTEXT.md +0 -65
- agent_runtime_kit-0.1.0/.planning/phases/03-claude-and-codex-runtimes/03-PLAN.md +0 -21
- agent_runtime_kit-0.1.0/.planning/phases/03-claude-and-codex-runtimes/03-SUMMARY.md +0 -12
- agent_runtime_kit-0.1.0/.planning/phases/03-claude-and-codex-runtimes/03-VERIFICATION.md +0 -18
- agent_runtime_kit-0.1.0/.planning/phases/04-antigravity-and-cross-runtime-proof/04-CONTEXT.md +0 -62
- agent_runtime_kit-0.1.0/.planning/phases/04-antigravity-and-cross-runtime-proof/04-PLAN.md +0 -21
- agent_runtime_kit-0.1.0/.planning/phases/04-antigravity-and-cross-runtime-proof/04-SUMMARY.md +0 -10
- agent_runtime_kit-0.1.0/.planning/phases/04-antigravity-and-cross-runtime-proof/04-VERIFICATION.md +0 -18
- agent_runtime_kit-0.1.0/.planning/phases/05-public-release-readiness/05-CONTEXT.md +0 -61
- agent_runtime_kit-0.1.0/.planning/phases/05-public-release-readiness/05-PLAN.md +0 -19
- agent_runtime_kit-0.1.0/.planning/phases/05-public-release-readiness/05-SUMMARY.md +0 -10
- agent_runtime_kit-0.1.0/.planning/phases/05-public-release-readiness/05-VERIFICATION.md +0 -19
- agent_runtime_kit-0.1.0/.planning/research/ARCHITECTURE.md +0 -273
- agent_runtime_kit-0.1.0/.planning/research/FEATURES.md +0 -147
- agent_runtime_kit-0.1.0/.planning/research/PITFALLS.md +0 -233
- agent_runtime_kit-0.1.0/.planning/research/STACK.md +0 -115
- agent_runtime_kit-0.1.0/.planning/research/SUMMARY.md +0 -191
- agent_runtime_kit-0.1.0/.python-version +0 -1
- agent_runtime_kit-0.1.0/AGENTS.md +0 -190
- agent_runtime_kit-0.1.0/docs/capability-matrix.md +0 -19
- agent_runtime_kit-0.1.0/docs/providers.md +0 -26
- agent_runtime_kit-0.1.0/docs/publish-checklist.md +0 -48
- agent_runtime_kit-0.1.0/tests/test_antigravity_adapter.py +0 -182
- agent_runtime_kit-0.1.0/tests/test_claude_adapter.py +0 -81
- agent_runtime_kit-0.1.0/tests/test_codex_adapter.py +0 -125
- agent_runtime_kit-0.1.0/uv.lock +0 -1722
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/.gitignore +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/LICENSE +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/docs/live-smoke.md +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/docs/mestre-migration.md +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/docs/quickstart.md +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/examples/run_same_task.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/__init__.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/_errors.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/_runtime.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/__init__.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/diagnostics.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/py.typed +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/testing/__init__.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/testing/fakes.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_core.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_live_smoke.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_mestre_compatibility.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_optional_dependencies.py +0 -0
- {agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/tests/test_provider_diagnostics.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-runtime-kit
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
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
|
|
@@ -11,7 +11,6 @@ License-File: LICENSE
|
|
|
11
11
|
Keywords: agents,antigravity,claude,codex,sdk
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -22,13 +21,13 @@ Requires-Python: >=3.10
|
|
|
22
21
|
Provides-Extra: all
|
|
23
22
|
Requires-Dist: claude-agent-sdk>=0.2.87; extra == 'all'
|
|
24
23
|
Requires-Dist: google-antigravity>=0.1.2; extra == 'all'
|
|
25
|
-
Requires-Dist: openai-codex>=0.1.
|
|
24
|
+
Requires-Dist: openai-codex>=0.1.0b3; extra == 'all'
|
|
26
25
|
Provides-Extra: antigravity
|
|
27
26
|
Requires-Dist: google-antigravity>=0.1.2; extra == 'antigravity'
|
|
28
27
|
Provides-Extra: claude
|
|
29
28
|
Requires-Dist: claude-agent-sdk>=0.2.87; extra == 'claude'
|
|
30
29
|
Provides-Extra: codex
|
|
31
|
-
Requires-Dist: openai-codex>=0.1.
|
|
30
|
+
Requires-Dist: openai-codex>=0.1.0b3; extra == 'codex'
|
|
32
31
|
Description-Content-Type: text/markdown
|
|
33
32
|
|
|
34
33
|
# agent-runtime-kit
|
|
@@ -103,16 +102,18 @@ asyncio.run(main())
|
|
|
103
102
|
|
|
104
103
|
`AgentTask` supports goal, system prompt, working directory, permission profile,
|
|
105
104
|
MCP stdio servers, session/resume handles, output schema, budget, metadata, and
|
|
106
|
-
an async event sink.
|
|
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.
|
|
107
108
|
|
|
108
109
|
`AgentResult` returns output, finish reason, parsed structured output, usage,
|
|
109
110
|
cost, session id, artifacts, tool-call audits, and provider metadata.
|
|
110
111
|
|
|
111
112
|
## Docs
|
|
112
113
|
|
|
113
|
-
- [Quickstart](docs/quickstart.md)
|
|
114
|
-
- [Provider diagnostics](docs/providers.md)
|
|
115
|
-
- [Capability matrix](docs/capability-matrix.md)
|
|
116
|
-
- [Live smoke tests](docs/live-smoke.md)
|
|
117
|
-
- [Mestre migration notes](docs/mestre-migration.md)
|
|
118
|
-
- [Publish checklist](docs/publish-checklist.md)
|
|
114
|
+
- [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
|
|
115
|
+
- [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
|
|
116
|
+
- [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
|
|
117
|
+
- [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
|
|
118
|
+
- [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)
|
|
@@ -70,16 +70,18 @@ asyncio.run(main())
|
|
|
70
70
|
|
|
71
71
|
`AgentTask` supports goal, system prompt, working directory, permission profile,
|
|
72
72
|
MCP stdio servers, session/resume handles, output schema, budget, metadata, and
|
|
73
|
-
an async event sink.
|
|
73
|
+
an async event sink. Where a runtime cannot honor a field (for example only
|
|
74
|
+
Claude maps `budget_usd`; Codex and Antigravity reject it with a typed
|
|
75
|
+
`UnsupportedTaskInputError`) the adapter raises rather than silently dropping it.
|
|
74
76
|
|
|
75
77
|
`AgentResult` returns output, finish reason, parsed structured output, usage,
|
|
76
78
|
cost, session id, artifacts, tool-call audits, and provider metadata.
|
|
77
79
|
|
|
78
80
|
## Docs
|
|
79
81
|
|
|
80
|
-
- [Quickstart](docs/quickstart.md)
|
|
81
|
-
- [Provider diagnostics](docs/providers.md)
|
|
82
|
-
- [Capability matrix](docs/capability-matrix.md)
|
|
83
|
-
- [Live smoke tests](docs/live-smoke.md)
|
|
84
|
-
- [Mestre migration notes](docs/mestre-migration.md)
|
|
85
|
-
- [Publish checklist](docs/publish-checklist.md)
|
|
82
|
+
- [Quickstart](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/quickstart.md)
|
|
83
|
+
- [Provider diagnostics](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/providers.md)
|
|
84
|
+
- [Capability matrix](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/capability-matrix.md)
|
|
85
|
+
- [Live smoke tests](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/live-smoke.md)
|
|
86
|
+
- [Mestre migration notes](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/mestre-migration.md)
|
|
87
|
+
- [Publish checklist](https://github.com/ebarti/agent-runtime-kit/blob/main/docs/publish-checklist.md)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Capability Matrix
|
|
2
|
+
|
|
3
|
+
| Capability | Claude Agent SDK | OpenAI Codex SDK | Google Antigravity SDK |
|
|
4
|
+
|------------|------------------|------------------|------------------------|
|
|
5
|
+
| Optional extra | `claude` | `codex` | `antigravity` |
|
|
6
|
+
| Core import without extra | Yes | Yes | Yes |
|
|
7
|
+
| Working directory | Yes | Yes | Yes |
|
|
8
|
+
| Session resume | Yes | Yes | Yes |
|
|
9
|
+
| Structured output | Native `output_format` when available | Native output schema / JSON parse fallback | Native response schema / JSON parse fallback |
|
|
10
|
+
| MCP stdio servers | Yes | No per-task MCP config | Yes, without per-server env |
|
|
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 |
|
|
14
|
+
| Missing package diagnostics | Yes (`AgentRuntimeUnavailableError`) | Yes (`AgentRuntimeUnavailableError`) | Yes (`AgentRuntimeUnavailableError`) |
|
|
15
|
+
| Missing credential diagnostics | Provider-owned/local auth | Provider-owned/local auth | `GEMINI_API_KEY` or `GOOGLE_API_KEY` |
|
|
16
|
+
| Live smoke test | Opt-in | Opt-in | Opt-in |
|
|
17
|
+
|
|
18
|
+
The matrix is intentionally not a lowest-common-denominator contract. Adapters
|
|
19
|
+
reject unsupported inputs (see below) when silently dropping them would be
|
|
20
|
+
misleading.
|
|
21
|
+
|
|
22
|
+
## Permission mapping
|
|
23
|
+
|
|
24
|
+
A single portable `PermissionMode` maps to each vendor's native controls. The
|
|
25
|
+
same profile yields different but intentionally aligned postures per runtime;
|
|
26
|
+
review this table before assuming a mode is equivalent everywhere.
|
|
27
|
+
|
|
28
|
+
| `PermissionMode` | Claude `permission_mode` | Codex `approval_mode` + sandbox | Antigravity toolset + policy |
|
|
29
|
+
|------------------|--------------------------|---------------------------------|------------------------------|
|
|
30
|
+
| `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
|
+
| `DEFAULT` | `default` | `auto_review` (escalations auto-adjudicated) | nondestructive toolset (no `run_command`), `allow_all` policy |
|
|
33
|
+
| `PERMISSIVE` | `bypassPermissions` | `auto_review` (escalations auto-adjudicated) | all tools, `allow_all` policy |
|
|
34
|
+
|
|
35
|
+
Codex sandbox is derived from `FilesystemAccess`, independent of the approval
|
|
36
|
+
mode: `READ_ONLY` → `read_only`, `WORKSPACE_WRITE` → `workspace_write`,
|
|
37
|
+
`FULL_ACCESS` → `full_access`.
|
|
38
|
+
|
|
39
|
+
Antigravity toolset notes: the table above describes the default posture when
|
|
40
|
+
`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`.
|
|
44
|
+
|
|
45
|
+
## Rejected inputs
|
|
46
|
+
|
|
47
|
+
Each adapter raises `UnsupportedTaskInputError` for task fields it has no SDK
|
|
48
|
+
surface to honor, rather than dropping them silently.
|
|
49
|
+
|
|
50
|
+
| Field | Claude | Codex | Antigravity |
|
|
51
|
+
|-------|--------|-------|-------------|
|
|
52
|
+
| `budget_usd` | Mapped (`max_budget_usd`) | Rejected | Rejected |
|
|
53
|
+
| `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 |
|
|
55
|
+
| `mcp_servers` | Mapped | Rejected (no per-task MCP) | Mapped, without per-server `env` |
|
|
56
|
+
|
|
57
|
+
Two task fields are informational only and not enforced by any built-in adapter:
|
|
58
|
+
`AgentTask.sdk_executions` (carried into events as a hint) and
|
|
59
|
+
`SessionResumeState.transcript` (adapters resume by `session_id`).
|
|
60
|
+
|
|
61
|
+
Claude additionally records any vendor-option kwargs it had to drop due to SDK
|
|
62
|
+
drift in `AgentResult.metadata["dropped_options"]`, so silent omission stays
|
|
63
|
+
observable.
|
|
64
|
+
|
|
65
|
+
## Session storage (Antigravity)
|
|
66
|
+
|
|
67
|
+
Antigravity session and app-data directories are written under
|
|
68
|
+
`$XDG_CACHE_HOME/agent-runtime-kit` (default `~/.cache/agent-runtime-kit`),
|
|
69
|
+
created with `0o700` permissions. This replaces the previous world-shared
|
|
70
|
+
`/tmp` location so transcripts survive reboots and are not exposed to other
|
|
71
|
+
users. Override the base directory with
|
|
72
|
+
`AntigravityAgentRuntime(data_dir=...)`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Provider Diagnostics
|
|
2
|
+
|
|
3
|
+
`agent-runtime-kit` keeps provider setup checks explicit. Each runtime exposes
|
|
4
|
+
`availability()` and returns a `RuntimeAvailability` value with:
|
|
5
|
+
|
|
6
|
+
- runtime kind
|
|
7
|
+
- availability flag
|
|
8
|
+
- reason
|
|
9
|
+
- message
|
|
10
|
+
- package name
|
|
11
|
+
- installed version when discoverable
|
|
12
|
+
|
|
13
|
+
Claude uses the `claude-agent-sdk` package and maps working directory,
|
|
14
|
+
permissions, MCP servers, sessions, structured output, tool allow/deny lists,
|
|
15
|
+
and budget where supported by the installed SDK. It streams incremental output
|
|
16
|
+
and tool events while the SDK runs, and sets `finish_reason="max_turns"` when a
|
|
17
|
+
turn is truncated by the max-turns limit. `permissions.network` has no SDK
|
|
18
|
+
surface and is rejected with a typed error. Any option kwargs dropped because a
|
|
19
|
+
future SDK renamed or removed them are recorded in
|
|
20
|
+
`AgentResult.metadata["dropped_options"]` rather than discarded silently.
|
|
21
|
+
|
|
22
|
+
Codex uses the `openai-codex` package and maps working directory, session
|
|
23
|
+
resume, approval mode, sandbox, structured output, model, and reasoning effort.
|
|
24
|
+
Approval mode follows `PermissionMode`: `STRICT`/`CAUTIOUS` → `deny_all` (never
|
|
25
|
+
escalate beyond the sandbox), `DEFAULT`/`PERMISSIVE` → `auto_review`
|
|
26
|
+
(escalations auto-adjudicated). Tool audits are parsed from `TurnResult.items`
|
|
27
|
+
(command executions, MCP tool calls, dynamic tool calls, web searches), and a
|
|
28
|
+
`TurnResult.status` of `failed`/`interrupted` maps to the matching
|
|
29
|
+
`finish_reason`. `budget_usd`, `permissions.network`, `allowed_tools`,
|
|
30
|
+
`disallowed_tools`, and `mcp_servers` have no per-task SDK surface and are
|
|
31
|
+
rejected with typed errors. The constructor defaults to
|
|
32
|
+
`config_overrides=("features.plugins=false",)` so headless runs are
|
|
33
|
+
deterministic and do not pick up host-local Codex plugin configuration; pass a
|
|
34
|
+
different tuple to opt in.
|
|
35
|
+
|
|
36
|
+
Antigravity uses the `google-antigravity` package and maps API key,
|
|
37
|
+
workspace, permission-derived capabilities/policies, MCP stdio servers,
|
|
38
|
+
conversation id, structured output, session directories, model, and tool
|
|
39
|
+
events. `disallowed_tools` maps to `CapabilitiesConfig.disabled_tools`, and an
|
|
40
|
+
allow-list and a deny-list are mutually exclusive (the SDK forbids combining
|
|
41
|
+
enabled and disabled tool lists), so supplying both is rejected. Tool names are
|
|
42
|
+
validated against the `BuiltinTools` enum (`"view_file"`, not `"Read"`).
|
|
43
|
+
`budget_usd` and `permissions.network` are rejected with typed errors, and
|
|
44
|
+
MCP server configs do not accept per-server env values. The default tool posture
|
|
45
|
+
with no `allowed_tools` is:
|
|
46
|
+
|
|
47
|
+
| `PermissionMode` (or `READ_ONLY` filesystem) | Toolset | Policy |
|
|
48
|
+
|----------------------------------------------|---------|--------|
|
|
49
|
+
| `STRICT`, or any `READ_ONLY` filesystem | read-only | none (no `allow_all`) |
|
|
50
|
+
| `CAUTIOUS`, `DEFAULT` | nondestructive (no `run_command`) | `allow_all` |
|
|
51
|
+
| `PERMISSIVE` | all tools | `allow_all` |
|
|
52
|
+
|
|
53
|
+
Session and app-data directories are written under
|
|
54
|
+
`$XDG_CACHE_HOME/agent-runtime-kit` (default `~/.cache/agent-runtime-kit`,
|
|
55
|
+
`0o700`), overridable via `AntigravityAgentRuntime(data_dir=...)`.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Publish Checklist
|
|
2
|
+
|
|
3
|
+
`agent-runtime-kit` is not published yet.
|
|
4
|
+
|
|
5
|
+
## Current Name Check
|
|
6
|
+
|
|
7
|
+
Checked on 2026-06-10 from this workspace:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python - <<'PY'
|
|
11
|
+
import urllib.error, urllib.request
|
|
12
|
+
try:
|
|
13
|
+
urllib.request.urlopen("https://pypi.org/pypi/agent-runtime-kit/json", timeout=10)
|
|
14
|
+
print("TAKEN")
|
|
15
|
+
except urllib.error.HTTPError as exc:
|
|
16
|
+
print("FREE" if exc.code == 404 else f"HTTP_{exc.code}")
|
|
17
|
+
PY
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Result: `FREE`.
|
|
21
|
+
|
|
22
|
+
Re-run this immediately before publishing. A 404 means the name is still
|
|
23
|
+
available; any 200 response means it has been claimed.
|
|
24
|
+
|
|
25
|
+
## Release Gate
|
|
26
|
+
|
|
27
|
+
Continuous integration (`.github/workflows/ci.yml`) runs `ruff`, `mypy`, and
|
|
28
|
+
`pytest` on every pull request and push to `main` across Python 3.10–3.13 in
|
|
29
|
+
both the core-only and all-extras dependency lanes, so gate results no longer
|
|
30
|
+
depend on which extras happen to be installed locally. The publish workflow
|
|
31
|
+
itself also gates on tests: its `test` job (core on 3.10, all extras on 3.13)
|
|
32
|
+
must pass before the `build` job runs, so a release cannot be built or published
|
|
33
|
+
unless `ruff`/`mypy`/`pytest` are green against the release tag.
|
|
34
|
+
|
|
35
|
+
To reproduce the gate locally before tagging:
|
|
36
|
+
|
|
37
|
+
- `uv run ruff check .`
|
|
38
|
+
- `uv run mypy`
|
|
39
|
+
- `uv run pytest`
|
|
40
|
+
- `uv run python -m build`
|
|
41
|
+
- Optional: provider-specific live smoke tests from `docs/live-smoke.md`
|
|
42
|
+
|
|
43
|
+
## Trusted Publishing Setup
|
|
44
|
+
|
|
45
|
+
Use PyPI Trusted Publishing rather than a long-lived API token.
|
|
46
|
+
|
|
47
|
+
For a new package, create a pending publisher on PyPI with:
|
|
48
|
+
|
|
49
|
+
- PyPI project name: `agent-runtime-kit`
|
|
50
|
+
- Owner: `ebarti`
|
|
51
|
+
- Repository name: `agent-runtime-kit`
|
|
52
|
+
- Workflow name: `publish-pypi.yml`
|
|
53
|
+
- Environment name: `pypi`
|
|
54
|
+
|
|
55
|
+
The workflow is `.github/workflows/publish-pypi.yml`. It publishes when a
|
|
56
|
+
GitHub release is published and also supports manual dispatch with a release
|
|
57
|
+
tag such as `v0.1.0`.
|
|
58
|
+
|
|
59
|
+
## Metadata Gate
|
|
60
|
+
|
|
61
|
+
- Confirm `pyproject.toml` package name is `agent-runtime-kit`.
|
|
62
|
+
- Confirm Python support remains `>=3.10`.
|
|
63
|
+
- Confirm optional extras resolve for `claude`, `codex`, `antigravity`, and
|
|
64
|
+
`all`.
|
|
65
|
+
- Confirm README links render on PyPI.
|
|
66
|
+
- Confirm `LICENSE` is included.
|
|
67
|
+
|
|
68
|
+
## Publish
|
|
69
|
+
|
|
70
|
+
After configuring the pending publisher on PyPI, publish the existing first
|
|
71
|
+
release by manually running the `Publish to PyPI` workflow with:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
tag = v0.1.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Do not publish until the release gate passes and the PyPI name check is fresh.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling>=1.
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agent-runtime-kit"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "One typed runtime API for Claude, Codex, and Antigravity agent SDKs."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -14,7 +14,6 @@ keywords = ["agents", "claude", "codex", "antigravity", "sdk"]
|
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Development Status :: 3 - Alpha",
|
|
16
16
|
"Intended Audience :: Developers",
|
|
17
|
-
"License :: OSI Approved :: MIT License",
|
|
18
17
|
"Programming Language :: Python :: 3",
|
|
19
18
|
"Programming Language :: Python :: 3.10",
|
|
20
19
|
"Programming Language :: Python :: 3.11",
|
|
@@ -26,12 +25,14 @@ dependencies = []
|
|
|
26
25
|
|
|
27
26
|
[project.optional-dependencies]
|
|
28
27
|
claude = ["claude-agent-sdk>=0.2.87"]
|
|
29
|
-
|
|
28
|
+
# 0.1.0b3 floor: earlier betas pin a codex binary with no manylinux wheels,
|
|
29
|
+
# making the extra uninstallable on glibc Linux.
|
|
30
|
+
codex = ["openai-codex>=0.1.0b3"]
|
|
30
31
|
antigravity = ["google-antigravity>=0.1.2"]
|
|
31
32
|
all = [
|
|
32
33
|
"claude-agent-sdk>=0.2.87",
|
|
33
34
|
"google-antigravity>=0.1.2",
|
|
34
|
-
"openai-codex>=0.1.
|
|
35
|
+
"openai-codex>=0.1.0b3",
|
|
35
36
|
]
|
|
36
37
|
|
|
37
38
|
[project.urls]
|
|
@@ -48,9 +49,23 @@ dev = [
|
|
|
48
49
|
"ruff>=0.8",
|
|
49
50
|
]
|
|
50
51
|
|
|
52
|
+
[tool.uv]
|
|
53
|
+
# openai-codex-cli-bin ships per-platform binary wheels; require the platforms we
|
|
54
|
+
# develop and run CI on so resolution never locks a version missing one of them.
|
|
55
|
+
required-environments = [
|
|
56
|
+
"sys_platform == 'darwin' and platform_machine == 'arm64'",
|
|
57
|
+
"sys_platform == 'linux' and platform_machine == 'x86_64'",
|
|
58
|
+
]
|
|
59
|
+
# openai-codex pins exact pre-release builds of its CLI binary; the pre-release
|
|
60
|
+
# marker here opts that one package into pre-release resolution.
|
|
61
|
+
constraint-dependencies = ["openai-codex-cli-bin>=0.134.0a1"]
|
|
62
|
+
|
|
51
63
|
[tool.hatch.build.targets.wheel]
|
|
52
64
|
packages = ["src/agent_runtime_kit"]
|
|
53
65
|
|
|
66
|
+
[tool.hatch.build.targets.sdist]
|
|
67
|
+
include = ["src", "tests", "docs", "examples", "README.md", "LICENSE", "pyproject.toml"]
|
|
68
|
+
|
|
54
69
|
[tool.ruff]
|
|
55
70
|
line-length = 100
|
|
56
71
|
target-version = "py310"
|
|
@@ -64,6 +79,10 @@ packages = ["agent_runtime_kit"]
|
|
|
64
79
|
strict = true
|
|
65
80
|
warn_unused_configs = true
|
|
66
81
|
|
|
82
|
+
[[tool.mypy.overrides]]
|
|
83
|
+
module = ["claude_agent_sdk.*", "openai_codex.*", "google.antigravity.*"]
|
|
84
|
+
ignore_missing_imports = true
|
|
85
|
+
|
|
67
86
|
[tool.pytest.ini_options]
|
|
68
87
|
markers = [
|
|
69
88
|
"live: optional provider smoke tests that require explicit credentials and opt-in flags",
|
|
@@ -175,7 +175,12 @@ class ArtifactRef:
|
|
|
175
175
|
|
|
176
176
|
@dataclass(frozen=True)
|
|
177
177
|
class SessionResumeState:
|
|
178
|
-
"""Opaque session handle carried between invocations.
|
|
178
|
+
"""Opaque session handle carried between invocations.
|
|
179
|
+
|
|
180
|
+
``transcript`` is informational only: it is an opaque payload a caller may
|
|
181
|
+
carry between turns. The built-in adapters do not consume it (they resume by
|
|
182
|
+
``session_id``), so populating it does not change adapter behavior.
|
|
183
|
+
"""
|
|
179
184
|
|
|
180
185
|
session_id: str
|
|
181
186
|
transcript: tuple[Any, ...] = ()
|
|
@@ -183,7 +188,15 @@ class SessionResumeState:
|
|
|
183
188
|
|
|
184
189
|
@dataclass(frozen=True)
|
|
185
190
|
class Usage:
|
|
186
|
-
"""Token and cost metadata reported by a runtime.
|
|
191
|
+
"""Token and cost metadata reported by a runtime.
|
|
192
|
+
|
|
193
|
+
``input_tokens`` counts prompt tokens excluding Anthropic-style cache reads and
|
|
194
|
+
cache creation, which are reported separately in ``cache_read_tokens`` and
|
|
195
|
+
``cache_creation_tokens``. ``total_tokens`` is the vendor-reported total when the
|
|
196
|
+
runtime provides one, and ``None`` when it does not (so "unknown" is
|
|
197
|
+
distinguishable from zero). ``cost_usd`` is ``0.0`` when the provider reports no
|
|
198
|
+
cost.
|
|
199
|
+
"""
|
|
187
200
|
|
|
188
201
|
input_tokens: int = 0
|
|
189
202
|
output_tokens: int = 0
|
|
@@ -204,6 +217,9 @@ class AgentTask:
|
|
|
204
217
|
mcp_servers: tuple[McpServerConfig, ...] = ()
|
|
205
218
|
permissions: PermissionProfile = field(default_factory=PermissionProfile)
|
|
206
219
|
event_sink: EventSink | None = None
|
|
220
|
+
# Informational only: carried into task events for observability, not enforced
|
|
221
|
+
# by the built-in adapters (no vendor SDK exposes a portable turn-count limit
|
|
222
|
+
# this maps onto). Treated as a hint, never as a hard cap.
|
|
207
223
|
sdk_executions: int = 1
|
|
208
224
|
budget_usd: float | None = None
|
|
209
225
|
session_id: str | None = None
|
{agent_runtime_kit-0.1.0 → agent_runtime_kit-0.1.1}/src/agent_runtime_kit/adapters/_common.py
RENAMED
|
@@ -11,6 +11,7 @@ from typing import Any
|
|
|
11
11
|
from agent_runtime_kit._errors import UnsupportedTaskInputError
|
|
12
12
|
from agent_runtime_kit._types import (
|
|
13
13
|
AgentRuntimeKind,
|
|
14
|
+
AgentTask,
|
|
14
15
|
AvailabilityReason,
|
|
15
16
|
RuntimeAvailability,
|
|
16
17
|
)
|
|
@@ -103,16 +104,73 @@ def parse_json_output(output: str) -> Any | None:
|
|
|
103
104
|
return None
|
|
104
105
|
|
|
105
106
|
|
|
106
|
-
def
|
|
107
|
-
|
|
107
|
+
def reject_unsupported_inputs(
|
|
108
|
+
kind: AgentRuntimeKind,
|
|
109
|
+
task: AgentTask,
|
|
110
|
+
*,
|
|
111
|
+
budget: bool,
|
|
112
|
+
network: bool,
|
|
113
|
+
tool_filters: bool,
|
|
114
|
+
) -> None:
|
|
115
|
+
"""Raise ``UnsupportedTaskInputError`` for task fields a runtime cannot honor.
|
|
116
|
+
|
|
117
|
+
Each flag selects a field whose silent omission would mislead the caller. The
|
|
118
|
+
project contract is to reject these inputs rather than drop them quietly, so an
|
|
119
|
+
adapter passes ``True`` only for fields it has no SDK surface to honor.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
if budget and task.budget_usd is not None:
|
|
123
|
+
raise UnsupportedTaskInputError(
|
|
124
|
+
kind,
|
|
125
|
+
"budget_usd",
|
|
126
|
+
"this runtime does not expose a cost budget; remove budget_usd to proceed",
|
|
127
|
+
)
|
|
128
|
+
if network and task.permissions.network is not None:
|
|
129
|
+
raise UnsupportedTaskInputError(
|
|
130
|
+
kind,
|
|
131
|
+
"permissions.network",
|
|
132
|
+
"this runtime does not expose network access control",
|
|
133
|
+
)
|
|
134
|
+
if tool_filters:
|
|
135
|
+
if task.permissions.allowed_tools:
|
|
136
|
+
raise UnsupportedTaskInputError(
|
|
137
|
+
kind,
|
|
138
|
+
"permissions.allowed_tools",
|
|
139
|
+
"this runtime does not expose a tool allow-list",
|
|
140
|
+
)
|
|
141
|
+
if task.permissions.disallowed_tools:
|
|
142
|
+
raise UnsupportedTaskInputError(
|
|
143
|
+
kind,
|
|
144
|
+
"permissions.disallowed_tools",
|
|
145
|
+
"this runtime does not expose a tool deny-list",
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def filter_supported_kwargs(
|
|
150
|
+
factory: Any, kwargs: Mapping[str, Any]
|
|
151
|
+
) -> tuple[dict[str, Any], list[str]]:
|
|
152
|
+
"""Split kwargs into those the constructor accepts and those it does not.
|
|
153
|
+
|
|
154
|
+
This exists to tolerate vendor option drift: a future SDK version may rename or
|
|
155
|
+
remove an option this adapter builds. Rather than crash, unsupported keys are
|
|
156
|
+
dropped, but drops must be observable, so the dropped key names are returned
|
|
157
|
+
alongside the accepted kwargs and surfaced in ``AgentResult.metadata``.
|
|
158
|
+
"""
|
|
108
159
|
|
|
109
160
|
try:
|
|
110
161
|
signature = inspect.signature(factory)
|
|
111
162
|
except (TypeError, ValueError):
|
|
112
|
-
return dict(kwargs)
|
|
163
|
+
return dict(kwargs), []
|
|
113
164
|
if any(param.kind is inspect.Parameter.VAR_KEYWORD for param in signature.parameters.values()):
|
|
114
|
-
return dict(kwargs)
|
|
115
|
-
|
|
165
|
+
return dict(kwargs), []
|
|
166
|
+
supported: dict[str, Any] = {}
|
|
167
|
+
dropped: list[str] = []
|
|
168
|
+
for key, value in kwargs.items():
|
|
169
|
+
if key in signature.parameters:
|
|
170
|
+
supported[key] = value
|
|
171
|
+
else:
|
|
172
|
+
dropped.append(key)
|
|
173
|
+
return supported, dropped
|
|
116
174
|
|
|
117
175
|
|
|
118
176
|
def _extra_name(kind: AgentRuntimeKind) -> str:
|