Expand description
Soma’s own action catalog: the invariant action-spec table below and request-parsing shared identically across REST, CLI, and MCP dispatch.
See the module-placement note at the bottom of this file for why this
lives in soma-domain rather than soma-application.
Note to editors: xtask/src/patterns/actions.rs and
xtask/src/scripts_lane_d.rs text-scan this file’s type and constant
names (not just doc comments) starting from each name’s first
occurrence in the file to locate the action-spec table below. Keep those
exact identifiers out of prose above the table itself, or the scan
anchors on the wrong occurrence and silently mis-parses. The rationale
comment at the bottom of this file exists specifically to stay clear of
that hazard.
Re-exports§
pub use crate::scopes::scopes_satisfy;pub use crate::scopes::DENY_SCOPE;pub use crate::scopes::READ_SCOPE;pub use crate::scopes::WRITE_SCOPE;
Structs§
- Action
Doc - Serializable, catalog-facing documentation for a single action.
- Action
Spec - Canonical, invariant metadata for a single Soma action.
- CliDoc
- Serializable documentation for an action’s CLI surface.
- CliFlag
Doc - Serializable documentation for a single CLI flag.
- CliFlag
Spec - Static specification of a single CLI flag.
- CliSpec
- Static specification of an action’s CLI surface.
- Param
Doc - Serializable documentation for a single action parameter.
- Param
Spec - Static specification of a single action parameter.
- Surface
Availability - Serializable flags describing which surfaces expose an action.
Enums§
- Action
Cost - Relative cost / side-effect hint advertised for an action.
- Action
Error - Top-level error for action parsing and validation.
- Action
Transport - Which transports an action is reachable over.
- Action
Validation Error - Structured validation failures produced while parsing an action request.
- Soma
Action - A parsed, validated action request ready for dispatch.
Constants§
- ACTION_
SPECS - The canonical table of every Soma action and its invariant metadata.
Functions§
- action_
catalog - Builds the serializable action catalog from
ACTION_SPECS. - action_
names - Returns the names of every known action.
- action_
spec - Looks up the
ActionSpecforaction, if it exists. - action_
validation_ error - Extracts an
ActionValidationErrorfrom a boxedanyhow::Error, if present. - cli_
action_ names - Returns the names of actions that expose a CLI surface.
- cli_
commands - Returns the CLI subcommand names for every action that has one.
- is_
known_ action - Returns whether
actionis a known action name. - is_
rest_ action - Returns whether
actionis reachable over REST. - is_
validation_ error - Returns whether
erroris (or wraps) an action validation error. - mcp_
only_ action_ names - Returns the names of actions that are MCP-only.
- require_
confirmation_ if_ destructive - Confirmation gate for destructive actions, shared by every surface.
- required_
scope_ for_ action - Returns the scope required to invoke
action. - rest_
action_ names - Returns the names of actions reachable over REST.
- rest_
help - Builds the JSON help payload describing the REST surface and examples.
Type Aliases§
- Validation
Error - Convenience alias for
ActionValidationError.