Skip to main content

Module actions

Module actions 

Source
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§

ActionDoc
Serializable, catalog-facing documentation for a single action.
ActionSpec
Canonical, invariant metadata for a single Soma action.
CliDoc
Serializable documentation for an action’s CLI surface.
CliFlagDoc
Serializable documentation for a single CLI flag.
CliFlagSpec
Static specification of a single CLI flag.
CliSpec
Static specification of an action’s CLI surface.
ParamDoc
Serializable documentation for a single action parameter.
ParamSpec
Static specification of a single action parameter.
SurfaceAvailability
Serializable flags describing which surfaces expose an action.

Enums§

ActionCost
Relative cost / side-effect hint advertised for an action.
ActionError
Top-level error for action parsing and validation.
ActionTransport
Which transports an action is reachable over.
ActionValidationError
Structured validation failures produced while parsing an action request.
SomaAction
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 ActionSpec for action, if it exists.
action_validation_error
Extracts an ActionValidationError from a boxed anyhow::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 action is a known action name.
is_rest_action
Returns whether action is reachable over REST.
is_validation_error
Returns whether error is (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§

ValidationError
Convenience alias for ActionValidationError.