Creating Plot Twists
    Preparing search index...

    Type Alias NewActivity

    NewActivity: Pick<Activity, "type"> & Partial<
        Omit<
            Activity,
            "id"
            | "author"
            | "type"
            | "parent"
            | "priority"
            | "threadRoot",
        > & { parent?: Pick<Activity, "id"> | null; noteType?: NoteType },
    > & (
        | { priority: Pick<Priority, "id"> }
        | { pickPriority?: PickPriorityConfig }
        | {}
    )

    Type for creating new activities.

    Requires only the activity type, with all other fields optional. The ID and author will be automatically assigned by the Plot system based on the current execution context.

    Priority can be specified in three ways:

    1. Explicit priority: priority: { id: "..." } - Use specific priority (disables pickPriority)
    2. Pick priority config: pickPriority: { ... } - Auto-select based on similarity
    3. Neither: Defaults to pickPriority: { content: true } for automatic matching

    Type Declaration

    • { priority: Pick<Priority, "id"> }
      • priority: Pick<Priority, "id">

        Explicit priority (required when specified) - disables automatic priority matching

    • { pickPriority?: PickPriorityConfig }
      • OptionalpickPriority?: PickPriorityConfig

        Configuration for automatic priority selection based on similarity

    • {}
    // Explicit priority (disables automatic matching)
    const newTask: NewActivity = {
    type: ActivityType.Task,
    title: "Review pull request",
    priority: { id: "work-project-123" }
    };

    // Automatic priority matching (default behavior)
    const newNote: NewActivity = {
    type: ActivityType.Note,
    title: "Meeting notes",
    note: "Discussed Q4 roadmap..."
    // Defaults to pickPriority: { content: true }
    };

    // Custom priority matching
    const newEvent: NewActivity = {
    type: ActivityType.Event,
    title: "Team standup",
    pickPriority: { type: true, content: 50 }
    };