Expand description
Plugin protocol DTOs shared across plugin boundaries. Wire-format DTOs for the plugin protocol.
This module exists to define the stable boundary between osp-cli and
external plugins. The app and plugin manager can evolve internally, but the
JSON shapes in this module are the contract that both sides need to agree
on.
In broad terms:
Describe*types advertise commands, arguments, and policy metadataResponse*types carry execution results, messages, and render hints- validation helpers reject protocol-shape errors before higher-level code tries to trust the payload
Wire flow:
plugin executable
│
├── `describe` -> DescribeV1 / DescribeCommandV1
│ host builds command catalog, completion, and policy
│
└── `run` -> ResponseV1
host validates payload before adapting/rendering itUseful mental split:
- plugin authors care about these types as the stable JSON contract
- host-side code cares about them as validated input before converting into command catalogs, policy registries, and rendered output
Clap-backed convenience constructors such as
crate::core::plugin::DescribeV1::from_clap_command are available when
the crate is built with the default clap feature. Builds that disable
clap still expose the wire DTOs but omit those helper constructors.
Contract:
- these types may depend on shared
coremetadata, but they should stay free of host runtime concerns - any parsing/validation here should enforce protocol rules, not business policy
- caller-facing docs should describe stable wire behavior rather than internal plugin manager details
Structs§
- Describe
ArgV1 - Positional argument description emitted by a plugin.
- Describe
Command Auth V1 - Authorization metadata attached to a described command.
- Describe
Command V1 - Recursive command description used in plugin metadata.
- Describe
Flag V1 - Flag description emitted by a plugin.
- Describe
Suggestion V1 - Suggested value emitted in plugin metadata.
- Describe
V1 describepayload emitted by a plugin that speaks protocol v1.- Response
Error V1 - Structured error payload returned when
okisfalse. - Response
Message V1 - User-facing message emitted alongside a plugin response.
- Response
Meta V1 - Rendering hints attached to a plugin response.
- Response
V1 - Protocol v1 command response envelope.
Enums§
- Column
Alignment V1 - Column alignment hint used in plugin response metadata.
- Describe
Value Type V1 - Wire-format type hint for plugin argument values.
- Describe
Visibility Mode V1 - Wire-format visibility mode used by plugin metadata.
- Response
Message Level V1 - Message severity carried in plugin responses.
Constants§
- PLUGIN_
PROTOCOL_ V1 - Current plugin wire protocol version understood by this crate.