Persisted definition of an action — the data a SohlAction is built from.

interface Data {
    __kind?: string;
    disabledReason?: string;
    executor: string;
    group: string;
    iconFAClass: string;
    minActorOwnership: number;
    recordsLastRun?: boolean;
    scope: string;
    shortcode: string;
    subType: KindValue;
    title: string;
    trigger: string;
    visible: string;
}

Hierarchy (View Summary)

Properties

__kind?: string

Discriminator kind, written on serialization (SohlEntity.toJSON) and read back on revival. Optional as constructor input — it is derived from the concrete class, not supplied by callers.

disabledReason?: string

i18n key explaining why the action is refused while its SohlAction.Data.trigger is false, surfaced as sohl.entity.action.SohlAction.unavailableReason (issue #1135) — e.g. a gear action gated on the item being carried says so rather than leaving the user with a control that does nothing. Optional; a generic reason (sohl.entity.action.SohlAction.DEFAULT_DISABLED_REASON) is used when omitted.

Code-authored only — like recordsLastRun it is set by defineIntrinsicActions (or the gate that wraps it) and is not part of the persisted actionDefs schema.

executor: string

Reference to the code that performs the action — never inline code. For an intrinsic action, the name of a method on the scoped target logic; for a Script action, the UUID of a Foundry Macro.

group: string

Context menu group for sorting this action

iconFAClass: string

FontAwesome CSS class for the action's icon

minActorOwnership: number

Minimum Foundry document-ownership level (matching CONST.DOCUMENT_OWNERSHIP_LEVELS) the current user must hold on the action's parent actor to execute it. GMs always pass. Only enforced for Script actions; Intrinsic actions run for any user (lifecycle calls must work everywhere).

recordsLastRun?: boolean

When true, SohlAction.execute stamps this document's system.lastRun[shortcode] with the current world time each time the action performs (issue #579) — a generic run record, no bespoke field. Set it on actions where "when did this last happen here?" is worth answering; omit for trivial/UI actions so they don't force a write.

It belongs on the action that acts. In a Check/Test pair (#1181) that is the *Test: a *Check only posts a card offering the test, so recording it there would claim the effect happened on the strength of an offer nobody answered (#1192). Optional; defaults to off.

scope: string

Execution context: Self, Parent Item, or Owning Actor

shortcode: string

Unique code for this action on a given Logic instance.

subType: KindValue

Whether this is an intrinsic or custom action

title: string

Display title for this action

trigger: string

sohl.entity.expr.SafeExpression determining whether an action may be executed. Note that this layers with visible; this determines whether the action can be invoked regardless of whether it is visible in the UI.

visible: string

sohl.entity.expr.SafeExpression determining whether this action appears in the UI