AbstractAbstractcreateCreates a new thread in the Plot system.
The thread will be automatically assigned an ID and author information based on the current execution context. All other fields from NewThread will be preserved in the created thread.
The thread data to create
Promise resolving to the created thread's ID
AbstractcreateCreates multiple threads in a single batch operation.
This method efficiently creates multiple threads at once, which is more performant than calling createThread() multiple times individually. All threads are created with the same author and access control rules.
Array of thread data to create
Promise resolving to array of created thread IDs
AbstractupdateUpdates an existing thread in the Plot system.
Important: This method only updates existing threads. It will throw an error
if the thread does not exist. Use createThread() to create or update (upsert)
threads.
Only the fields provided in the update object will be modified - all other fields remain unchanged. This enables partial updates without needing to fetch and resend the entire thread object.
For tags, provide a Record<number, boolean> where true adds a tag and false removes it. Tags not included in the update remain unchanged.
When updating the parent, the thread's path will be automatically recalculated to maintain the correct hierarchical structure.
Scheduling is handled separately via createSchedule() / updateSchedule().
The thread update containing the ID or source and fields to change
Promise that resolves when the update is complete
AbstractgetRetrieves all notes within a thread.
Notes are detailed entries within a thread, ordered by creation time. Each note can contain markdown content, actions, and other detailed information related to the parent thread.
The thread whose notes to retrieve
Promise resolving to array of notes in the thread
AbstractcreateCreates a new note in a thread.
Notes provide detailed content within a thread, supporting markdown, actions, and other rich content. The note will be automatically assigned an ID and author information based on the current execution context.
The note data to create
Promise resolving to the created note's ID
// Create a note with content
await this.plot.createNote({
thread: { id: "thread-123" },
note: "Discussion notes from the meeting...",
contentType: "markdown"
});
// Create a note with actions
await this.plot.createNote({
thread: { id: "thread-456" },
note: "Meeting recording available",
actions: [{
type: ActionType.external,
title: "View Recording",
url: "https://example.com/recording"
}]
});
AbstractcreateCreates multiple notes in a single batch operation.
This method efficiently creates multiple notes at once, which is more performant than calling createNote() multiple times individually. All notes are created with the same author and access control rules.
Array of note data to create
Promise resolving to array of created note IDs
AbstractupdateUpdates an existing note in the Plot system.
Important: This method only updates existing notes. It will throw an error
if the note does not exist. Use createNote() to create or update (upsert) notes.
Only the fields provided in the update object will be modified - all other fields remain unchanged. This enables partial updates without needing to fetch and resend the entire note object.
The note update containing the ID or key and fields to change
Promise that resolves when the update is complete
AbstractgetRetrieves a thread by ID or source.
This method enables lookup of threads either by their unique ID or by their source identifier (canonical URL from an external system). Archived threads are included in the results.
Thread lookup by ID or source
Promise resolving to the matching thread or null if not found
AbstractgetRetrieves a note by ID or key.
This method enables lookup of notes either by their unique ID or by their key (unique identifier within the thread). Archived notes are included in the results.
Note lookup by ID or key
Promise resolving to the matching note or null if not found
AbstractcreateCreates a new priority in the Plot system.
Priorities serve as organizational containers for threads and twists. The created priority will be automatically assigned a unique ID.
The priority data to create
Promise resolving to the complete created priority
AbstractgetAbstractupdateUpdates an existing priority in the Plot system.
The priority is identified by either its ID or key. Only the fields specified in the update will be changed.
Priority update containing ID/key and fields to change
Promise that resolves when the update is complete
AbstractgetAbstractgetReturns the full Actor for the user who installed this twist. Useful for per-user operations like schedule creation, or when the owner's name or email is needed.
AbstractgetReturns the user ID (twist_instance.owner_id) that installed this
twist. This is the same value exposed on Twist via this.userId.
AbstractgetReturns the owner user's root priority ID. Used as the implicit default
when an operation needs a priority but the caller didn't supply one —
for example, plot.createPriority() without a parent, or
plot.getThreads() without an explicit priorityId.
On the server, priority resolution for newly created threads/links
happens automatically via match_priority_for_user; twists rarely need
to call this directly.
AbstractcreateCreates a new schedule for a thread.
Schedules define when a thread occurs in time. A thread can have multiple schedules (shared and per-user).
The schedule data to create
Promise resolving to the created schedule
AbstractgetAbstractgetRetrieves links from connected source channels.
Requires link: true in Plot options.
Optionalfilter: LinkFilterOptional filter criteria for links
Promise resolving to array of links with their notes
AbstractsearchSearches notes and links using semantic similarity.
Requires search: true in Plot options.
The search query text
Optionaloptions: SearchOptionsOptional search configuration
Promise resolving to array of search results ordered by similarity
AbstractgetLists threads owned by the twist's user.
Requires ThreadAccess.Full.
Optionaloptions: {Query options for filtering threads
OptionalpriorityId?: UuidPriority to list threads from. Must be owned by the twist owner. When omitted, defaults to the owner's root priority.
OptionalincludeDescendants?: booleanInclude threads from descendant priorities. Default: true.
OptionalincludeArchived?: booleanInclude archived threads. Default: false.
Optionallimit?: numberMaximum number of threads to return. Default: 50, max: 200.
Optionaloffset?: numberNumber of threads to skip for pagination. Default: 0.
Promise resolving to array of threads
AbstractgetLists priorities owned by the twist's user.
Requires PriorityAccess.Full.
Optionaloptions: { parentId?: Uuid; includeDescendants?: boolean; includeArchived?: boolean }Query options for filtering priorities
OptionalparentId?: UuidParent priority to list children of. Must be owned by the twist owner. When omitted, defaults to the owner's root priority.
OptionalincludeDescendants?: booleanInclude all descendants, not just direct children. Default: false.
OptionalincludeArchived?: booleanInclude archived priorities. Default: false.
Promise resolving to array of priorities
AbstractupdateUpdates a link.
Requires LinkAccess.Full. Set threadId to move the link to a different thread.
The link update containing the ID and fields to change
Promise that resolves when the update is complete
AbstractcreateCreates a plan of operations for user approval.
Returns an Action that can be attached to a note. The user can approve, deny, or request changes. On approval, operations are executed by the API.
Requires requireApproval: true in Plot options.
Plan configuration
Human-readable title summarizing the plan
Array of operations to execute on approval
Callback invoked with (action, approved: boolean) when the user responds
An Action of type plan to attach to a note
Static ReadonlyOptionsConfiguration options for the Plot tool.
Important: All permissions must be explicitly requested. There are no default permissions.
Optionalthread?: { access?: ThreadAccess; defaultMention?: boolean }Optionalaccess?: ThreadAccessCapability to create Notes and modify tags. Must be explicitly set to grant permissions.
OptionaldefaultMention?: booleanWhen true, auto-mention this twist on new notes in threads where it authored content.
Optionalnote?: { defaultMention?: boolean; intents?: NoteIntentHandler[] }OptionaldefaultMention?: booleanWhen true, auto-mention this twist on new notes in threads where it was @-mentioned.
Optionalintents?: NoteIntentHandler[]Respond to mentions in notes.
When a note mentions this twist, the system will match the note content against these intents and call the matching handler.
intents: [{
description: "Schedule or reschedule calendar events",
examples: ["Schedule a meeting tomorrow at 2pm", "Move my 3pm meeting to 4pm"],
handler: this.onSchedulingRequest
}, {
description: "Find available meeting times",
examples: ["When am I free this week?", "Find time for a 1 hour meeting"],
handler: this.onAvailabilityRequest
}]
Optionallink?: true | { access?: LinkAccess }Enable link processing from connected source channels.
Optionalpriority?: { access?: PriorityAccess }Optionalcontact?: { access?: Read }Optionalsearch?: trueEnable semantic search across notes and links owned by the twist's user.
OptionalrequireApproval?: booleanWhen true, admin write operations (on threads/notes/links/priorities not created by this twist) require user approval via plan actions instead of executing immediately. Read operations and operations on the twist's own content still work directly.
// Minimal configuration with required permissions
build(build: ToolBuilder) {
return {
plot: build(Plot, {
thread: {
access: ThreadAccess.Create
}
})
};
}
// Full configuration with callbacks
build(build: ToolBuilder) {
return {
plot: build(Plot, {
thread: {
access: ThreadAccess.Create,
},
note: {
intents: [{
description: "Schedule meetings",
examples: ["Schedule a meeting tomorrow"],
handler: this.onSchedulingIntent
}],
},
link: true,
priority: {
access: PriorityAccess.Full
},
contact: {
access: ContactAccess.Read
}
})
};
}
Built-in tool for interacting with the core Plot data layer.
The Plot tool provides twists with the ability to create and manage threads, priorities, and contacts within the Plot system. This is the primary interface for twists to persist data and interact with the Plot database.
Example