pydantic_acp API
This page documents the public surface re-exported by pydantic_acp.
Functions
create_acp_agent(agent=None, *, agent_factory=None, agent_source=None, config=None, projection_maps=None)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/runtime/server.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
create_acp_model(*, acp_agent=None, acp_command=None, model_name=None, cwd=None, env=None, stderr_mode='inherit', terminate_timeout=5.0, prompt_renderer=None, history_mode='latest_user', delegate_client=None, enable_pydantic_acp_meta=None, auth_method_id=None, raise_on_empty_turn=False, settings=None, profile=None)
Create a Pydantic AI model backed by an ACP agent or ACP stdio command.
Exactly one of acp_agent or acp_command must be provided. Passing
model_name=None leaves ACP model selection to the remote agent's session
default and does not send a session/set_config_option request for "model".
auth_method_id selects an explicit ACP authentication method when
session/new reports auth_required. Set raise_on_empty_turn=True
when a silent ACP turn should fail as UnexpectedModelBehavior instead
of producing an empty Pydantic AI response.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/factory.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
run_acp(agent=None, *, agent_factory=None, agent_source=None, config=None, projection_maps=None)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/runtime/server.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
compose_projection_maps(projection_maps)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/projection.py
171 172 173 174 175 176 177 178 179 180 | |
Core Classes And Data Types
AdapterConfig(*, agent_name=DEFAULT_AGENT_NAME, agent_title=DEFAULT_AGENT_TITLE, agent_version=DEFAULT_AGENT_VERSION, allow_model_selection=False, approval_bridge=NativeApprovalBridge(), approval_state_provider=None, authentication_provider=None, capability_bridges=list(), config_options_provider=None, contextual_extension_router=None, enable_generic_tool_projection=True, enable_model_config_option=True, extension_router=None, host_access_policy=None, hook_projection_map=HookProjectionMap(), models_provider=None, modes_provider=None, native_plan_additional_instructions=None, native_plan_persistence_provider=None, plan_id='acpkit.plan', plan_provider=None, plan_update_mode='full', prompt_capabilities=AdapterPromptCapabilities(), prompt_model_override_provider=None, replay_history_on_load=True, slash_command_provider=None, available_models=list(), session_store=MemorySessionStore(), output_serializer=DefaultOutputSerializer(), projection_maps=tuple(), tool_classifier=DefaultToolClassifier())
dataclass
AdapterModel(*, model_id, name, override, description=None)
dataclass
AdapterPromptCapabilities(*, audio=True, image=True, embedded_context=True)
dataclass
AcpSessionContext(*, session_id, cwd, created_at, updated_at, additional_directories=(), title=None, session_model_id=None, message_history_json=None, plan_markdown=None, plan_entries=list(), active_plan_id=None, config_values=dict(), mcp_servers=list(), metadata=dict(), transcript=list(), client=None, client_capabilities=None)
dataclass
supports_config_options()
Return whether the connected client accepts session config options.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/session/state.py
119 120 121 122 123 124 | |
supports_boolean_config_options()
Return whether the connected client accepts boolean config options.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/session/state.py
126 127 128 129 130 131 132 133 134 135 136 | |
supports_plan_content_updates()
Return whether the client supports unstable plan delta updates.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/session/state.py
138 139 140 141 | |
ask_choice(question, choices, *, fallback=None)
async
Ask the connected client to select one typed value.
The helper compiles choices to the standard ACP form-elicitation schema. Clients control presentation and may ignore option descriptions.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/session/state.py
164 165 166 167 168 169 170 171 172 173 174 175 176 | |
JsonValue = JsonPrimitive | list['JsonValue'] | dict[str, 'JsonValue']
module-attribute
RuntimeAgent = PydanticAgent[Any, Any]
module-attribute
Typed Elicitation
ElicitationChoice(*, value, label, description=None, default=False)
dataclass
Bases: Generic[ChoiceValueT]
One typed value offered by :meth:AcpSessionContext.ask_choice.
ChoiceElicitationResult = ChoiceElicitationAccepted[ChoiceValueT] | ChoiceElicitationDeclined | ChoiceElicitationCancelled
module-attribute
ChoiceElicitationFallback = Callable[[], ChoiceElicitationResult[ChoiceValueT] | ChoiceValueT | Awaitable[ChoiceElicitationResult[ChoiceValueT] | ChoiceValueT]]
module-attribute
ChoiceElicitationAccepted(*, value)
dataclass
Bases: Generic[ChoiceValueT]
An accepted elicitation containing the selected typed value.
ChoiceElicitationDeclined()
dataclass
An elicitation the user explicitly declined to answer.
ChoiceElicitationCancelled()
dataclass
An elicitation cancelled without an answer.
ElicitationUnsupportedError
Bases: RuntimeError
Raised when the connected ACP client cannot render the requested form.
InvalidElicitationResponseError
Bases: RuntimeError
Raised when a client accepts an elicitation with an invalid selection.
InvalidElicitationFallbackError
Bases: ValueError
Raised when a legacy fallback value is not one of the offered choices.
Protocol Extension And Authentication Contracts
ExtensionRouter
Bases: Protocol
Handle application-owned ACP extension methods and notifications.
ContextualExtensionRouter
Bases: Protocol
Handle extension traffic with public connection-scoped ACP state.
ExtensionContext(*, client, protocol_version, client_capabilities, client_info)
dataclass
Public state negotiated for one ACP client connection.
AuthenticationProvider
Bases: Protocol
Provide ACP authentication methods and execute authentication requests.
AuthenticationMethod = EnvVarAuthMethod | TerminalAuthMethod | AuthMethodAgent
module-attribute
ACP Client Provider Bridge
AcpProvider(*, acp_agent, host_client=None, cwd='.', name='acp', base_url='acp://local', protocol_version=PROTOCOL_VERSION, client_capabilities=None, client_info=None, mcp_servers=None, prompt_renderer=None, history_mode='latest_user', enable_pydantic_acp_meta=None, auth_method_id=None, raise_on_empty_turn=False)
Bases: Provider[Agent]
Pydantic AI provider that treats an ACP agent as the model backend.
This is the inverse of the normal pydantic-acp server adapter. The
server adapter exposes a pydantic_ai.Agent through ACP. AcpProvider
consumes an existing ACP agent and makes it available to Pydantic AI as a
provider/model pair, so application code can write ordinary Pydantic AI
agents while delegating the underlying model turn to ACP.
The provider owns ACP protocol/session setup, model selection through the
remote agent's model config option, host/client update
capture, and prompt rendering. It deliberately remains a provider rather
than an alternate agent framework: Pydantic AI still owns the outer agent
run, result validation, usage accumulation, and history shape.
Create a new ACP provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acp_agent
|
Agent
|
The ACP agent to wrap as a Pydantic AI provider/model. |
required |
host_client
|
Client | None
|
Optional upstream :class: |
None
|
cwd
|
str | Path
|
Working directory passed to the ACP session on creation. |
'.'
|
name
|
str
|
Provider name reported via :attr: |
'acp'
|
base_url
|
str
|
Base URL reported via :attr: |
'acp://local'
|
protocol_version
|
int
|
ACP protocol version used during
|
PROTOCOL_VERSION
|
client_capabilities
|
ClientCapabilities | None
|
ACP client capabilities sent during
|
None
|
client_info
|
Implementation | None
|
ACP implementation info sent during |
None
|
mcp_servers
|
Sequence[Any] | None
|
Optional list of MCP servers forwarded to
|
None
|
prompt_renderer
|
AcpPromptRenderer | None
|
Custom callable that converts Pydantic AI
messages into ACP prompt blocks. When |
None
|
history_mode
|
HistoryMode
|
Controls how previous messages are rendered into
the ACP prompt. |
'latest_user'
|
enable_pydantic_acp_meta
|
bool | None
|
Enables the private |
None
|
auth_method_id
|
str | None
|
ACP |
None
|
raise_on_empty_turn
|
bool
|
When |
False
|
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | |
host
property
The ACP host bridge connected to the wrapped ACP agent.
updates
property
All ACP updates recorded by the host bridge so far.
enable_pydantic_acp_meta
property
Whether this provider opts into private pydantic_acp ACP metadata.
raise_on_empty_turn
property
Whether an empty ACP turn raises instead of returning empty parts.
close()
async
Close the wrapped ACP agent when it exposes an async-compatible close hook.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
626 627 628 629 630 631 632 633 | |
model(model_name=None, *, settings=None, profile=None, history_mode=None)
Build an :class:AcpModel bound to this provider.
When model_name is None, the bridge does not call ACP
session/set_config_option for "model" and leaves model selection
to the wrapped agent's session default. The visible Pydantic AI model
name remains "agent".
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 | |
render_prompt_blocks(messages, model_request_parameters, *, history_mode=None)
async
Render Pydantic AI model messages into ACP prompt blocks.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | |
request_prompt(*, model_name, prompt, model_request_parameters)
async
Send one prompt turn to the ACP agent and collect its visible text.
Errors raised by the ACP agent (rate limits, auth rejection, upstream
API failures) are propagated with anyio TaskGroup wrapping stripped so
the caller sees the agent's real error rather than an opaque
ExceptionGroup: unhandled errors in a TaskGroup.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
ensure_session(*, model_name=None)
async
Initialize the ACP connection and return an active session id.
This is the public entry point for bootstrapping a session without
sending a prompt turn: it performs initialize (authenticating if the
agent demands it), creates the session, and optionally selects a model.
Callers that need to configure a session up front (for example to set a
session mode) should use this instead of reaching into the private
_ensure_session.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
846 847 848 849 850 851 852 853 854 855 856 | |
set_session_mode(mode_id)
async
Set the ACP session mode, bootstrapping the session if needed.
ACP session modes (for example the permission mode) are distinct from
the model session config option and are set via session/set_mode.
This ensures a session exists, then delegates to the wrapped agent's
set_session_mode when available.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | |
AcpModel(model_name=None, *, provider, settings=None, profile=None, history_mode=None)
Bases: Model[Agent]
Pydantic AI Model backed by an ACP agent provider.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | |
AcpHostBridge(*, delegate=None)
Minimal ACP host/client implementation used by :class:AcpProvider.
ACP agents send their visible output to a connected ACP client via
session_update. Pydantic AI models, however, return a ModelResponse.
This bridge is the seam between the two contracts: it records ACP updates so
AcpModel can fold agent message chunks back into Pydantic AI response
parts, while optionally delegating real host operations to an upstream ACP
client supplied by the caller.
The bridge intentionally does not emulate a filesystem, terminal, approval UI, or extension namespace. When an ACP agent asks for such host operations and no delegate was supplied, the request fails explicitly instead of inventing host behavior that is not present.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
157 158 159 | |
snapshot_index()
Return an index that can later be used to read only new updates.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
161 162 163 | |
records_since(index, *, session_id=None)
Return recorded updates after index, optionally scoped to a session.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
165 166 167 168 169 170 171 172 173 174 175 | |
agent_message_text_since(index, *, session_id)
Concatenate ACP agent message chunks recorded after index.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
177 178 179 180 181 182 183 184 185 186 187 188 | |
usage_update_since(index, *, session_id)
Collect the latest ACP usage update observed after index.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
190 191 192 193 194 195 196 197 198 | |
session_update(session_id, update, **kwargs)
async
Record an ACP update and optionally forward it to a real host client.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
on_connect(conn)
Forward reverse connections to a delegate host client when it supports them.
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/client.py
370 371 372 373 | |
Agent Source Classes And Protocols
AgentFactory
Bases: Protocol[AgentFactoryDepsT, AgentFactoryOutputDataT]
AgentSource
Bases: Protocol[AgentDepsT, OutputDataT]
StaticAgentSource(agent, deps=None)
dataclass
Bases: Generic[AgentDepsT, OutputDataT]
FactoryAgentSource(factory)
dataclass
Bases: Generic[AgentDepsT, OutputDataT]
Session Store Classes
SessionStore
Bases: Protocol
MemorySessionStore(_sessions=dict())
dataclass
FileSessionStore(root)
dataclass
Provider State Classes And Protocols
ModelSelectionState(*, available_models, current_model_id, allow_any_model_id=False, enable_config_option=True, config_option_name='Model', config_option_description='Session-local model override.')
dataclass
ModeState(*, modes, current_mode_id=None)
dataclass
SessionModelsProvider
Bases: Protocol
SessionModesProvider
Bases: Protocol
ConfigOptionsProvider
Bases: Protocol
PlanProvider
Bases: Protocol
NativePlanPersistenceProvider
Bases: Protocol
ApprovalStateProvider
Bases: Protocol
ApprovalPolicy = Literal['allow', 'reject']
module-attribute
ApprovalPolicyStore
Bases: Protocol
SessionMetadataApprovalPolicyStore(metadata_key='approval_policies')
dataclass
PermissionOptionSet(*, allow_once_name='Allow', reject_once_name='Deny', allow_always_name='Always Allow', reject_always_name='Always Deny')
dataclass
Bridge Classes
CapabilityBridge
BufferedCapabilityBridge()
dataclass
Bases: CapabilityBridge
PrepareToolsBridge(*, metadata_key='prepare_tools', default_mode_id, modes, mode_config_key='mode', plan_generation_config_id='plan_generation_type', plan_generation_config_name='Plan Generation', plan_generation_config_description='How plan mode records ACP plan state.', default_plan_generation_type='structured')
dataclass
Bases: BufferedCapabilityBridge, Generic[AgentDepsT]
PrepareToolsMode(*, id, name, prepare_func, description=None, plan_mode=False, plan_tools=False)
dataclass
Bases: Generic[AgentDepsT]
PrepareOutputToolsBridge(*, metadata_key='prepare_output_tools', default_mode_id, modes, mode_config_key='prepare_output_tools_mode')
dataclass
Bases: BufferedCapabilityBridge, Generic[AgentDepsT]
PrepareOutputToolsMode(*, id, name, prepare_func, description=None)
dataclass
Bases: Generic[AgentDepsT]
ThinkingBridge(*, config_id='thinking', config_name='Thinking Effort', config_description='Session-local thinking/reasoning effort.')
dataclass
Bases: CapabilityBridge
HookBridge(metadata_key='hooks', hide_all=False, record_event_stream=True, record_model_requests=True, record_node_lifecycle=True, record_deferred_tool_calls=True, record_output_processing=True, record_output_validation=True, record_prepare_output_tools=True, record_prepare_tools=True, record_run_lifecycle=True, record_tool_execution=True, record_tool_validation=True)
dataclass
Bases: BufferedCapabilityBridge
ExternalHookEventBridge(*, metadata_key='external_hooks', projection_map=HookProjectionMap(), emission_mode='paired')
dataclass
Bases: BufferedCapabilityBridge
EventEmissionMode = Literal['paired', 'start_only']
module-attribute
HistoryProcessorBridge(metadata_key='history_processors', processor_names=list())
dataclass
Bases: BufferedCapabilityBridge
ThreadExecutorBridge(*, executor, metadata_key='thread_executor')
dataclass
Bases: CapabilityBridge
ImageGenerationBridge(*, builtin=True, local=None, fallback_model=None, background=None, input_fidelity=None, moderation=None, output_compression=None, output_format=None, quality=None, size=None, aspect_ratio=None, tool_names=_DEFAULT_IMAGE_GENERATION_TOOL_NAMES, metadata_key='image_generation')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
SetToolMetadataBridge(*, tools='all', metadata_key=None, **metadata)
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/bridges/capability_support.py
179 180 181 182 183 184 185 186 187 188 | |
IncludeToolReturnSchemasBridge(tools='all', metadata_key=None)
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
ToolsetBridge(*, toolset, metadata_key='toolset')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
PrefixToolsBridge(*, wrapped, prefix, metadata_key='prefix_tools')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
WebSearchBridge(*, builtin=True, local=None, search_context_size=None, user_location=None, blocked_domains=None, allowed_domains=None, max_uses=None, tool_names=_DEFAULT_WEB_SEARCH_TOOL_NAMES, metadata_key='web_search')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
WebFetchBridge(*, builtin=True, local=None, allowed_domains=None, blocked_domains=None, max_uses=None, enable_citations=None, max_content_tokens=None, tool_names=_DEFAULT_WEB_FETCH_TOOL_NAMES, metadata_key='web_fetch')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
McpCapabilityBridge(*, url, builtin=True, local=None, id=None, authorization_token=None, headers=None, allowed_tools=None, description=None, tool_name_prefixes=_DEFAULT_MCP_TOOL_NAME_PREFIXES, metadata_key='mcp_capability')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
SessionMcpBridge(*, metadata_key='session_mcp', include_instructions=True, include_return_schema=None, cache_tools=True, cache_resources=True, cache_prompts=True, tool_error_behavior='retry', max_retries=None, allowed_tools=None, tool_name_prefixes=frozenset(), toolset_id_prefix='acp-session-mcp', advertise_http=True, advertise_sse=True)
dataclass
Bases: CapabilityBridge
Attach ACP client-provided MCP servers to the Pydantic AI agent run.
ACP clients may pass MCP server definitions during session/new, session/load,
session/fork, or session/resume. The adapter persists those definitions on
AcpSessionContext.mcp_servers; this bridge turns them into a Pydantic AI
MCPToolset capability for the active session.
OpenAICompactionBridge(*, message_count_threshold=None, trigger=None, instructions=None, metadata_key='openai_compaction')
dataclass
Bases: BufferedCapabilityBridge, Generic[AgentDepsT]
AnthropicCompactionBridge(*, token_threshold=150000, instructions=None, pause_after_compaction=False, metadata_key='anthropic_compaction')
dataclass
Bases: CapabilityBridge, Generic[AgentDepsT]
McpBridge(*, metadata_key='mcp', approval_policy_scope='tool', config_options=list(), servers=list(), tools=list())
dataclass
Bases: CapabilityBridge
McpServerDefinition(*, server_id, name, transport, url=None, description=None, tool_prefix=None)
dataclass
McpToolDefinition(*, tool_name, server_id, kind='execute')
dataclass
Hook Introspection Helpers
RegisteredHookInfo(*, event_id, hook_name, tool_filters)
dataclass
list_agent_hooks(agent)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/runtime/hook_introspection.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
Projection Classes
FileSystemProjectionMap(*, write_tool_names=frozenset(), read_tool_names=frozenset(), bash_tool_names=frozenset(), search_tool_names=frozenset(), default_write_tool=None, default_read_tool=None, default_bash_tool=None, default_search_tool=None, path_arg=None, content_arg=None, old_text_arg=None, command_arg=None, terminal_id_arg=None, search_path_arg=None, search_pattern_arg=None, render_search_results_as_tree=False, hide_dot_directories_in_tree=True, tree_root_label=None)
dataclass
WebToolProjectionMap(*, search_tool_names=_DEFAULT_SEARCH_TOOL_NAMES, fetch_tool_names=_DEFAULT_FETCH_TOOL_NAMES)
dataclass
BuiltinToolProjectionMap(*, web_projection_map=WebToolProjectionMap(), image_generation_tool_names=_DEFAULT_IMAGE_GENERATION_TOOL_NAMES, mcp_tool_name_prefixes=_DEFAULT_MCP_TOOL_NAME_PREFIXES)
dataclass
CompositeProjectionMap(*, maps)
dataclass
ProjectionAwareToolClassifier(*, base_classifier, projection_maps)
dataclass
Approval Presentation
PermissionRequestContext(*, session, tool_call, raw_input, cwd, classifier, projection_map=None)
dataclass
PermissionToolCallBuilder
Bases: Protocol
DefaultPermissionToolCallBuilder(*, status='pending')
dataclass
NativeApprovalBridge(*, enable_persistent_choices=False, tool_call_builder=DefaultPermissionToolCallBuilder(), policy_store=SessionMetadataApprovalPolicyStore(), option_set=PermissionOptionSet())
dataclass
ProjectionAwareApprovalBridge
Bases: Protocol
supports_projection_aware_approval_bridge(value)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/approvals.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
Slash Commands
SlashCommandRequest(*, name, argument, raw_prompt, session, agent)
dataclass
SlashCommandResult(*, text=None, updates=(), stop_reason='end_turn', handled=True, refresh_session_surface=True)
dataclass
SlashCommandProvider
Bases: Protocol
StaticSlashCommand(*, command, handler)
dataclass
StaticSlashCommandProvider(*, commands)
dataclass
SlashCommandHandler = Callable[[SlashCommandRequest], SlashCommandResult | None | Awaitable[SlashCommandResult | None]]
module-attribute
Projection Helpers
truncate_text(text, *, limit, marker=DEFAULT_TEXT_TRUNCATION_MARKER)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
20 21 22 23 24 25 26 27 28 29 30 31 32 | |
truncate_lines(lines, *, max_lines, truncation_line='... [truncated]')
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
single_line_summary(text, *, limit)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
51 52 53 54 55 56 57 58 59 | |
format_code_block(text, *, language=None, limit=None)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
62 63 64 65 66 67 68 69 70 71 | |
format_diff_preview(path, old_text, new_text, *, context_lines=3, max_lines=40, include_path_header=True, include_diff_headers=False)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
format_terminal_status(*, exit_code, signal)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_text.py
107 108 109 110 111 112 113 114 115 116 117 118 | |
caution_for_path(path, *, session_cwd, workspace_root=None, access_policy=None)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_risk.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
caution_for_command(command, *, args=None, cwd=None, session_cwd, workspace_root=None, access_policy=None)
Source code in packages/adapters/pydantic-acp/src/pydantic_acp/_projection_risk.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |