weasel API - v0.8.0
    Preparing search index...

    Interface RuleCtx

    Live state read by rule evaluation. Built once per frame on the consuming surface — chrome-caps, the affordance pipeline, the dispatcher's eligibility filter — and discarded.

    Adding a new field is additive: existing rules don't change, new selector atoms can read it.

    interface RuleCtx {
        action: { id: string | null; kind: string | null };
        allowedCapabilities: ReadonlySet<CapabilityTag>;
        device?: DeviceProfile;
        editingAnchors?: boolean;
        focused: boolean;
        hover: NodeId | null;
        mode: string;
        modifiers: ModifierState;
        multiActive: boolean;
        selection: readonly NodeId[];
        selectionResizable?: boolean;
        view: View;
    }
    Index

    Properties

    action: { id: string | null; kind: string | null }
    allowedCapabilities: ReadonlySet<CapabilityTag>

    Capability tags allowed by the active mode (the union of ModeDefinition.allows plus implicit tags). The capability: selector reads this to determine whether a tag is permitted.

    device?: DeviceProfile

    Device facts — pointer coarseness, hover capability, density.

    Absent (legacy ctx builders) is treated as DEFAULT_DEVICE_PROFILE: a fine pointer that can hover, at density 1. That is what the kit assumed before this field existed, so an absent profile is behavior-preserving by construction.

    editingAnchors?: boolean

    Whether a path is currently in anchor-edit mode. Read by the editingAnchors: selector, which gates the path-edit chrome.

    This is deliberately a fact about state, not about permission: the anchor overlay and the anchor hit-test must agree, and the thing they must agree on is "is there an edited path right now", which no capability or mode id answers. A mode that allows edits-anchors with nothing being edited should draw no anchors. Absent is treated as false.

    focused: boolean
    hover: NodeId | null
    mode: string

    Active mode id. 'normal' when no non-default mode is engaged.

    modifiers: ModifierState
    multiActive: boolean
    selection: readonly NodeId[]
    selectionResizable?: boolean

    Whether the current selection may be resized. <SceneCanvas> folds selectTool.resize.resizable over the selection (true only when every selected node is resizable). Read by the resizable: selector to gate selection.resize-handles. Absent (legacy ctx builders) is treated as resizable — back-compat: handles show unless a consumer opts a node out.

    view: View