cpex_hosts_python/legacy/mod.rs
1// Location: ./crates/cpex-hosts-python/src/legacy/mod.rs
2// Copyright 2026
3// SPDX-License-Identifier: Apache-2.0
4// Authors: Ted Habeck
5//
6// Legacy (non-CMF) hook payloads.
7//
8// "Legacy" is the Python framework's term for the pre-CMF hook family:
9// `tool_pre_invoke` and friends, as opposed to `cmf.tool_pre_invoke`. These
10// structs mirror its Pydantic models. The identity and delegation payloads
11// ride PPE's `identity.resolve` and `token.delegate` hooks. The tool, prompt
12// and resource payloads have no PPE hook; they serve hosts that register the
13// unprefixed names themselves. `crate::conversion` holds the hook table.
14//
15// `cmf_shim` translates PPE's tool, prompt and resource `cmf.*` hooks into
16// these payloads for workers that predate `cmf.*` hook support.
17
18pub mod cmf_shim;
19pub mod payloads;
20
21pub use payloads::{
22 AttenuationConfig, IdentityResolvePayload, PromptPostFetchPayload, PromptPreFetchPayload,
23 ResourcePostFetchPayload, ResourcePreFetchPayload, TokenDelegatePayload, ToolPostInvokePayload,
24 ToolPreInvokePayload,
25};