Skip to main content

ACP Kit provides a common adapter for Agent Frameworks.

Project description

ACP Kit

ACP Kit is a monorepo for ACP-facing agent runtime packages.

  • acpkit is the root CLI and target resolver
  • pydantic-acp turns pydantic_ai.Agent instances into ACP agents
  • codex-auth-helper turns a local Codex login into a pydantic-ai Responses model

Repository Layout

src/acpkit/                                  Root CLI and adapter dispatch
packages/adapters/pydantic-acp/             Pydantic AI -> ACP adapter
packages/helpers/codex-auth-helper/         Codex auth -> pydantic-ai model helper
examples/pydantic/                          Focused SDK examples and runnable demos
tests/                                      Behavioral and integration tests
docs/                                       Project documentation

Installation

Production:

uv pip install "acpkit[pydantic]"
pip install "acpkit[pydantic]"

Development:

uv sync --extra dev --extra docs --extra pydantic
pip install -e ".[dev,docs,pydantic]"

CLI Quick Start

Run a supported agent target through ACP:

acpkit run my_agent
acpkit run my_agent:agent
acpkit run my_agent:agent -p ./agent_home

acpkit resolves module or module:attribute targets, auto-detects pydantic_ai.Agent instances, and dispatches them to the installed adapter package. If only the module is given, it selects the last defined pydantic_ai.Agent instance in that module.

If the matching adapter extra is not installed, acpkit fails with an install hint such as uv pip install "acpkit[pydantic]".

Status

  • pydantic-acp milestone 1-7 scope is implemented
  • acpkit CLI supports Click-based run dispatch for installed adapters
  • codex-auth-helper provides create_codex_responses_model(...) for Codex-backed pydantic-ai usage

Current Feature Surface

  • Root CLI: acpkit run module, acpkit run module:attribute, repeated -p/--path
  • Adapter bootstrap: run_acp(...), create_acp_agent(...)
  • Agent inputs: direct Agent, sync or async agent_factory, custom AgentSource
  • Session features: create, load, list, fork, resume, close, transcript replay, history replay
  • Session persistence: in-memory by default, or file-backed with FileSessionStore
  • Session controls: ACP model state, mode state, config options, plan updates
  • Session slash commands: /model, /tools, /hooks, /mcp-servers
  • Approval flow: ACP permission requests mapped to Pydantic AI deferred approvals
  • Projection maps: filesystem read/write diffs and bash command previews
  • Capability bridges: hooks, prepare-tools, history processors, MCP metadata and classification
  • Hook introspection: existing Hooks capabilities can be surfaced into ACP updates and /hooks
  • Host helpers: session-scoped ACP filesystem and terminal adapters
  • Codex helper: create_codex_responses_model(...) from packages/helpers/codex-auth-helper

/model notes:

  • /model prints the current model id
  • /model provider:model switches the current session model
  • Codex-backed selection must be explicit: /model codex:gpt-5

Quick Examples

Static agent:

from pydantic_ai import Agent
from pydantic_acp import run_acp

agent = Agent("test")
run_acp(agent=agent)

Configured adapter with file-backed sessions:

from pathlib import Path

from pydantic_ai import Agent
from pydantic_acp import AdapterConfig, FileSessionStore, run_acp

agent = Agent("test", name="demo-agent")

run_acp(
    agent=agent,
    config=AdapterConfig(
        session_store=FileSessionStore(base_dir=Path(".acp-sessions")),
    ),
)

Session-aware factory:

from pydantic_ai import Agent
from pydantic_acp import AcpSessionContext, create_acp_agent

def build_agent(session: AcpSessionContext) -> Agent[None, str]:
    return Agent("test", name=f"agent-{session.cwd.name}")

acp_agent = create_acp_agent(agent_factory=build_agent)

Filesystem diff projection:

from pydantic_acp import FileSystemProjectionMap, run_acp

run_acp(
    agent=agent,
    projection_maps=(
        FileSystemProjectionMap(
            default_read_tool="read_file",
            default_write_tool="write_file",
            default_bash_tool="execute",
        ),
    ),
)

Hook projection:

from pydantic_acp import AdapterConfig, HookProjectionMap, run_acp

run_acp(
    agent=agent,
    config=AdapterConfig(
        hook_projection_map=HookProjectionMap(
            hidden_event_ids=frozenset({"after_model_request"}),
        ),
    ),
)

Codex-backed pydantic-ai model:

from pydantic_ai import Agent
from codex_auth_helper import create_codex_responses_model

agent = Agent(create_codex_responses_model("gpt-5"))

Example entry points:

  • examples/pydantic/static_agent.py smallest direct run_acp(agent=...) setup
  • examples/pydantic/hook_projection.py native Hooks capability introspection rendered through HookProjectionMap
  • examples/pydantic/my_agent.py broad end-to-end ACP demo combining factories, providers, approvals, bridges, and host helpers

Development

ACP Kit uses uv for dependency management and tool execution. The canonical local checks are:

uv run ruff check
uv run ty check
uv run basedpyright
make tests
make check

To preview the docs locally:

uv run mkdocs serve --dev-addr 127.0.0.1:8080

Documentation Map

  • docs/index.md: workspace overview and documentation map
  • docs/cli.md: root acpkit CLI behavior
  • docs/pydantic-acp.md: adapter architecture and milestone coverage
  • examples/pydantic/README.md: example inventory and runnable demo entry points
  • docs/helpers.md: helper packages, including codex-auth-helper
  • docs/providers.md: provider seams
  • docs/bridges.md: capability bridge system
  • docs/host-backends.md: filesystem and terminal helpers
  • docs/testing.md: behavioral test surface

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acpkit-0.2.0.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acpkit-0.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file acpkit-0.2.0.tar.gz.

File metadata

  • Download URL: acpkit-0.2.0.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acpkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7324598983a8dcb5516c70aab0b9a4cc4f9e3104b9e3a4362415a884aece1abb
MD5 422268200937393b51f11b1b56ea45ed
BLAKE2b-256 72e9cf0f4414ebc944e2043fa6af45c4fa5bf0b94cac61b49de2be131387969c

See more details on using hashes here.

File details

Details for the file acpkit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: acpkit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acpkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6ebfc3b11cf8d0db738c60cee8da8b3815c06b7987acc5ae1d7919a990bdc3e
MD5 00d84e3fbfe99328f2151b79ce72641d
BLAKE2b-256 65e7eaa0d7312477c13bb35bbe9ddf635408815d22abc103c213016b2588fa26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page