Skip to main content
Create a plan with new Plan({ initialMessage: "..." }) and post it with thread.post(plan). After posting, use methods like addTask(), updateTask(), and complete() to update it. For parallel steps, pass autoCompletePrevious: false to addTask() and use updateTask({ id }) to update individual tasks.

Constructor

Parameters

Returns

Plan

Properties

symbol
required
Symbol identifying this as a postable object
PlanTask | null
required
Type: PlanTask
string
required
"plan"
required
The kind of object - used by adapters to dispatch
readonly PlanTask[]
required
Type: PlanTask
string
required
string
required

Methods

addTask()

Parameters

Returns

PlanTask

complete()

Parameters

Returns

Promise<void>

getFallbackText()

Get a fallback text representation for adapters that don’t support this object type. This should return a human-readable string representation.

Returns

string

getPostData()

Get the data to send to the adapter

Returns

PlanModel

isSupported()

Check if the adapter supports this object type

Parameters

required

Returns

boolean

onPosted()

Called after successful posting to bind the object to the thread

Parameters

reset()

Parameters

Returns

PlanTask

updateTask()

Parameters

Returns

PlanTask