photon_platform.clerk.actions¶
Declarative context-aware Action Registry and ecosystem tool adapters for Clerk.
Submodules¶
Attributes¶
Classes¶
Central registry of context-aware actions shared by CLI, Web UI, and MCP. |
|
Structured JSON-serializable output returned by every Clerk action. |
|
Declarative specification for one context-aware Clerk action. |
Functions¶
|
Return the process-wide default |
Package Contents¶
- class photon_platform.clerk.actions.ActionRegistry¶
Central registry of context-aware actions shared by CLI, Web UI, and MCP.
- register(spec: ActionSpec) None¶
Register or replace an
ActionSpecby its uniqueid.
- get(action_id: str) ActionSpec | None¶
Look up an action by
action_id.
- list_all() list[ActionSpec]¶
Return all registered actions sorted by category and id.
- list_for_context(ctx: photon_platform.clerk.context.Context, *, include_interactive: bool = True) list[ActionSpec]¶
Return all actions valid at
ctxsorted by category and id.
- execute(ctx: photon_platform.clerk.context.Context, action_id: str, params: dict[str, Any] | None = None, *, dry_run: bool = False, allow_interactive: bool = True) ActionResult¶
Validate and execute a registered action against
ctx.- Parameters:
ctx – Resolved
Contextfor the target path.action_id – Registered action identifier (e.g.
"publish.build").params – Optional parameter dictionary matching
spec.input_schema.dry_run – Request dry-run execution when supported by the action.
allow_interactive – Reject
interactiveGUI actions whenFalse(e.g. MCP).
- Returns:
Structured
ActionResult.
- class photon_platform.clerk.actions.ActionResult¶
Structured JSON-serializable output returned by every Clerk action.
- photon_platform.clerk.actions.ActionSafety¶
- class photon_platform.clerk.actions.ActionSpec¶
Declarative specification for one context-aware Clerk action.
- handler: ActionHandler¶
- safety: ActionSafety = 'read'¶
- applies_to(ctx: photon_platform.clerk.context.Context) bool¶
Return whether this action is valid for the given
Context.
- photon_platform.clerk.actions.get_default_registry() ActionRegistry¶
Return the process-wide default
ActionRegistrypopulated with built-ins and adapters.