Creating Plot Twists
    Preparing search index...

    Type Alias Activity

    Represents a complete activity within the Plot system.

    Activities are the core entities in Plot, representing anything from simple notes to complex recurring events. They support rich metadata including scheduling, recurrence patterns, links, and external source tracking.

    // Simple note
    const task: Activity = {
    type: ActivityType.Note,
    title: "New campaign brainstorming ideas",
    note: "We could rent a bouncy castle...",
    author: { id: "user-1", name: "John Doe", type: ActorType.User },
    priority: { id: "work", title: "Work" },
    // ... other fields
    };

    // Simple task
    const task: Activity = {
    type: ActivityType.Task,
    title: "Review budget proposal",
    author: { id: "user-1", name: "John Doe", type: ActorType.User },
    end: null,
    priority: { id: "work", title: "Work" },
    // ... other fields
    };

    // Recurring event
    const meeting: Activity = {
    type: ActivityType.Event,
    title: "Weekly standup",
    recurrenceRule: "FREQ=WEEKLY;BYDAY=MO",
    recurrenceCount: 12,
    // ... other fields
    };
    type Activity = {
        id: string;
        type: ActivityType;
        author: Actor;
        title: string | null;
        note: string | null;
        start: Date | string | null;
        end: Date | string | null;
        recurrenceUntil: Date | string | null;
        recurrenceCount: number | null;
        doneAt: Date | null;
        parent: Activity | null;
        threadRoot?: Activity;
        links: ActivityLink[] | null;
        priority: Priority;
        recurrenceRule: string | null;
        recurrenceExdates: Date[] | null;
        recurrenceDates: Date[] | null;
        recurrence: Activity | null;
        occurrence: Date | null;
        meta: ActivityMeta | null;
        tags: Partial<Record<Tag, ActorId[]>> | null;
        mentions: ActorId[] | null;
    }
    Index

    Properties

    id: string

    Unique identifier for the activity

    The type of activity (Note, Task, or Event)

    author: Actor

    Information about who created the activity

    title: string | null

    The display title/summary of the activity

    note: string | null

    Primary content for the activity

    start: Date | string | null

    Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times. For recurring events, this represents the start of the first occurrence. Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events. Null for activities without scheduled start times.

    end: Date | string | null

    End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times. For recurring events, this represents the end of the first occurrence. Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events. Null for tasks or activities without defined end times.

    recurrenceUntil: Date | string | null

    For recurring activities, the last occurrence date (inclusive). Can be a Date object, date string in "YYYY-MM-DD" format, or null if recurring indefinitely. When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.

    recurrenceCount: number | null

    For recurring activities, the number of occurrences to generate. Takes precedence over recurrenceUntil if both are provided. Null for non-recurring activities or indefinite recurrence.

    doneAt: Date | null

    Timestamp when the activity was marked as complete. Null if not completed.

    parent: Activity | null

    Reference to a parent activity for creating hierarchical relationships

    threadRoot?: Activity

    For nested activities in a thread, references the top-level activity of that thread

    links: ActivityLink[] | null

    Array of interactive links attached to the activity

    priority: Priority

    The priority context this activity belongs to

    recurrenceRule: string | null

    Recurrence rule in RFC 5545 RRULE format (e.g., "FREQ=WEEKLY;BYDAY=MO,WE,FR")

    recurrenceExdates: Date[] | null

    Array of dates to exclude from the recurrence pattern

    recurrenceDates: Date[] | null

    Array of additional occurrence dates to include in the recurrence pattern

    recurrence: Activity | null

    For recurring event exceptions, points to the root recurring activity. Used when an individual occurrence of a recurring event is modified.

    occurrence: Date | null

    For recurring event exceptions, the original occurrence date being overridden. Used to identify which occurrence of a recurring event this exception replaces.

    meta: ActivityMeta | null

    Metadata about the activity, typically from an external system that created it

    tags: Partial<Record<Tag, ActorId[]>> | null

    Tags attached to this activity. Maps tag ID to array of actor IDs who added that tag.

    mentions: ActorId[] | null

    Array of actor IDs (users, contacts, or twists) mentioned in this activity via @-mentions