@plotday/twister 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/bin/commands/create.js +37 -3
- package/bin/commands/create.js.map +1 -1
- package/bin/commands/deploy.js +4 -0
- package/bin/commands/deploy.js.map +1 -1
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/templates/AGENTS.template.md +188 -271
- package/bin/templates/README.template.md +2 -23
- package/cli/templates/AGENTS.template.md +188 -271
- package/cli/templates/README.template.md +2 -23
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/index.Options.html +10 -0
- package/dist/docs/classes/index.Source.html +184 -0
- package/dist/docs/classes/tool.ITool.html +1 -1
- package/dist/docs/classes/tool.Tool.html +21 -21
- package/dist/docs/classes/tools_ai.AI.html +1 -1
- package/dist/docs/classes/tools_callbacks.Callbacks.html +2 -2
- package/dist/docs/classes/tools_integrations.Integrations.html +38 -16
- package/dist/docs/classes/tools_network.Network.html +1 -1
- package/dist/docs/classes/tools_plot.Plot.html +86 -60
- package/dist/docs/classes/tools_store.Store.html +1 -1
- package/dist/docs/classes/tools_tasks.Tasks.html +1 -1
- package/dist/docs/classes/tools_twists.Twists.html +1 -1
- package/dist/docs/classes/twist.Twist.html +42 -10
- package/dist/docs/documents/Building_Sources.html +137 -0
- package/dist/docs/documents/Built-in_Tools.html +11 -2
- package/dist/docs/documents/Core_Concepts.html +5 -10
- package/dist/docs/documents/Getting_Started.html +1 -1
- package/dist/docs/enums/{plot.ActivityLinkType.html → plot.ActionType.html} +8 -8
- package/dist/docs/enums/plot.ActorType.html +7 -7
- package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
- package/dist/docs/enums/plot.ThemeColor.html +9 -9
- package/dist/docs/enums/tag.Tag.html +3 -10
- package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
- package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
- package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
- package/dist/docs/enums/{tools_plot.ActivityAccess.html → tools_plot.ThreadAccess.html} +6 -6
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +5 -6
- package/dist/docs/interfaces/utils_types.ToolShed.html +5 -5
- package/dist/docs/media/AGENTS.md +910 -0
- package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
- package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/plot.html +1 -1
- package/dist/docs/modules/tool.html +1 -1
- package/dist/docs/modules/tools_integrations.html +1 -1
- package/dist/docs/modules/tools_plot.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/index.BooleanDef.html +7 -0
- package/dist/docs/types/index.NewSchedule.html +33 -0
- package/dist/docs/types/index.NewScheduleContact.html +5 -0
- package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
- package/dist/docs/types/index.NumberDef.html +9 -0
- package/dist/docs/types/index.OptionDef.html +2 -0
- package/dist/docs/types/index.OptionsSchema.html +3 -0
- package/dist/docs/types/index.ResolvedOptions.html +4 -0
- package/dist/docs/types/index.Schedule.html +37 -0
- package/dist/docs/types/index.ScheduleContact.html +5 -0
- package/dist/docs/types/index.ScheduleContactRole.html +1 -0
- package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
- package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
- package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
- package/dist/docs/types/index.SelectDef.html +8 -0
- package/dist/docs/types/index.TextDef.html +8 -0
- package/dist/docs/types/plot.Action.html +26 -0
- package/dist/docs/types/plot.Actor.html +6 -6
- package/dist/docs/types/plot.ActorId.html +1 -1
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.Link.html +36 -0
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +5 -5
- package/dist/docs/types/plot.NewLink.html +26 -0
- package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
- package/dist/docs/types/plot.NewNote.html +10 -10
- package/dist/docs/types/plot.NewPriority.html +1 -1
- package/dist/docs/types/plot.NewTags.html +1 -1
- package/dist/docs/types/plot.NewThread.html +27 -0
- package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
- package/dist/docs/types/plot.Note.html +9 -8
- package/dist/docs/types/plot.NoteUpdate.html +2 -2
- package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
- package/dist/docs/types/plot.Priority.html +6 -6
- package/dist/docs/types/plot.PriorityUpdate.html +1 -1
- package/dist/docs/types/plot.Tags.html +1 -1
- package/dist/docs/types/plot.Thread.html +1 -0
- package/dist/docs/types/plot.ThreadCommon.html +17 -0
- package/dist/docs/types/plot.ThreadFilter.html +2 -0
- package/dist/docs/types/plot.ThreadMeta.html +11 -0
- package/dist/docs/types/plot.ThreadUpdate.html +3 -0
- package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
- package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
- package/dist/docs/types/tools_integrations.Authorization.html +4 -4
- package/dist/docs/types/tools_integrations.Channel.html +11 -0
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
- package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
- package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
- package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
- package/dist/docs/types/utils_types.BuiltInTools.html +2 -2
- package/dist/docs/types/utils_types.ExtractBuildReturn.html +1 -1
- package/dist/docs/types/utils_types.InferOptions.html +1 -1
- package/dist/docs/types/utils_types.InferTools.html +1 -1
- package/dist/docs/types/utils_types.JSONValue.html +1 -1
- package/dist/docs/types/utils_types.PromiseValues.html +1 -1
- package/dist/docs/types/utils_types.ToolBuilder.html +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/llm-docs/index.d.ts.map +1 -1
- package/dist/llm-docs/index.js +6 -8
- package/dist/llm-docs/index.js.map +1 -1
- package/dist/llm-docs/options.d.ts +9 -0
- package/dist/llm-docs/options.d.ts.map +1 -0
- package/dist/llm-docs/options.js +8 -0
- package/dist/llm-docs/options.js.map +1 -0
- package/dist/llm-docs/plot.d.ts +1 -1
- package/dist/llm-docs/plot.d.ts.map +1 -1
- package/dist/llm-docs/plot.js +1 -1
- package/dist/llm-docs/plot.js.map +1 -1
- package/dist/llm-docs/schedule.d.ts +9 -0
- package/dist/llm-docs/schedule.d.ts.map +1 -0
- package/dist/llm-docs/schedule.js +8 -0
- package/dist/llm-docs/schedule.js.map +1 -0
- package/dist/llm-docs/source.d.ts +9 -0
- package/dist/llm-docs/source.d.ts.map +1 -0
- package/dist/llm-docs/source.js +8 -0
- package/dist/llm-docs/source.js.map +1 -0
- package/dist/llm-docs/tag.d.ts +1 -1
- package/dist/llm-docs/tag.d.ts.map +1 -1
- package/dist/llm-docs/tag.js +1 -1
- package/dist/llm-docs/tag.js.map +1 -1
- package/dist/llm-docs/tool.d.ts +1 -1
- package/dist/llm-docs/tool.d.ts.map +1 -1
- package/dist/llm-docs/tool.js +1 -1
- package/dist/llm-docs/tool.js.map +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
- package/dist/llm-docs/tools/callbacks.js +1 -1
- package/dist/llm-docs/tools/callbacks.js.map +1 -1
- package/dist/llm-docs/tools/integrations.d.ts +1 -1
- package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
- package/dist/llm-docs/tools/integrations.js +1 -1
- package/dist/llm-docs/tools/integrations.js.map +1 -1
- package/dist/llm-docs/tools/plot.d.ts +1 -1
- package/dist/llm-docs/tools/plot.d.ts.map +1 -1
- package/dist/llm-docs/tools/plot.js +1 -1
- package/dist/llm-docs/tools/plot.js.map +1 -1
- package/dist/llm-docs/tools/twists.d.ts +1 -1
- package/dist/llm-docs/tools/twists.d.ts.map +1 -1
- package/dist/llm-docs/tools/twists.js +1 -1
- package/dist/llm-docs/tools/twists.js.map +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
- package/dist/llm-docs/twist-guide-template.js +1 -1
- package/dist/llm-docs/twist-guide-template.js.map +1 -1
- package/dist/llm-docs/twist.d.ts +1 -1
- package/dist/llm-docs/twist.d.ts.map +1 -1
- package/dist/llm-docs/twist.js +1 -1
- package/dist/llm-docs/twist.js.map +1 -1
- package/dist/options.d.ts +104 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +40 -0
- package/dist/options.js.map +1 -0
- package/dist/plot.d.ts +254 -588
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js +16 -49
- package/dist/plot.js.map +1 -1
- package/dist/schedule.d.ts +172 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/schedule.js +2 -0
- package/dist/schedule.js.map +1 -0
- package/dist/source.d.ts +133 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +116 -0
- package/dist/source.js.map +1 -0
- package/dist/tag.d.ts +3 -10
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +2 -11
- package/dist/tag.js.map +1 -1
- package/dist/tool.d.ts +1 -15
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js.map +1 -1
- package/dist/tools/callbacks.d.ts +1 -1
- package/dist/tools/callbacks.js +1 -1
- package/dist/tools/integrations.d.ts +107 -50
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +23 -22
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/plot.d.ts +133 -117
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js +19 -21
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/twists.d.ts +1 -1
- package/dist/twist-guide.d.ts +1 -1
- package/dist/twist-guide.d.ts.map +1 -1
- package/dist/twist.d.ts +66 -11
- package/dist/twist.d.ts.map +1 -1
- package/dist/twist.js +79 -10
- package/dist/twist.js.map +1 -1
- package/dist/utils/types.d.ts +5 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +16 -41
- package/dist/common/calendar.d.ts +0 -135
- package/dist/common/calendar.d.ts.map +0 -1
- package/dist/common/calendar.js +0 -2
- package/dist/common/calendar.js.map +0 -1
- package/dist/common/documents.d.ts +0 -122
- package/dist/common/documents.d.ts.map +0 -1
- package/dist/common/documents.js +0 -2
- package/dist/common/documents.js.map +0 -1
- package/dist/common/messaging.d.ts +0 -84
- package/dist/common/messaging.d.ts.map +0 -1
- package/dist/common/messaging.js +0 -2
- package/dist/common/messaging.js.map +0 -1
- package/dist/common/projects.d.ts +0 -112
- package/dist/common/projects.d.ts.map +0 -1
- package/dist/common/projects.js +0 -2
- package/dist/common/projects.js.map +0 -1
- package/dist/docs/documents/Building_Custom_Tools.html +0 -215
- package/dist/docs/enums/plot.ActivityKind.html +0 -14
- package/dist/docs/enums/plot.ActivityType.html +0 -10
- package/dist/docs/modules/common_calendar.html +0 -1
- package/dist/docs/types/common_calendar.Calendar.html +0 -13
- package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
- package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
- package/dist/docs/types/plot.Activity.html +0 -2
- package/dist/docs/types/plot.ActivityCommon.html +0 -20
- package/dist/docs/types/plot.ActivityFilter.html +0 -3
- package/dist/docs/types/plot.ActivityLink.html +0 -26
- package/dist/docs/types/plot.ActivityMeta.html +0 -11
- package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
- package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
- package/dist/docs/types/plot.NewActivity.html +0 -81
- package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
- package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
- package/dist/docs/types/tool.SyncToolOptions.html +0 -9
- package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
- package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
- package/dist/docs/types/tools_integrations.Syncable.html +0 -7
- package/dist/llm-docs/common/calendar.d.ts +0 -9
- package/dist/llm-docs/common/calendar.d.ts.map +0 -1
- package/dist/llm-docs/common/calendar.js +0 -8
- package/dist/llm-docs/common/calendar.js.map +0 -1
- package/dist/llm-docs/common/documents.d.ts +0 -9
- package/dist/llm-docs/common/documents.d.ts.map +0 -1
- package/dist/llm-docs/common/documents.js +0 -8
- package/dist/llm-docs/common/documents.js.map +0 -1
- package/dist/llm-docs/common/messaging.d.ts +0 -9
- package/dist/llm-docs/common/messaging.d.ts.map +0 -1
- package/dist/llm-docs/common/messaging.js +0 -8
- package/dist/llm-docs/common/messaging.js.map +0 -1
- package/dist/llm-docs/common/projects.d.ts +0 -9
- package/dist/llm-docs/common/projects.d.ts.map +0 -1
- package/dist/llm-docs/common/projects.js +0 -8
- package/dist/llm-docs/common/projects.js.map +0 -1
package/dist/plot.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NewSchedule, NewScheduleOccurrence, Schedule } from "./schedule";
|
|
1
2
|
import { type Tag } from "./tag";
|
|
2
3
|
import { type Callback } from "./tools/callbacks";
|
|
3
4
|
import { type AuthProvider } from "./tools/integrations";
|
|
@@ -9,15 +10,15 @@ export { type JSONValue } from "./utils/types";
|
|
|
9
10
|
export { type AuthProvider } from "./tools/integrations";
|
|
10
11
|
/**
|
|
11
12
|
* @fileoverview
|
|
12
|
-
* Core Plot entity types for working with
|
|
13
|
+
* Core Plot entity types for working with threads, notes, priorities, and contacts.
|
|
13
14
|
*
|
|
14
15
|
* ## Type Pattern: Null vs Undefined Semantics
|
|
15
16
|
*
|
|
16
17
|
* Plot entity types use a consistent pattern to distinguish between missing, unset, and explicitly cleared values:
|
|
17
18
|
*
|
|
18
|
-
* ### Entity Types (
|
|
19
|
+
* ### Entity Types (Thread, Priority, Note, Actor)
|
|
19
20
|
* - **Required fields**: No `?`, cannot be `undefined`
|
|
20
|
-
* - Example: `id: Uuid`, `
|
|
21
|
+
* - Example: `id: Uuid`, `title: string`
|
|
21
22
|
* - **Nullable fields**: Use `| null` to allow explicit clearing
|
|
22
23
|
* - Example: `assignee: ActorId | null`, `done: Date | null`
|
|
23
24
|
* - `null` = field is explicitly unset/cleared
|
|
@@ -28,10 +29,10 @@ export { type AuthProvider } from "./tools/integrations";
|
|
|
28
29
|
* - `null` = field included but not set
|
|
29
30
|
* - Value = field has a value
|
|
30
31
|
*
|
|
31
|
-
* ### New* Types (
|
|
32
|
+
* ### New* Types (NewThread, NewNote, NewPriority)
|
|
32
33
|
* Used for creating or updating entities. Support partial updates by distinguishing omitted vs cleared fields:
|
|
33
34
|
* - **Required fields**: Must be provided (no `?`)
|
|
34
|
-
* - Example: `
|
|
35
|
+
* - Example: `title: string` in NewPriority
|
|
35
36
|
* - **Optional fields**: Use `?` to make them optional
|
|
36
37
|
* - Example: `title?: string`, `author?: NewActor`
|
|
37
38
|
* - `undefined` (omitted) = don't set/update this field
|
|
@@ -49,20 +50,15 @@ export { type AuthProvider } from "./tools/integrations";
|
|
|
49
50
|
*
|
|
50
51
|
* @example
|
|
51
52
|
* ```typescript
|
|
52
|
-
* // Creating a new
|
|
53
|
-
* const
|
|
54
|
-
*
|
|
55
|
-
* title: "Review PR", // Optional, provided
|
|
56
|
-
* assignee: null, // Optional nullable, explicitly clearing
|
|
57
|
-
* // priority is omitted (undefined), will auto-select or use default
|
|
53
|
+
* // Creating a new thread
|
|
54
|
+
* const newThread: NewThread = {
|
|
55
|
+
* title: "Review pull request",
|
|
58
56
|
* };
|
|
59
57
|
*
|
|
60
|
-
* // Updating
|
|
61
|
-
* const update:
|
|
62
|
-
* id:
|
|
63
|
-
*
|
|
64
|
-
* assignee: null, // Clear assignee
|
|
65
|
-
* // title is omitted, won't be changed
|
|
58
|
+
* // Updating a thread - only change what's specified
|
|
59
|
+
* const update: ThreadUpdate = {
|
|
60
|
+
* id: threadId,
|
|
61
|
+
* archived: true,
|
|
66
62
|
* };
|
|
67
63
|
* ```
|
|
68
64
|
*/
|
|
@@ -161,48 +157,17 @@ export type PriorityUpdate = ({
|
|
|
161
157
|
key: string;
|
|
162
158
|
}) & Partial<Pick<Priority, "title" | "archived">>;
|
|
163
159
|
/**
|
|
164
|
-
* Enumeration of supported
|
|
160
|
+
* Enumeration of supported action types.
|
|
165
161
|
*
|
|
166
|
-
*
|
|
167
|
-
* within the Plot application.
|
|
168
|
-
*/
|
|
169
|
-
export declare enum ActivityType {
|
|
170
|
-
/** A note or piece of information without actionable requirements */
|
|
171
|
-
Note = 0,
|
|
172
|
-
/** An actionable item that can be completed */
|
|
173
|
-
Action = 1,
|
|
174
|
-
/** A scheduled occurrence with start and optional end time */
|
|
175
|
-
Event = 2
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Kinds of activities. Used only for visual categorization (icon).
|
|
179
|
-
*/
|
|
180
|
-
export declare enum ActivityKind {
|
|
181
|
-
document = "document",// any external document or item in an external system
|
|
182
|
-
messages = "messages",// emails and chat threads
|
|
183
|
-
meeting = "meeting",// in-person meeting
|
|
184
|
-
videoconference = "videoconference",
|
|
185
|
-
phone = "phone",
|
|
186
|
-
focus = "focus",
|
|
187
|
-
meal = "meal",
|
|
188
|
-
exercise = "exercise",
|
|
189
|
-
family = "family",
|
|
190
|
-
travel = "travel",
|
|
191
|
-
social = "social",
|
|
192
|
-
entertainment = "entertainment"
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Enumeration of supported activity link types.
|
|
196
|
-
*
|
|
197
|
-
* Different link types have different behaviors when clicked by users
|
|
162
|
+
* Different action types have different behaviors when clicked by users
|
|
198
163
|
* and may require different rendering approaches.
|
|
199
164
|
*/
|
|
200
|
-
export declare enum
|
|
165
|
+
export declare enum ActionType {
|
|
201
166
|
/** External web links that open in browser */
|
|
202
167
|
external = "external",
|
|
203
168
|
/** Authentication flows for connecting services */
|
|
204
169
|
auth = "auth",
|
|
205
|
-
/** Callback
|
|
170
|
+
/** Callback actions that trigger twist methods when clicked */
|
|
206
171
|
callback = "callback",
|
|
207
172
|
/** Video conferencing links with provider-specific handling */
|
|
208
173
|
conferencing = "conferencing",
|
|
@@ -228,61 +193,61 @@ export declare enum ConferencingProvider {
|
|
|
228
193
|
other = "other"
|
|
229
194
|
}
|
|
230
195
|
/**
|
|
231
|
-
* Represents a clickable
|
|
196
|
+
* Represents a clickable action attached to a thread.
|
|
232
197
|
*
|
|
233
|
-
*
|
|
234
|
-
* Different
|
|
198
|
+
* Thread actions are rendered as buttons that enable user interaction with threads.
|
|
199
|
+
* Different action types have specific behaviors and required fields for proper functionality.
|
|
235
200
|
*
|
|
236
201
|
* @example
|
|
237
202
|
* ```typescript
|
|
238
|
-
* // External
|
|
239
|
-
* const
|
|
240
|
-
* type:
|
|
203
|
+
* // External action - opens URL in browser
|
|
204
|
+
* const externalAction: Action = {
|
|
205
|
+
* type: ActionType.external,
|
|
241
206
|
* title: "Open in Google Calendar",
|
|
242
207
|
* url: "https://calendar.google.com/event/123",
|
|
243
208
|
* };
|
|
244
209
|
*
|
|
245
|
-
* // Conferencing
|
|
246
|
-
* const
|
|
247
|
-
* type:
|
|
210
|
+
* // Conferencing action - opens video conference with provider info
|
|
211
|
+
* const conferencingAction: Action = {
|
|
212
|
+
* type: ActionType.conferencing,
|
|
248
213
|
* url: "https://meet.google.com/abc-defg-hij",
|
|
249
214
|
* provider: ConferencingProvider.googleMeet,
|
|
250
215
|
* };
|
|
251
216
|
*
|
|
252
|
-
* // Integrations
|
|
253
|
-
* const
|
|
254
|
-
* type:
|
|
217
|
+
* // Integrations action - initiates OAuth flow
|
|
218
|
+
* const authAction: Action = {
|
|
219
|
+
* type: ActionType.auth,
|
|
255
220
|
* title: "Continue with Google",
|
|
256
221
|
* provider: AuthProvider.Google,
|
|
257
222
|
* scopes: ["https://www.googleapis.com/auth/calendar.readonly"],
|
|
258
223
|
* callback: "callback-token-for-auth-completion"
|
|
259
224
|
* };
|
|
260
225
|
*
|
|
261
|
-
* // Callback
|
|
262
|
-
* const
|
|
263
|
-
* type:
|
|
226
|
+
* // Callback action - triggers a twist method
|
|
227
|
+
* const callbackAction: Action = {
|
|
228
|
+
* type: ActionType.callback,
|
|
264
229
|
* title: "📅 Primary Calendar",
|
|
265
230
|
* token: "callback-token-here"
|
|
266
231
|
* };
|
|
267
232
|
* ```
|
|
268
233
|
*/
|
|
269
|
-
export type
|
|
234
|
+
export type Action = {
|
|
270
235
|
/** External web link that opens in browser */
|
|
271
|
-
type:
|
|
272
|
-
/** Display text for the
|
|
236
|
+
type: ActionType.external;
|
|
237
|
+
/** Display text for the action button */
|
|
273
238
|
title: string;
|
|
274
239
|
/** URL to open when clicked */
|
|
275
240
|
url: string;
|
|
276
241
|
} | {
|
|
277
|
-
/** Video conferencing
|
|
278
|
-
type:
|
|
242
|
+
/** Video conferencing action with provider-specific handling */
|
|
243
|
+
type: ActionType.conferencing;
|
|
279
244
|
/** URL to join the conference */
|
|
280
245
|
url: string;
|
|
281
246
|
/** Conferencing provider for UI customization */
|
|
282
247
|
provider: ConferencingProvider;
|
|
283
248
|
} | {
|
|
284
|
-
/** Authentication
|
|
285
|
-
type:
|
|
249
|
+
/** Authentication action that initiates an OAuth flow */
|
|
250
|
+
type: ActionType.auth;
|
|
286
251
|
/** Display text for the auth button */
|
|
287
252
|
title: string;
|
|
288
253
|
/** OAuth provider (e.g., "google", "microsoft") */
|
|
@@ -292,15 +257,15 @@ export type ActivityLink = {
|
|
|
292
257
|
/** Callback token for auth completion notification */
|
|
293
258
|
callback: Callback;
|
|
294
259
|
} | {
|
|
295
|
-
/** Callback
|
|
296
|
-
type:
|
|
260
|
+
/** Callback action that triggers a twist method when clicked */
|
|
261
|
+
type: ActionType.callback;
|
|
297
262
|
/** Display text for the callback button */
|
|
298
263
|
title: string;
|
|
299
264
|
/** Token identifying the callback to execute */
|
|
300
265
|
callback: Callback;
|
|
301
266
|
} | {
|
|
302
|
-
/** File attachment
|
|
303
|
-
type:
|
|
267
|
+
/** File attachment action stored in R2 */
|
|
268
|
+
type: ActionType.file;
|
|
304
269
|
/** Unique identifier for the stored file */
|
|
305
270
|
fileId: string;
|
|
306
271
|
/** Original filename */
|
|
@@ -311,9 +276,9 @@ export type ActivityLink = {
|
|
|
311
276
|
mimeType: string;
|
|
312
277
|
};
|
|
313
278
|
/**
|
|
314
|
-
* Represents metadata about
|
|
279
|
+
* Represents metadata about a thread, typically from an external system.
|
|
315
280
|
*
|
|
316
|
-
*
|
|
281
|
+
* Thread metadata enables storing additional information about threads,
|
|
317
282
|
* which is useful for synchronization, linking back to external systems,
|
|
318
283
|
* and storing tool-specific data.
|
|
319
284
|
*
|
|
@@ -323,10 +288,8 @@ export type ActivityLink = {
|
|
|
323
288
|
* @example
|
|
324
289
|
* ```typescript
|
|
325
290
|
* // Calendar event metadata
|
|
326
|
-
* await plot.
|
|
327
|
-
* type: ActivityType.Event,
|
|
291
|
+
* await plot.createThread({
|
|
328
292
|
* title: "Team Meeting",
|
|
329
|
-
* start: new Date("2024-01-15T10:00:00Z"),
|
|
330
293
|
* meta: {
|
|
331
294
|
* calendarId: "primary",
|
|
332
295
|
* htmlLink: "https://calendar.google.com/event/abc123",
|
|
@@ -335,8 +298,7 @@ export type ActivityLink = {
|
|
|
335
298
|
* });
|
|
336
299
|
*
|
|
337
300
|
* // Project issue metadata
|
|
338
|
-
* await plot.
|
|
339
|
-
* type: ActivityType.Action,
|
|
301
|
+
* await plot.createThread({
|
|
340
302
|
* title: "Fix login bug",
|
|
341
303
|
* meta: {
|
|
342
304
|
* projectId: "TEAM",
|
|
@@ -346,7 +308,7 @@ export type ActivityLink = {
|
|
|
346
308
|
* });
|
|
347
309
|
* ```
|
|
348
310
|
*/
|
|
349
|
-
export type
|
|
311
|
+
export type ThreadMeta = {
|
|
350
312
|
/** Source-specific properties and metadata */
|
|
351
313
|
[key: string]: JSONValue;
|
|
352
314
|
};
|
|
@@ -363,286 +325,57 @@ export type NewTags = {
|
|
|
363
325
|
[K in Tag]?: NewActor[];
|
|
364
326
|
};
|
|
365
327
|
/**
|
|
366
|
-
* Common fields shared by both
|
|
328
|
+
* Common fields shared by both Thread and Note entities.
|
|
367
329
|
*/
|
|
368
|
-
export type
|
|
369
|
-
/** Unique identifier for the
|
|
330
|
+
export type ThreadCommon = {
|
|
331
|
+
/** Unique identifier for the thread */
|
|
370
332
|
id: Uuid;
|
|
371
333
|
/**
|
|
372
|
-
* When this
|
|
373
|
-
*
|
|
374
|
-
* For activities created in Plot, this is when the user created it.
|
|
375
|
-
* For activities synced from external systems (GitHub issues, emails, calendar events),
|
|
376
|
-
* this is the original creation time in that system.
|
|
334
|
+
* When this item was created.
|
|
377
335
|
*
|
|
378
|
-
*
|
|
336
|
+
* **For sources:** Set this to the external system's timestamp (e.g., email
|
|
337
|
+
* sent date, comment creation date), NOT the sync time. If omitted, defaults
|
|
338
|
+
* to the current time, which is almost never correct for synced data.
|
|
379
339
|
*/
|
|
380
340
|
created: Date;
|
|
381
|
-
/**
|
|
382
|
-
author: Actor;
|
|
383
|
-
/** Whether this activity is private (only visible to author) */
|
|
341
|
+
/** Whether this thread is private (only visible to creator) */
|
|
384
342
|
private: boolean;
|
|
385
|
-
/** Whether this
|
|
343
|
+
/** Whether this thread has been archived */
|
|
386
344
|
archived: boolean;
|
|
387
|
-
/** Tags attached to this
|
|
345
|
+
/** Tags attached to this thread. Maps tag ID to array of actor IDs who added that tag. */
|
|
388
346
|
tags: Tags;
|
|
389
|
-
/** Array of actor IDs (users, contacts, or twists) mentioned in this
|
|
347
|
+
/** Array of actor IDs (users, contacts, or twists) mentioned in this thread via @-mentions */
|
|
390
348
|
mentions: ActorId[];
|
|
391
349
|
};
|
|
392
350
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
351
|
+
* Fields on a Thread entity.
|
|
352
|
+
* Threads are simple containers for links and notes.
|
|
395
353
|
*/
|
|
396
|
-
type
|
|
397
|
-
/**
|
|
398
|
-
* Globally unique, stable identifier for the item in an external system.
|
|
399
|
-
* MUST use immutable system-generated IDs, not human-readable slugs or titles.
|
|
400
|
-
*
|
|
401
|
-
* Recommended format: `${domain}:${type}:${id}`
|
|
402
|
-
*
|
|
403
|
-
* Examples:
|
|
404
|
-
* - `linear:issue:549dd8bd-2bc9-43d1-95d5-4b4af0c5af1b` (Linear issue by UUID)
|
|
405
|
-
* - `jira:10001:issue:12345` (Jira issue by numeric ID with cloud ID)
|
|
406
|
-
* - `gmail:thread:18d4e5f2a3b1c9d7` (Gmail thread by system ID)
|
|
407
|
-
*
|
|
408
|
-
* ⚠️ AVOID: URLs with mutable components like team names or issue keys
|
|
409
|
-
* - Bad: `https://linear.app/team/issue/TEAM-123/title` (team and title can change)
|
|
410
|
-
* - Bad: `jira:issue:PROJECT-42` (issue key can change)
|
|
411
|
-
*
|
|
412
|
-
* When set, uniquely identifies the activity within a priority tree for upsert operations.
|
|
413
|
-
*/
|
|
414
|
-
source: string | null;
|
|
415
|
-
/** The display title/summary of the activity */
|
|
354
|
+
type ThreadFields = ThreadCommon & {
|
|
355
|
+
/** The display title/summary of the thread */
|
|
416
356
|
title: string;
|
|
417
|
-
/**
|
|
418
|
-
kind: ActivityKind | null;
|
|
419
|
-
/**
|
|
420
|
-
* The actor assigned to this activity.
|
|
421
|
-
*
|
|
422
|
-
* **For actions (tasks):**
|
|
423
|
-
* - If not provided (undefined), defaults to the user who installed the twist (twist owner)
|
|
424
|
-
* - To create an **unassigned action**, explicitly set `assignee: null`
|
|
425
|
-
* - For synced tasks from external systems, typically set `assignee: null` for unassigned items
|
|
426
|
-
*
|
|
427
|
-
* **For notes and events:** Assignee is optional and typically null.
|
|
428
|
-
* When marking an activity as done, it becomes an Action; if no assignee is set,
|
|
429
|
-
* the twist owner is assigned automatically.
|
|
430
|
-
*
|
|
431
|
-
* @example
|
|
432
|
-
* ```typescript
|
|
433
|
-
* // Create action assigned to twist owner (default behavior)
|
|
434
|
-
* const task: NewActivity = {
|
|
435
|
-
* type: ActivityType.Action,
|
|
436
|
-
* title: "Follow up on email"
|
|
437
|
-
* // assignee omitted → defaults to twist owner
|
|
438
|
-
* };
|
|
439
|
-
*
|
|
440
|
-
* // Create UNASSIGNED action (for backlog items)
|
|
441
|
-
* const backlogTask: NewActivity = {
|
|
442
|
-
* type: ActivityType.Action,
|
|
443
|
-
* title: "Review PR #123",
|
|
444
|
-
* assignee: null // Explicitly set to null
|
|
445
|
-
* };
|
|
446
|
-
*
|
|
447
|
-
* // Create action with explicit assignee
|
|
448
|
-
* const assignedTask: NewActivity = {
|
|
449
|
-
* type: ActivityType.Action,
|
|
450
|
-
* title: "Deploy to production",
|
|
451
|
-
* assignee: {
|
|
452
|
-
* id: userId as ActorId,
|
|
453
|
-
* type: ActorType.User,
|
|
454
|
-
* name: "Alice"
|
|
455
|
-
* }
|
|
456
|
-
* };
|
|
457
|
-
* ```
|
|
458
|
-
*/
|
|
459
|
-
assignee: Actor | null;
|
|
460
|
-
/**
|
|
461
|
-
* Start time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.
|
|
462
|
-
* For recurring events, this represents the start of the first occurrence.
|
|
463
|
-
* Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events.
|
|
464
|
-
*
|
|
465
|
-
* **Activity Scheduling States** (for Actions):
|
|
466
|
-
* - **Do Now** (current/actionable): When creating an Action, omitting `start` defaults to current time
|
|
467
|
-
* - **Do Later** (future scheduled): Set `start` to a future Date or date string
|
|
468
|
-
* - **Do Someday** (unscheduled backlog): Explicitly set `start: null`
|
|
469
|
-
*
|
|
470
|
-
* **Important for synced tasks**: When syncing unassigned backlog items from external systems,
|
|
471
|
-
* set BOTH `start: null` AND `assignee: null` to create unscheduled, unassigned actions.
|
|
472
|
-
*
|
|
473
|
-
* @example
|
|
474
|
-
* ```typescript
|
|
475
|
-
* // "Do Now" - assigned to twist owner, actionable immediately
|
|
476
|
-
* await this.tools.plot.createActivity({
|
|
477
|
-
* type: ActivityType.Action,
|
|
478
|
-
* title: "Urgent task"
|
|
479
|
-
* // start omitted → defaults to now
|
|
480
|
-
* // assignee omitted → defaults to twist owner
|
|
481
|
-
* });
|
|
482
|
-
*
|
|
483
|
-
* // "Do Later" - scheduled for a specific time
|
|
484
|
-
* await this.tools.plot.createActivity({
|
|
485
|
-
* type: ActivityType.Action,
|
|
486
|
-
* title: "Future task",
|
|
487
|
-
* start: new Date("2025-02-01")
|
|
488
|
-
* });
|
|
489
|
-
*
|
|
490
|
-
* // "Do Someday" - unassigned backlog item (common for synced tasks)
|
|
491
|
-
* await this.tools.plot.createActivity({
|
|
492
|
-
* type: ActivityType.Action,
|
|
493
|
-
* title: "Backlog task",
|
|
494
|
-
* start: null, // Explicitly unscheduled
|
|
495
|
-
* assignee: null // Explicitly unassigned
|
|
496
|
-
* });
|
|
497
|
-
* ```
|
|
498
|
-
*/
|
|
499
|
-
start: Date | string | null;
|
|
500
|
-
/**
|
|
501
|
-
* End time of a scheduled activity. Notes are not typically scheduled unless they're about specific times.
|
|
502
|
-
* For recurring events, this represents the end of the first occurrence.
|
|
503
|
-
* Can be a Date object for timed events or a date string in "YYYY-MM-DD" format for all-day events.
|
|
504
|
-
* Null for tasks or activities without defined end times.
|
|
505
|
-
*/
|
|
506
|
-
end: Date | string | null;
|
|
507
|
-
/**
|
|
508
|
-
* For recurring activities, the last occurrence date (inclusive).
|
|
509
|
-
* Can be a Date object, date string in "YYYY-MM-DD" format, or null if recurring indefinitely.
|
|
510
|
-
* When both recurrenceCount and recurrenceUntil are provided, recurrenceCount takes precedence.
|
|
511
|
-
*/
|
|
512
|
-
recurrenceUntil: Date | string | null;
|
|
513
|
-
/**
|
|
514
|
-
* For recurring activities, the number of occurrences to generate.
|
|
515
|
-
* Takes precedence over recurrenceUntil if both are provided.
|
|
516
|
-
* Null for non-recurring activities or indefinite recurrence.
|
|
517
|
-
*/
|
|
518
|
-
recurrenceCount: number | null;
|
|
519
|
-
/** The priority context this activity belongs to */
|
|
357
|
+
/** The priority context this thread belongs to */
|
|
520
358
|
priority: Priority;
|
|
521
|
-
/**
|
|
522
|
-
|
|
523
|
-
/** Array of dates to exclude from the recurrence pattern */
|
|
524
|
-
recurrenceExdates: Date[] | null;
|
|
525
|
-
/** Metadata about the activity, typically from an external system that created it */
|
|
526
|
-
meta: ActivityMeta | null;
|
|
527
|
-
/** Sort order for the activity (fractional positioning) */
|
|
528
|
-
order: number;
|
|
359
|
+
/** The schedule associated with this thread, if any */
|
|
360
|
+
schedule?: Schedule;
|
|
529
361
|
};
|
|
530
|
-
export type
|
|
531
|
-
|
|
532
|
-
} | {
|
|
533
|
-
type: ActivityType.Action;
|
|
534
|
-
/**
|
|
535
|
-
* Timestamp when the activity was marked as complete. Null if not completed.
|
|
536
|
-
*/
|
|
537
|
-
done: Date | null;
|
|
538
|
-
} | {
|
|
539
|
-
type: ActivityType.Event;
|
|
540
|
-
});
|
|
541
|
-
export type ActivityWithNotes = Activity & {
|
|
362
|
+
export type Thread = ThreadFields;
|
|
363
|
+
export type ThreadWithNotes = Thread & {
|
|
542
364
|
notes: Note[];
|
|
543
365
|
};
|
|
544
|
-
export type
|
|
545
|
-
notes: Omit<NewNote, "
|
|
366
|
+
export type NewThreadWithNotes = NewThread & {
|
|
367
|
+
notes: Omit<NewNote, "thread">[];
|
|
546
368
|
};
|
|
547
369
|
/**
|
|
548
|
-
*
|
|
549
|
-
* All field values are computed by merging the recurring activity's
|
|
550
|
-
* defaults with any occurrence-specific overrides.
|
|
551
|
-
*/
|
|
552
|
-
export type ActivityOccurrence = {
|
|
553
|
-
/**
|
|
554
|
-
* Original date/datetime of this occurrence.
|
|
555
|
-
* Use start for the occurrence's current start time.
|
|
556
|
-
* Format: Date object or "YYYY-MM-DD" for all-day events.
|
|
557
|
-
*/
|
|
558
|
-
occurrence: Date | string;
|
|
559
|
-
/**
|
|
560
|
-
* The recurring activity of which this is an occurrence.
|
|
561
|
-
*/
|
|
562
|
-
activity: Activity;
|
|
563
|
-
/**
|
|
564
|
-
* Effective values for this occurrence (series defaults + overrides).
|
|
565
|
-
* These are the actual values that apply to this specific instance.
|
|
566
|
-
*/
|
|
567
|
-
start: Date | string;
|
|
568
|
-
end: Date | string | null;
|
|
569
|
-
done: Date | null;
|
|
570
|
-
title: string;
|
|
571
|
-
/**
|
|
572
|
-
* Meta is merged, with the occurrence's meta taking precedence.
|
|
573
|
-
*/
|
|
574
|
-
meta: ActivityMeta | null;
|
|
575
|
-
/**
|
|
576
|
-
* Tags for this occurrence (merged with the recurring tags).
|
|
577
|
-
*/
|
|
578
|
-
tags: Tags;
|
|
579
|
-
/**
|
|
580
|
-
* True if the occurrence is archived.
|
|
581
|
-
*/
|
|
582
|
-
archived: boolean;
|
|
583
|
-
};
|
|
584
|
-
/**
|
|
585
|
-
* Type for creating or updating activity occurrences.
|
|
586
|
-
*
|
|
587
|
-
* Follows the same pattern as Activity/NewActivity:
|
|
588
|
-
* - Required fields: `occurrence` (key) and `start` (for scheduling)
|
|
589
|
-
* - Optional fields: All others from ActivityOccurrence
|
|
590
|
-
* - Additional fields: `twistTags` for add/remove, `unread` for notification control
|
|
370
|
+
* Configuration for automatic priority selection based on thread similarity.
|
|
591
371
|
*
|
|
592
|
-
*
|
|
593
|
-
* ```typescript
|
|
594
|
-
* const activity: NewActivity = {
|
|
595
|
-
* type: ActivityType.Event,
|
|
596
|
-
* recurrenceRule: "FREQ=WEEKLY;BYDAY=MO",
|
|
597
|
-
* occurrences: [
|
|
598
|
-
* {
|
|
599
|
-
* occurrence: new Date("2025-01-27T14:00:00Z"),
|
|
600
|
-
* start: new Date("2025-01-27T14:00:00Z"),
|
|
601
|
-
* tags: { [Tag.Skip]: [user] }
|
|
602
|
-
* }
|
|
603
|
-
* ]
|
|
604
|
-
* };
|
|
605
|
-
* ```
|
|
606
|
-
*/
|
|
607
|
-
export type NewActivityOccurrence = Pick<ActivityOccurrence, "occurrence" | "start"> & Partial<Omit<ActivityOccurrence, "occurrence" | "start" | "activity" | "tags">> & {
|
|
608
|
-
/**
|
|
609
|
-
* Tags specific to this occurrence.
|
|
610
|
-
* These replace any recurrence-level tags for this occurrence.
|
|
611
|
-
*/
|
|
612
|
-
tags?: NewTags;
|
|
613
|
-
/**
|
|
614
|
-
* Add or remove the twist's tags on this occurrence.
|
|
615
|
-
* Maps tag ID to boolean: true = add tag, false = remove tag.
|
|
616
|
-
*/
|
|
617
|
-
twistTags?: Partial<Record<Tag, boolean>>;
|
|
618
|
-
/**
|
|
619
|
-
* Whether this occurrence should be marked as unread for users.
|
|
620
|
-
* - undefined/omitted (default): Occurrence is unread for users, except auto-marked
|
|
621
|
-
* as read for the author if they are the twist owner (user)
|
|
622
|
-
* - true: Occurrence is explicitly unread for ALL users (use sparingly)
|
|
623
|
-
* - false: Occurrence is marked as read for all users
|
|
624
|
-
*
|
|
625
|
-
* For the default behavior, omit this field entirely.
|
|
626
|
-
* Use false for initial sync to avoid marking historical items as unread.
|
|
627
|
-
*/
|
|
628
|
-
unread?: boolean;
|
|
629
|
-
};
|
|
630
|
-
/**
|
|
631
|
-
* Inline type for creating/updating occurrences within NewActivity/ActivityUpdate.
|
|
632
|
-
* Used to specify occurrence-specific overrides when creating or updating a recurring activity.
|
|
633
|
-
*/
|
|
634
|
-
export type ActivityOccurrenceUpdate = Pick<NewActivityOccurrence, "occurrence"> & Partial<Omit<NewActivityOccurrence, "occurrence" | "activity">>;
|
|
635
|
-
/**
|
|
636
|
-
* Configuration for automatic priority selection based on activity similarity.
|
|
637
|
-
*
|
|
638
|
-
* Maps activity fields to scoring weights or required exact matches:
|
|
372
|
+
* Maps thread fields to scoring weights or required exact matches:
|
|
639
373
|
* - Number value: Maximum score for similarity matching on this field
|
|
640
|
-
* - `true` value: Required exact match -
|
|
374
|
+
* - `true` value: Required exact match - threads must match exactly or be excluded
|
|
641
375
|
*
|
|
642
376
|
* Scoring rules:
|
|
643
|
-
* - content: Uses vector similarity on
|
|
644
|
-
* -
|
|
645
|
-
* - mentions: Percentage of existing activity's mentions that appear in new activity
|
|
377
|
+
* - content: Uses vector similarity on thread embedding (cosine similarity)
|
|
378
|
+
* - mentions: Percentage of existing thread's mentions that appear in new thread
|
|
646
379
|
* - meta.field: Exact match on top-level meta fields (e.g., "meta.sourceId")
|
|
647
380
|
*
|
|
648
381
|
* When content is `true`, applies a strong similarity threshold to ensure only close matches.
|
|
@@ -653,8 +386,8 @@ export type ActivityOccurrenceUpdate = Pick<NewActivityOccurrence, "occurrence">
|
|
|
653
386
|
* // Require exact content match with strong similarity
|
|
654
387
|
* pickPriority: { content: true }
|
|
655
388
|
*
|
|
656
|
-
* // Score based on content (max 100 points) and
|
|
657
|
-
* pickPriority: { content: 100,
|
|
389
|
+
* // Score based on content (max 100 points) and mentions
|
|
390
|
+
* pickPriority: { content: 100, mentions: true }
|
|
658
391
|
*
|
|
659
392
|
* // Match on meta and score content
|
|
660
393
|
* pickPriority: { "meta.projectId": true, content: 50 }
|
|
@@ -662,103 +395,24 @@ export type ActivityOccurrenceUpdate = Pick<NewActivityOccurrence, "occurrence">
|
|
|
662
395
|
*/
|
|
663
396
|
export type PickPriorityConfig = {
|
|
664
397
|
content?: number | true;
|
|
665
|
-
type?: number | true;
|
|
666
398
|
mentions?: number | true;
|
|
667
399
|
[key: `meta.${string}`]: number | true;
|
|
668
400
|
};
|
|
669
401
|
/**
|
|
670
|
-
* Type for creating new
|
|
671
|
-
*
|
|
672
|
-
* Requires only the activity type, with all other fields optional.
|
|
673
|
-
* The author will be automatically assigned by the Plot system based on
|
|
674
|
-
* the current execution context. The ID can be optionally provided by
|
|
675
|
-
* tools for tracking and update detection purposes.
|
|
402
|
+
* Type for creating new threads.
|
|
676
403
|
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
* When creating an Activity of type `Action`:
|
|
680
|
-
* - **`start` omitted** → Defaults to current time (now) → "Do Now"
|
|
681
|
-
* - **`assignee` omitted** → Defaults to twist owner → Assigned action
|
|
682
|
-
*
|
|
683
|
-
* To create unassigned backlog items (common for synced tasks), you MUST explicitly set BOTH:
|
|
684
|
-
* - `start: null` → "Do Someday" (unscheduled)
|
|
685
|
-
* - `assignee: null` → Unassigned
|
|
686
|
-
*
|
|
687
|
-
* **Scheduling States**:
|
|
688
|
-
* - **"Do Now"** (actionable today): Omit `start` or set to current time
|
|
689
|
-
* - **"Do Later"** (scheduled): Set `start` to a future Date
|
|
690
|
-
* - **"Do Someday"** (backlog): Set `start: null`
|
|
691
|
-
*
|
|
692
|
-
* Priority can be specified in three ways:
|
|
693
|
-
* 1. Explicit priority: `priority: { id: "..." }` - Use specific priority (disables pickPriority)
|
|
694
|
-
* 2. Pick priority config: `pickPriority: { ... }` - Auto-select based on similarity
|
|
695
|
-
* 3. Neither: Defaults to `pickPriority: { content: true }` for automatic matching
|
|
404
|
+
* Threads are simple containers. All other fields are optional.
|
|
696
405
|
*
|
|
697
406
|
* @example
|
|
698
407
|
* ```typescript
|
|
699
|
-
*
|
|
700
|
-
* const urgentTask: NewActivity = {
|
|
701
|
-
* type: ActivityType.Action,
|
|
408
|
+
* const thread: NewThread = {
|
|
702
409
|
* title: "Review pull request"
|
|
703
|
-
* // start omitted → defaults to now
|
|
704
|
-
* // assignee omitted → defaults to twist owner
|
|
705
|
-
* };
|
|
706
|
-
*
|
|
707
|
-
* // "Do Someday" - UNASSIGNED backlog item (for synced tasks)
|
|
708
|
-
* const backlogTask: NewActivity = {
|
|
709
|
-
* type: ActivityType.Action,
|
|
710
|
-
* title: "Refactor user service",
|
|
711
|
-
* start: null, // Must explicitly set to null
|
|
712
|
-
* assignee: null // Must explicitly set to null
|
|
713
|
-
* };
|
|
714
|
-
*
|
|
715
|
-
* // "Do Later" - Scheduled for specific date
|
|
716
|
-
* const futureTask: NewActivity = {
|
|
717
|
-
* type: ActivityType.Action,
|
|
718
|
-
* title: "Prepare Q1 review",
|
|
719
|
-
* start: new Date("2025-03-15")
|
|
720
|
-
* };
|
|
721
|
-
*
|
|
722
|
-
* // Note (typically unscheduled)
|
|
723
|
-
* const note: NewActivity = {
|
|
724
|
-
* type: ActivityType.Note,
|
|
725
|
-
* title: "Meeting notes",
|
|
726
|
-
* content: "Discussed Q4 roadmap...",
|
|
727
|
-
* start: null // Notes typically don't have scheduled times
|
|
728
|
-
* };
|
|
729
|
-
*
|
|
730
|
-
* // Event (always has explicit start/end times)
|
|
731
|
-
* const event: NewActivity = {
|
|
732
|
-
* type: ActivityType.Event,
|
|
733
|
-
* title: "Team standup",
|
|
734
|
-
* start: new Date("2025-01-15T10:00:00"),
|
|
735
|
-
* end: new Date("2025-01-15T10:30:00")
|
|
736
410
|
* };
|
|
737
411
|
* ```
|
|
738
412
|
*/
|
|
739
|
-
export type
|
|
740
|
-
|
|
741
|
-
done?: never;
|
|
742
|
-
} | {
|
|
743
|
-
type: ActivityType.Action;
|
|
744
|
-
done?: Date | null;
|
|
745
|
-
} | {
|
|
746
|
-
type: ActivityType.Event;
|
|
747
|
-
done?: never;
|
|
748
|
-
}) & Partial<Omit<ActivityFields, "author" | "assignee" | "priority" | "tags" | "mentions" | "id" | "source">> & ({
|
|
749
|
-
/**
|
|
750
|
-
* Unique identifier for the activity, generated by Uuid.Generate().
|
|
751
|
-
* Specifying an ID allows tools to track and upsert activities.
|
|
752
|
-
*/
|
|
413
|
+
export type NewThread = Partial<Omit<ThreadFields, "priority" | "tags" | "mentions" | "id">> & ({
|
|
414
|
+
/** Unique identifier for the thread, generated by Uuid.Generate(). */
|
|
753
415
|
id: Uuid;
|
|
754
|
-
} | {
|
|
755
|
-
/**
|
|
756
|
-
* Canonical URL for the item in an external system.
|
|
757
|
-
* For example, https://acme.atlassian.net/browse/PROJ-42 could represent a Jira issue.
|
|
758
|
-
* When set, it uniquely identifies the activity within a priority tree. This performs
|
|
759
|
-
* an upsert.
|
|
760
|
-
*/
|
|
761
|
-
source: string;
|
|
762
416
|
} | {}) & ({
|
|
763
417
|
/** Explicit priority (required when specified) - disables automatic priority matching */
|
|
764
418
|
priority: Pick<Priority, "id">;
|
|
@@ -767,201 +421,98 @@ export type NewActivity = ({
|
|
|
767
421
|
pickPriority?: PickPriorityConfig;
|
|
768
422
|
}) & {
|
|
769
423
|
/**
|
|
770
|
-
*
|
|
771
|
-
*/
|
|
772
|
-
author?: NewActor;
|
|
773
|
-
/**
|
|
774
|
-
* The person that assigned to the item.
|
|
775
|
-
*/
|
|
776
|
-
assignee?: NewActor | null;
|
|
777
|
-
/**
|
|
778
|
-
* All tags to set on the new activity.
|
|
424
|
+
* All tags to set on the new thread.
|
|
779
425
|
*/
|
|
780
426
|
tags?: NewTags;
|
|
781
427
|
/**
|
|
782
|
-
* Whether the
|
|
783
|
-
* - undefined/omitted (default):
|
|
428
|
+
* Whether the thread should be marked as unread for users.
|
|
429
|
+
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
784
430
|
* as read for the author if they are the twist owner (user)
|
|
785
|
-
* - true:
|
|
786
|
-
* - false:
|
|
787
|
-
*
|
|
788
|
-
* For the default behavior, omit this field entirely.
|
|
789
|
-
* Use false for initial sync to avoid marking historical items as unread.
|
|
431
|
+
* - true: Thread is explicitly unread for ALL users (use sparingly)
|
|
432
|
+
* - false: Thread is marked as read for all users in the priority at creation time
|
|
790
433
|
*/
|
|
791
434
|
unread?: boolean;
|
|
792
435
|
/**
|
|
793
|
-
* Whether the
|
|
794
|
-
* - true: Archive the
|
|
795
|
-
* - false: Unarchive the
|
|
436
|
+
* Whether the thread is archived.
|
|
437
|
+
* - true: Archive the thread
|
|
438
|
+
* - false: Unarchive the thread
|
|
796
439
|
* - undefined (default): Preserve current archive state
|
|
797
|
-
*
|
|
798
|
-
* Best practice: Set to false during initial syncs to ensure activities
|
|
799
|
-
* are unarchived. Omit during incremental syncs to preserve user's choice.
|
|
800
440
|
*/
|
|
801
441
|
archived?: boolean;
|
|
802
442
|
/**
|
|
803
|
-
* Optional preview content for the
|
|
443
|
+
* Optional preview content for the thread. Can be Markdown formatted.
|
|
804
444
|
* The preview will be automatically generated from this content (truncated to 100 chars).
|
|
805
|
-
*
|
|
806
|
-
* - string: Use this content for preview generation
|
|
807
|
-
* - null: Explicitly disable preview (no preview will be shown)
|
|
808
|
-
* - undefined (default): Fall back to legacy behavior (generate from first note with content)
|
|
809
|
-
*
|
|
810
|
-
* This field is write-only and won't be returned when reading activities.
|
|
811
445
|
*/
|
|
812
446
|
preview?: string | null;
|
|
813
447
|
/**
|
|
814
|
-
*
|
|
815
|
-
* Each entry specifies overrides for a specific occurrence.
|
|
816
|
-
*
|
|
817
|
-
* When occurrence matches the recurrence rule but only tags are specified,
|
|
818
|
-
* the occurrence is created with just tags in activity_tag.occurrence (no activity_exception).
|
|
819
|
-
*
|
|
820
|
-
* When any other field is specified, creates/updates an activity_exception row.
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* ```typescript
|
|
824
|
-
* // Create recurring event with per-occurrence RSVPs
|
|
825
|
-
* const meeting: NewActivity = {
|
|
826
|
-
* type: ActivityType.Event,
|
|
827
|
-
* recurrenceRule: "FREQ=WEEKLY;BYDAY=MO",
|
|
828
|
-
* start: new Date("2025-01-20T14:00:00Z"),
|
|
829
|
-
* duration: 1800000, // 30 minutes
|
|
830
|
-
* occurrences: [
|
|
831
|
-
* {
|
|
832
|
-
* occurrence: new Date("2025-01-27T14:00:00Z"),
|
|
833
|
-
* tags: { [Tag.Skip]: [{ email: "user@example.com" }] }
|
|
834
|
-
* },
|
|
835
|
-
* {
|
|
836
|
-
* occurrence: new Date("2025-02-03T14:00:00Z"),
|
|
837
|
-
* start: new Date("2025-02-03T15:00:00Z"), // Reschedule this one
|
|
838
|
-
* tags: { [Tag.Attend]: [{ email: "user@example.com" }] }
|
|
839
|
-
* }
|
|
840
|
-
* ]
|
|
841
|
-
* };
|
|
842
|
-
* ```
|
|
843
|
-
*/
|
|
844
|
-
occurrences?: NewActivityOccurrence[];
|
|
845
|
-
/**
|
|
846
|
-
* Dates to add to the recurrence exclusion list.
|
|
847
|
-
* These are merged with existing exdates. Use this for incremental updates
|
|
848
|
-
* (e.g., cancelling a single occurrence) instead of replacing the full list.
|
|
448
|
+
* Optional schedules to create alongside the thread.
|
|
849
449
|
*/
|
|
850
|
-
|
|
450
|
+
schedules?: Array<Omit<NewSchedule, "threadId">>;
|
|
851
451
|
/**
|
|
852
|
-
*
|
|
853
|
-
* Use this to "uncancel" a previously excluded occurrence.
|
|
452
|
+
* Optional schedule occurrence overrides.
|
|
854
453
|
*/
|
|
855
|
-
|
|
454
|
+
scheduleOccurrences?: NewScheduleOccurrence[];
|
|
856
455
|
};
|
|
857
|
-
export type
|
|
858
|
-
type?: ActorType;
|
|
456
|
+
export type ThreadFilter = {
|
|
859
457
|
meta?: {
|
|
860
458
|
[key: string]: JSONValue;
|
|
861
459
|
};
|
|
862
460
|
};
|
|
863
461
|
/**
|
|
864
462
|
* Fields supported by bulk updates via `match`. Only simple scalar fields
|
|
865
|
-
* that can be applied uniformly across many
|
|
463
|
+
* that can be applied uniformly across many threads are included.
|
|
866
464
|
*/
|
|
867
|
-
type
|
|
868
|
-
/** Update the type of all matching activities. */
|
|
869
|
-
type?: ActivityType;
|
|
870
|
-
/**
|
|
871
|
-
* Timestamp when the activities were marked as complete. Null to clear.
|
|
872
|
-
* Setting done will automatically set the type to Action if not already.
|
|
873
|
-
*/
|
|
874
|
-
done?: Date | null;
|
|
875
|
-
};
|
|
465
|
+
type ThreadBulkUpdateFields = Partial<Pick<ThreadFields, "title" | "private" | "archived">>;
|
|
876
466
|
/**
|
|
877
|
-
* Fields supported by single-
|
|
878
|
-
* Includes all bulk fields plus
|
|
467
|
+
* Fields supported by single-thread updates via `id` or `source`.
|
|
468
|
+
* Includes all bulk fields plus tags and preview.
|
|
879
469
|
*/
|
|
880
|
-
type
|
|
470
|
+
type ThreadSingleUpdateFields = ThreadBulkUpdateFields & {
|
|
881
471
|
/**
|
|
882
|
-
* Tags to change on the
|
|
472
|
+
* Tags to change on the thread. Use an empty array of NewActor to remove a tag.
|
|
883
473
|
* Use twistTags to add/remove the twist from tags to avoid clearing other actors' tags.
|
|
884
474
|
*/
|
|
885
475
|
tags?: NewTags;
|
|
886
476
|
/**
|
|
887
477
|
* Add or remove the twist's tags.
|
|
888
478
|
* Maps tag ID to boolean: true = add tag, false = remove tag.
|
|
889
|
-
* This is allowed on all
|
|
479
|
+
* This is allowed on all threads the twist has access to.
|
|
890
480
|
*/
|
|
891
481
|
twistTags?: Partial<Record<Tag, boolean>>;
|
|
892
482
|
/**
|
|
893
|
-
* Optional preview content for the
|
|
483
|
+
* Optional preview content for the thread. Can be Markdown formatted.
|
|
894
484
|
* The preview will be automatically generated from this content (truncated to 100 chars).
|
|
895
485
|
*
|
|
896
486
|
* - string: Use this content for preview generation
|
|
897
487
|
* - null: Explicitly disable preview (no preview will be shown)
|
|
898
488
|
* - undefined (omitted): Preserve current preview value
|
|
899
489
|
*
|
|
900
|
-
* This field is write-only and won't be returned when reading
|
|
490
|
+
* This field is write-only and won't be returned when reading threads.
|
|
901
491
|
*/
|
|
902
492
|
preview?: string | null;
|
|
903
|
-
/**
|
|
904
|
-
* Create or update specific occurrences of this recurring activity.
|
|
905
|
-
* Each entry specifies overrides for a specific occurrence.
|
|
906
|
-
*
|
|
907
|
-
* Setting a field to null reverts it to the series default.
|
|
908
|
-
* Omitting a field leaves it unchanged.
|
|
909
|
-
*
|
|
910
|
-
* @example
|
|
911
|
-
* ```typescript
|
|
912
|
-
* // Update RSVPs for specific occurrences
|
|
913
|
-
* await plot.updateActivity({
|
|
914
|
-
* id: meetingId,
|
|
915
|
-
* occurrences: [
|
|
916
|
-
* {
|
|
917
|
-
* occurrence: new Date("2025-01-27T14:00:00Z"),
|
|
918
|
-
* tags: { [Tag.Skip]: [user] }
|
|
919
|
-
* },
|
|
920
|
-
* {
|
|
921
|
-
* occurrence: new Date("2025-02-03T14:00:00Z"),
|
|
922
|
-
* tags: { [Tag.Attend]: [user] }
|
|
923
|
-
* },
|
|
924
|
-
* {
|
|
925
|
-
* occurrence: new Date("2025-02-10T14:00:00Z"),
|
|
926
|
-
* archived: true // Cancel this occurrence
|
|
927
|
-
* }
|
|
928
|
-
* ]
|
|
929
|
-
* });
|
|
930
|
-
* ```
|
|
931
|
-
*/
|
|
932
|
-
occurrences?: (NewActivityOccurrence | ActivityOccurrenceUpdate)[];
|
|
933
|
-
/**
|
|
934
|
-
* Dates to add to the recurrence exclusion list.
|
|
935
|
-
* These are merged with existing exdates. Use this for incremental updates
|
|
936
|
-
* (e.g., cancelling a single occurrence) instead of replacing the full list.
|
|
937
|
-
*/
|
|
938
|
-
addRecurrenceExdates?: Date[];
|
|
939
|
-
/**
|
|
940
|
-
* Dates to remove from the recurrence exclusion list.
|
|
941
|
-
* Use this to "uncancel" a previously excluded occurrence.
|
|
942
|
-
*/
|
|
943
|
-
removeRecurrenceExdates?: Date[];
|
|
944
493
|
};
|
|
945
|
-
export type
|
|
494
|
+
export type ThreadUpdate = (({
|
|
946
495
|
id: Uuid;
|
|
947
496
|
} | {
|
|
948
497
|
source: string;
|
|
949
|
-
}) &
|
|
498
|
+
}) & ThreadSingleUpdateFields) | ({
|
|
950
499
|
/**
|
|
951
|
-
* Update all
|
|
500
|
+
* Update all threads matching the specified criteria. Only threads
|
|
952
501
|
* that match all provided fields and were created by the twist will be updated.
|
|
953
502
|
*/
|
|
954
|
-
match:
|
|
955
|
-
} &
|
|
503
|
+
match: ThreadFilter;
|
|
504
|
+
} & ThreadBulkUpdateFields);
|
|
956
505
|
/**
|
|
957
|
-
* Represents a note within
|
|
506
|
+
* Represents a note within a thread.
|
|
958
507
|
*
|
|
959
|
-
* Notes contain the detailed content (note text,
|
|
960
|
-
* They are always ordered by creation time within their parent
|
|
508
|
+
* Notes contain the detailed content (note text, actions) associated with a thread.
|
|
509
|
+
* They are always ordered by creation time within their parent thread.
|
|
961
510
|
*/
|
|
962
|
-
export type Note =
|
|
511
|
+
export type Note = ThreadCommon & {
|
|
512
|
+
/** The author of this note */
|
|
513
|
+
author: Actor;
|
|
963
514
|
/**
|
|
964
|
-
* Globally unique, stable identifier for the note within its
|
|
515
|
+
* Globally unique, stable identifier for the note within its thread.
|
|
965
516
|
* Can be used to upsert without knowing the id.
|
|
966
517
|
*
|
|
967
518
|
* Use one of these patterns:
|
|
@@ -973,15 +524,15 @@ export type Note = ActivityCommon & {
|
|
|
973
524
|
* - `"comment:12345"` (for a specific comment by ID)
|
|
974
525
|
* - `"gmail:msg:18d4e5f2a3b1c9d7"` (for a Gmail message within a thread)
|
|
975
526
|
*
|
|
976
|
-
*
|
|
527
|
+
* Ensure IDs are immutable - avoid human-readable slugs or titles.
|
|
977
528
|
*/
|
|
978
529
|
key: string | null;
|
|
979
|
-
/** The parent
|
|
980
|
-
|
|
530
|
+
/** The parent thread this note belongs to */
|
|
531
|
+
thread: Thread;
|
|
981
532
|
/** Primary content for the note (markdown) */
|
|
982
533
|
content: string | null;
|
|
983
|
-
/** Array of interactive
|
|
984
|
-
|
|
534
|
+
/** Array of interactive actions attached to the note */
|
|
535
|
+
actions: Array<Action> | null;
|
|
985
536
|
/** The note this is a reply to, or null if not a reply */
|
|
986
537
|
reNote: {
|
|
987
538
|
id: Uuid;
|
|
@@ -990,19 +541,19 @@ export type Note = ActivityCommon & {
|
|
|
990
541
|
/**
|
|
991
542
|
* Type for creating new notes.
|
|
992
543
|
*
|
|
993
|
-
* Requires the
|
|
544
|
+
* Requires the thread reference, with all other fields optional.
|
|
994
545
|
* Can provide id, key, or neither for note identification:
|
|
995
546
|
* - id: Provide a specific UUID for the note
|
|
996
|
-
* - key: Provide an external identifier for upsert within the
|
|
547
|
+
* - key: Provide an external identifier for upsert within the thread
|
|
997
548
|
* - neither: A new note with auto-generated UUID will be created
|
|
998
549
|
*/
|
|
999
|
-
export type NewNote = Partial<Omit<Note, "author" | "
|
|
550
|
+
export type NewNote = Partial<Omit<Note, "author" | "thread" | "tags" | "mentions" | "id" | "key" | "reNote">> & ({
|
|
1000
551
|
id: Uuid;
|
|
1001
552
|
} | {
|
|
1002
553
|
key: string;
|
|
1003
554
|
} | {}) & {
|
|
1004
|
-
/** Reference to the parent
|
|
1005
|
-
|
|
555
|
+
/** Reference to the parent thread (required) */
|
|
556
|
+
thread: Pick<Thread, "id"> | {
|
|
1006
557
|
source: string;
|
|
1007
558
|
};
|
|
1008
559
|
/**
|
|
@@ -1017,7 +568,7 @@ export type NewNote = Partial<Omit<Note, "author" | "activity" | "tags" | "menti
|
|
|
1017
568
|
*/
|
|
1018
569
|
contentType?: ContentType;
|
|
1019
570
|
/**
|
|
1020
|
-
* Tags to change on the
|
|
571
|
+
* Tags to change on the thread. Use an empty array of NewActor to remove a tag.
|
|
1021
572
|
* Use twistTags to add/remove the twist from tags to avoid clearing other actors' tags.
|
|
1022
573
|
*/
|
|
1023
574
|
tags?: NewTags;
|
|
@@ -1026,11 +577,11 @@ export type NewNote = Partial<Omit<Note, "author" | "activity" | "tags" | "menti
|
|
|
1026
577
|
*/
|
|
1027
578
|
mentions?: NewActor[];
|
|
1028
579
|
/**
|
|
1029
|
-
* Whether the note should mark the parent
|
|
1030
|
-
* - undefined/omitted (default):
|
|
580
|
+
* Whether the note should mark the parent thread as unread for users.
|
|
581
|
+
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
1031
582
|
* as read for the author if they are the twist owner (user)
|
|
1032
|
-
* - true:
|
|
1033
|
-
* - false:
|
|
583
|
+
* - true: Thread is explicitly unread for ALL users (use sparingly)
|
|
584
|
+
* - false: Thread is marked as read for all users in the priority at note creation time
|
|
1034
585
|
*
|
|
1035
586
|
* For the default behavior, omit this field entirely.
|
|
1036
587
|
* Use false for initial sync to avoid marking historical items as unread.
|
|
@@ -1058,7 +609,7 @@ export type NoteUpdate = ({
|
|
|
1058
609
|
key?: string;
|
|
1059
610
|
} | {
|
|
1060
611
|
key: string;
|
|
1061
|
-
}) & Partial<Pick<Note, "private" | "archived" | "content" | "
|
|
612
|
+
}) & Partial<Pick<Note, "private" | "archived" | "content" | "actions" | "reNote">> & {
|
|
1062
613
|
/**
|
|
1063
614
|
* Format of the note content. Determines how the note is processed:
|
|
1064
615
|
* - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)
|
|
@@ -1085,7 +636,7 @@ export type NoteUpdate = ({
|
|
|
1085
636
|
/**
|
|
1086
637
|
* Represents an actor in Plot - a user, contact, or twist.
|
|
1087
638
|
*
|
|
1088
|
-
* Actors can be associated with
|
|
639
|
+
* Actors can be associated with threads as authors, assignees, or mentions.
|
|
1089
640
|
* The email field is only included when ContactAccess.Read permission is granted.
|
|
1090
641
|
*
|
|
1091
642
|
* @example
|
|
@@ -1126,17 +677,17 @@ export type NewActor = {
|
|
|
1126
677
|
id: ActorId;
|
|
1127
678
|
} | NewContact;
|
|
1128
679
|
/**
|
|
1129
|
-
* Enumeration of author types that can create
|
|
680
|
+
* Enumeration of author types that can create threads.
|
|
1130
681
|
*
|
|
1131
|
-
* The author type affects how
|
|
682
|
+
* The author type affects how threads are displayed and processed
|
|
1132
683
|
* within the Plot system.
|
|
1133
684
|
*/
|
|
1134
685
|
export declare enum ActorType {
|
|
1135
|
-
/**
|
|
686
|
+
/** Threads created by human users */
|
|
1136
687
|
User = 0,
|
|
1137
|
-
/**
|
|
688
|
+
/** Threads created by external contacts */
|
|
1138
689
|
Contact = 1,
|
|
1139
|
-
/**
|
|
690
|
+
/** Threads created by automated twists */
|
|
1140
691
|
Twist = 2
|
|
1141
692
|
}
|
|
1142
693
|
/**
|
|
@@ -1172,4 +723,119 @@ export type NewContact = {
|
|
|
1172
723
|
};
|
|
1173
724
|
};
|
|
1174
725
|
export type ContentType = "text" | "markdown" | "html";
|
|
726
|
+
/**
|
|
727
|
+
* Represents an external entity linked to a thread.
|
|
728
|
+
*
|
|
729
|
+
* Links are created by sources to represent external entities (issues, emails, calendar events)
|
|
730
|
+
* attached to a thread container. A thread can have multiple links (1:many).
|
|
731
|
+
* Links store source-specific data like type, status, metadata, and embeddings.
|
|
732
|
+
*
|
|
733
|
+
* @example
|
|
734
|
+
* ```typescript
|
|
735
|
+
* // A link representing a Linear issue
|
|
736
|
+
* const link: Link = {
|
|
737
|
+
* id: "..." as Uuid,
|
|
738
|
+
* threadId: "..." as Uuid,
|
|
739
|
+
* source: "linear:issue:549dd8bd-2bc9-43d1-95d5-4b4af0c5af1b",
|
|
740
|
+
* created: new Date(),
|
|
741
|
+
* author: { id: "..." as ActorId, type: ActorType.Contact, name: "Alice" },
|
|
742
|
+
* title: "Fix login bug",
|
|
743
|
+
* type: "issue",
|
|
744
|
+
* status: "open",
|
|
745
|
+
* meta: { projectId: "TEAM", url: "https://linear.app/team/TEAM-123" },
|
|
746
|
+
* assignee: null,
|
|
747
|
+
* actions: null,
|
|
748
|
+
* };
|
|
749
|
+
* ```
|
|
750
|
+
*/
|
|
751
|
+
export type Link = {
|
|
752
|
+
/** Unique identifier for the link */
|
|
753
|
+
id: Uuid;
|
|
754
|
+
/** The thread this link belongs to */
|
|
755
|
+
threadId: Uuid;
|
|
756
|
+
/** External source identifier for dedup/upsert */
|
|
757
|
+
source: string | null;
|
|
758
|
+
/** When this link was originally created in its source system */
|
|
759
|
+
created: Date;
|
|
760
|
+
/** The actor credited with creating this link */
|
|
761
|
+
author: Actor | null;
|
|
762
|
+
/** Display title */
|
|
763
|
+
title: string;
|
|
764
|
+
/** Truncated preview */
|
|
765
|
+
preview: string | null;
|
|
766
|
+
/** The actor assigned to this link */
|
|
767
|
+
assignee: Actor | null;
|
|
768
|
+
/** Source-defined type string (e.g., issue, pull_request, email, event) */
|
|
769
|
+
type: string | null;
|
|
770
|
+
/** Source-defined status string (e.g., open, done, closed) */
|
|
771
|
+
status: string | null;
|
|
772
|
+
/** Interactive action buttons */
|
|
773
|
+
actions: Array<Action> | null;
|
|
774
|
+
/** Source metadata */
|
|
775
|
+
meta: ThreadMeta | null;
|
|
776
|
+
/** URL to open the original item in its source application (e.g., "Open in Linear") */
|
|
777
|
+
sourceUrl: string | null;
|
|
778
|
+
/** Channel ID that produced this link (matches source_channel.channel_id) */
|
|
779
|
+
channelId: string | null;
|
|
780
|
+
};
|
|
781
|
+
/**
|
|
782
|
+
* Type for creating new links.
|
|
783
|
+
*
|
|
784
|
+
* Links are created by sources to represent external entities.
|
|
785
|
+
* Requires a source identifier for dedup/upsert.
|
|
786
|
+
*/
|
|
787
|
+
export type NewLink = ({
|
|
788
|
+
/** Unique identifier for the link, generated by Uuid.Generate() */
|
|
789
|
+
id: Uuid;
|
|
790
|
+
} | {
|
|
791
|
+
/**
|
|
792
|
+
* Canonical ID for the item in an external system.
|
|
793
|
+
* When set, uniquely identifies the link within a priority tree. This performs
|
|
794
|
+
* an upsert.
|
|
795
|
+
*/
|
|
796
|
+
source: string;
|
|
797
|
+
} | {}) & Partial<Omit<Link, "id" | "source" | "author" | "assignee" | "threadId">> & {
|
|
798
|
+
/** The person that created the item. By default, it will be the twist itself. */
|
|
799
|
+
author?: NewActor;
|
|
800
|
+
/** The person assigned to the item. */
|
|
801
|
+
assignee?: NewActor | null;
|
|
802
|
+
/**
|
|
803
|
+
* Whether the thread should be marked as unread for users.
|
|
804
|
+
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
805
|
+
* as read for the author if they are the twist owner (user)
|
|
806
|
+
* - false: Thread is marked as read for all users in the priority at creation time
|
|
807
|
+
*/
|
|
808
|
+
unread?: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* Whether the thread is archived.
|
|
811
|
+
* - true: Archive the thread
|
|
812
|
+
* - false: Unarchive the thread
|
|
813
|
+
* - undefined (default): Preserve current archive state
|
|
814
|
+
*/
|
|
815
|
+
archived?: boolean;
|
|
816
|
+
/**
|
|
817
|
+
* Configuration for automatic priority selection based on similarity.
|
|
818
|
+
* Only used when the link creates a new thread.
|
|
819
|
+
*/
|
|
820
|
+
pickPriority?: PickPriorityConfig;
|
|
821
|
+
/**
|
|
822
|
+
* Explicit priority (disables automatic priority matching).
|
|
823
|
+
* Only used when the link creates a new thread.
|
|
824
|
+
*/
|
|
825
|
+
priority?: Pick<Priority, "id">;
|
|
826
|
+
};
|
|
827
|
+
/**
|
|
828
|
+
* A new link with notes to save via integrations.saveLink().
|
|
829
|
+
* Creates a thread+link pair, with notes attached to the thread.
|
|
830
|
+
*/
|
|
831
|
+
export type NewLinkWithNotes = NewLink & {
|
|
832
|
+
/** Title for the link and its thread container */
|
|
833
|
+
title: string;
|
|
834
|
+
/** Notes to attach to the thread */
|
|
835
|
+
notes?: Omit<NewNote, "thread">[];
|
|
836
|
+
/** Schedules to create for the link */
|
|
837
|
+
schedules?: Array<Omit<NewSchedule, "threadId">>;
|
|
838
|
+
/** Schedule occurrence overrides */
|
|
839
|
+
scheduleOccurrences?: NewScheduleOccurrence[];
|
|
840
|
+
};
|
|
1175
841
|
//# sourceMappingURL=plot.d.ts.map
|