@plotday/twister 0.53.0 → 0.55.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/dist/connector.d.ts +47 -6
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +2 -1
- package/dist/connector.js.map +1 -1
- 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.Connector.html +26 -25
- package/dist/docs/classes/index.FileNotFoundError.html +1 -1
- package/dist/docs/classes/index.Files.html +2 -2
- package/dist/docs/classes/index.Imap.html +1 -1
- package/dist/docs/classes/index.Options.html +1 -1
- package/dist/docs/classes/index.Smtp.html +1 -1
- package/dist/docs/classes/tools_ai.AI.html +7 -5
- package/dist/docs/classes/tools_callbacks.Callbacks.html +1 -1
- package/dist/docs/classes/tools_integrations.Integrations.html +11 -11
- package/dist/docs/classes/tools_network.Network.html +1 -1
- package/dist/docs/classes/tools_plot.Plot.html +62 -56
- 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 +2 -2
- package/dist/docs/classes/twist.Twist.html +3 -3
- package/dist/docs/enums/plot.ActionType.html +9 -9
- package/dist/docs/enums/plot.ActorType.html +4 -4
- package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
- package/dist/docs/enums/plot.ThemeColor.html +1 -1
- package/dist/docs/enums/tools_ai.AIModel.html +2 -2
- package/dist/docs/enums/tools_integrations.AuthProvider.html +13 -13
- package/dist/docs/enums/{tools_plot.PriorityAccess.html → tools_plot.FocusAccess.html} +6 -6
- package/dist/docs/enums/tools_plot.ThreadAccess.html +1 -1
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/interfaces/tools_ai.AIRequest.html +27 -11
- package/dist/docs/interfaces/tools_ai.AIResponse.html +9 -9
- package/dist/docs/interfaces/tools_ai.FilePart.html +5 -5
- package/dist/docs/interfaces/tools_ai.ImagePart.html +4 -4
- package/dist/docs/interfaces/tools_ai.ReasoningPart.html +4 -4
- package/dist/docs/interfaces/tools_ai.RedactedReasoningPart.html +3 -3
- package/dist/docs/interfaces/tools_ai.TextPart.html +3 -3
- package/dist/docs/interfaces/tools_ai.ToolCallPart.html +5 -5
- package/dist/docs/interfaces/tools_ai.ToolExecutionOptions.html +4 -4
- package/dist/docs/interfaces/tools_ai.ToolResultPart.html +5 -5
- package/dist/docs/media/AGENTS.md +1 -1
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/plot.html +1 -1
- package/dist/docs/modules/tools_plot.html +1 -1
- package/dist/docs/types/index.CreateLinkDraft.html +14 -13
- package/dist/docs/types/index.OptionalScopeGroup.html +12 -0
- package/dist/docs/types/index.ResolvedRecipient.html +13 -2
- package/dist/docs/types/index.Schedule.html +1 -1
- package/dist/docs/types/index.ScopeConfig.html +9 -0
- package/dist/docs/types/plot.Action.html +1 -1
- package/dist/docs/types/plot.Actor.html +5 -5
- package/dist/docs/types/plot.Contact.html +4 -4
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.Focus.html +18 -0
- package/dist/docs/types/plot.FocusUpdate.html +3 -0
- package/dist/docs/types/plot.Link.html +16 -16
- package/dist/docs/types/plot.LinkUpdate.html +1 -1
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +1 -1
- package/dist/docs/types/plot.NewFocus.html +13 -0
- package/dist/docs/types/plot.NewLink.html +6 -6
- package/dist/docs/types/plot.NewLinkWithNotes.html +1 -1
- package/dist/docs/types/plot.NewNote.html +2 -2
- package/dist/docs/types/plot.NewReactions.html +1 -1
- package/dist/docs/types/plot.NewTags.html +1 -1
- package/dist/docs/types/plot.NewThread.html +4 -4
- package/dist/docs/types/plot.NewThreadWithNotes.html +1 -1
- package/dist/docs/types/plot.Note.html +2 -2
- package/dist/docs/types/plot.NoteUpdate.html +1 -1
- package/dist/docs/types/plot.PlanOperation.html +6 -6
- package/dist/docs/types/plot.Reaction.html +1 -1
- package/dist/docs/types/plot.Reactions.html +1 -1
- package/dist/docs/types/plot.Tags.html +1 -1
- package/dist/docs/types/plot.Thread.html +1 -1
- package/dist/docs/types/plot.ThreadAccessLevel.html +3 -3
- package/dist/docs/types/plot.ThreadCommon.html +6 -6
- package/dist/docs/types/plot.ThreadFilter.html +2 -2
- package/dist/docs/types/plot.ThreadMeta.html +1 -1
- package/dist/docs/types/plot.ThreadType.html +4 -4
- package/dist/docs/types/plot.ThreadUpdate.html +1 -1
- package/dist/docs/types/plot.ThreadWithNotes.html +1 -1
- package/dist/docs/types/tools_ai.AIAssistantMessage.html +2 -2
- package/dist/docs/types/tools_ai.AICapabilities.html +7 -3
- package/dist/docs/types/tools_ai.AIMessage.html +1 -1
- package/dist/docs/types/tools_ai.AIOptions.html +2 -2
- package/dist/docs/types/tools_ai.AISource.html +1 -1
- package/dist/docs/types/tools_ai.AISystemMessage.html +2 -2
- package/dist/docs/types/tools_ai.AITool.html +10 -9
- package/dist/docs/types/tools_ai.AIToolMessage.html +2 -2
- package/dist/docs/types/tools_ai.AIToolSet.html +1 -1
- package/dist/docs/types/tools_ai.AIUsage.html +5 -5
- package/dist/docs/types/tools_ai.AIUserMessage.html +2 -2
- package/dist/docs/types/tools_ai.DataContent.html +1 -1
- package/dist/docs/types/tools_ai.ModelPreferences.html +4 -4
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +5 -5
- 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 +23 -4
- package/dist/docs/types/tools_integrations.ComposeConfig.html +4 -4
- package/dist/docs/types/tools_integrations.ContactRoleConfig.html +5 -5
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +57 -28
- package/dist/docs/types/tools_integrations.SyncContext.html +3 -3
- package/dist/docs/types/tools_plot.SearchOptions.html +5 -6
- package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
- package/dist/llm-docs/connector.d.ts +1 -1
- package/dist/llm-docs/connector.d.ts.map +1 -1
- package/dist/llm-docs/connector.js +1 -1
- package/dist/llm-docs/connector.js.map +1 -1
- 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 +1 -1
- package/dist/llm-docs/schedule.d.ts.map +1 -1
- package/dist/llm-docs/schedule.js +1 -1
- package/dist/llm-docs/schedule.js.map +1 -1
- package/dist/llm-docs/tools/ai.d.ts +1 -1
- package/dist/llm-docs/tools/ai.d.ts.map +1 -1
- package/dist/llm-docs/tools/ai.js +1 -1
- package/dist/llm-docs/tools/ai.js.map +1 -1
- package/dist/llm-docs/tools/files.d.ts +1 -1
- package/dist/llm-docs/tools/files.d.ts.map +1 -1
- package/dist/llm-docs/tools/files.js +1 -1
- package/dist/llm-docs/tools/files.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.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/plot.d.ts +62 -82
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js +1 -1
- package/dist/plot.js.map +1 -1
- package/dist/schedule.d.ts +1 -1
- package/dist/tools/ai.d.ts +46 -10
- package/dist/tools/ai.d.ts.map +1 -1
- package/dist/tools/ai.js.map +1 -1
- package/dist/tools/files.d.ts +1 -1
- package/dist/tools/integrations.d.ts +80 -24
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/plot.d.ts +66 -56
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js +14 -14
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/twists.d.ts +2 -2
- package/dist/twist.d.ts +3 -3
- package/dist/twist.js +3 -3
- package/package.json +1 -1
- package/src/connector.ts +49 -6
- package/src/llm-docs/connector.ts +1 -1
- package/src/llm-docs/plot.ts +1 -1
- package/src/llm-docs/schedule.ts +1 -1
- package/src/llm-docs/tools/ai.ts +1 -1
- package/src/llm-docs/tools/files.ts +1 -1
- package/src/llm-docs/tools/integrations.ts +1 -1
- package/src/llm-docs/tools/plot.ts +1 -1
- package/src/llm-docs/tools/twists.ts +1 -1
- package/src/llm-docs/twist.ts +1 -1
- package/src/plot.ts +63 -72
- package/src/schedule.ts +1 -1
- package/src/tools/ai.ts +46 -10
- package/src/tools/files.ts +1 -1
- package/src/tools/integrations.ts +80 -24
- package/src/tools/plot.ts +69 -59
- package/src/tools/twists.ts +2 -2
- package/src/twist.ts +3 -3
- package/dist/docs/types/plot.NewPriority.html +0 -15
- package/dist/docs/types/plot.Priority.html +0 -15
- package/dist/docs/types/plot.PriorityUpdate.html +0 -5
package/src/plot.ts
CHANGED
|
@@ -11,13 +11,13 @@ export { type AuthProvider } from "./tools/integrations";
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @fileoverview
|
|
14
|
-
* Core Plot entity types for working with threads, notes,
|
|
14
|
+
* Core Plot entity types for working with threads, notes, focuses, and contacts.
|
|
15
15
|
*
|
|
16
16
|
* ## Type Pattern: Null vs Undefined Semantics
|
|
17
17
|
*
|
|
18
18
|
* Plot entity types use a consistent pattern to distinguish between missing, unset, and explicitly cleared values:
|
|
19
19
|
*
|
|
20
|
-
* ### Entity Types (Thread,
|
|
20
|
+
* ### Entity Types (Thread, Focus, Note, Actor)
|
|
21
21
|
* - **Required fields**: No `?`, cannot be `undefined`
|
|
22
22
|
* - Example: `id: Uuid`, `title: string`
|
|
23
23
|
* - **Nullable fields**: Use `| null` to allow explicit clearing
|
|
@@ -30,10 +30,10 @@ export { type AuthProvider } from "./tools/integrations";
|
|
|
30
30
|
* - `null` = field included but not set
|
|
31
31
|
* - Value = field has a value
|
|
32
32
|
*
|
|
33
|
-
* ### New* Types (NewThread, NewNote,
|
|
33
|
+
* ### New* Types (NewThread, NewNote, NewFocus)
|
|
34
34
|
* Used for creating or updating entities. Support partial updates by distinguishing omitted vs cleared fields:
|
|
35
35
|
* - **Required fields**: Must be provided (no `?`)
|
|
36
|
-
* - Example: `title: string` in
|
|
36
|
+
* - Example: `title: string` in NewFocus
|
|
37
37
|
* - **Optional fields**: Use `?` to make them optional
|
|
38
38
|
* - Example: `title?: string`, `author?: NewActor`
|
|
39
39
|
* - `undefined` (omitted) = don't set/update this field
|
|
@@ -76,7 +76,7 @@ export { type AuthProvider } from "./tools/integrations";
|
|
|
76
76
|
export type ActorId = string & { readonly __brand: "ActorId" };
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* Theme colors for
|
|
79
|
+
* Theme colors for focuses.
|
|
80
80
|
*/
|
|
81
81
|
export enum ThemeColor {
|
|
82
82
|
/** Catalyst - Green */
|
|
@@ -98,73 +98,67 @@ export enum ThemeColor {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Represents a
|
|
101
|
+
* Represents a focus within Plot.
|
|
102
102
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
103
|
+
* A focus is similar to a project or area-of-life. All Activity is in a Focus.
|
|
104
|
+
* Focuses are flat — they have no parent and no children. Threads not matched
|
|
105
|
+
* to any focus live in the Inbox.
|
|
105
106
|
*/
|
|
106
|
-
export type
|
|
107
|
-
/** Unique identifier for the
|
|
107
|
+
export type Focus = {
|
|
108
|
+
/** Unique identifier for the focus */
|
|
108
109
|
id: Uuid;
|
|
109
|
-
/** Human-readable title for the
|
|
110
|
+
/** Human-readable title for the focus */
|
|
110
111
|
title: string;
|
|
111
|
-
/** Whether this
|
|
112
|
+
/** Whether this focus has been archived */
|
|
112
113
|
archived: boolean;
|
|
113
114
|
/**
|
|
114
|
-
* Optional key for referencing this
|
|
115
|
-
* Keys are unique per
|
|
115
|
+
* Optional key for referencing this focus.
|
|
116
|
+
* Keys are unique per user.
|
|
116
117
|
*/
|
|
117
118
|
key: string | null;
|
|
118
|
-
/** Optional theme color for the
|
|
119
|
+
/** Optional theme color for the focus (0-7). Defaults to 7 (Resolution) when not set. */
|
|
119
120
|
color: ThemeColor | null;
|
|
121
|
+
/** Optional icon for the focus (a curated icon key). Defaults to the focus icon when not set. */
|
|
122
|
+
icon: string | null;
|
|
120
123
|
};
|
|
121
124
|
|
|
122
125
|
/**
|
|
123
|
-
* Type for creating new
|
|
126
|
+
* Type for creating new focuses.
|
|
124
127
|
*
|
|
125
128
|
* Supports multiple creation patterns:
|
|
126
|
-
* - Provide a specific UUID for the
|
|
127
|
-
* - Provide a key for upsert within the user's
|
|
129
|
+
* - Provide a specific UUID for the focus
|
|
130
|
+
* - Provide a key for upsert within the user's focuses
|
|
128
131
|
* - Omit both to auto-generate a new UUID
|
|
129
|
-
*
|
|
130
|
-
* Optionally specify a parent priority by ID or key for hierarchical structures.
|
|
131
132
|
*/
|
|
132
|
-
export type
|
|
133
|
-
Partial<Omit<
|
|
133
|
+
export type NewFocus = Pick<Focus, "title"> &
|
|
134
|
+
Partial<Omit<Focus, "id" | "title">> &
|
|
134
135
|
(
|
|
135
136
|
| {
|
|
136
137
|
/**
|
|
137
|
-
* Unique identifier for the
|
|
138
|
-
* Specifying an ID allows tools to track and upsert
|
|
138
|
+
* Unique identifier for the focus, generated by Uuid.Generate().
|
|
139
|
+
* Specifying an ID allows tools to track and upsert focuses.
|
|
139
140
|
*/
|
|
140
141
|
id: Uuid;
|
|
141
142
|
}
|
|
142
143
|
| {
|
|
143
144
|
/**
|
|
144
|
-
* Unique key for the
|
|
145
|
+
* Unique key for the focus within the user's focuses.
|
|
145
146
|
* Can be used to upsert without knowing the UUID.
|
|
146
|
-
* For example, "@plot" identifies the Plot
|
|
147
|
+
* For example, "@plot" identifies the Plot focus.
|
|
147
148
|
*/
|
|
148
149
|
key: string;
|
|
149
150
|
}
|
|
150
151
|
| {
|
|
151
152
|
/* Neither id nor key is required. An id will be generated and returned. */
|
|
152
153
|
}
|
|
153
|
-
)
|
|
154
|
-
/** Add the new priority as the child of another priority */
|
|
155
|
-
parent?: { id: Uuid } | { key: string };
|
|
156
|
-
};
|
|
154
|
+
);
|
|
157
155
|
|
|
158
156
|
/**
|
|
159
|
-
* Type for updating existing
|
|
160
|
-
* Must provide either id or key to identify the
|
|
161
|
-
* Set `parent` to move the priority under a new parent (requires PriorityAccess.Full).
|
|
157
|
+
* Type for updating existing focuses.
|
|
158
|
+
* Must provide either id or key to identify the focus to update.
|
|
162
159
|
*/
|
|
163
|
-
export type
|
|
164
|
-
Partial<Pick<
|
|
165
|
-
/** Move the priority under a new parent. Requires PriorityAccess.Full. */
|
|
166
|
-
parent?: { id: Uuid } | { key: string };
|
|
167
|
-
};
|
|
160
|
+
export type FocusUpdate = ({ id: Uuid } | { key: string }) &
|
|
161
|
+
Partial<Pick<Focus, "title" | "archived">>;
|
|
168
162
|
|
|
169
163
|
/**
|
|
170
164
|
* Enumeration of supported action types.
|
|
@@ -375,9 +369,9 @@ export type ThreadMeta = {
|
|
|
375
369
|
|
|
376
370
|
/**
|
|
377
371
|
* Thread sub-type that determines the thread's icon and category.
|
|
378
|
-
* Available types depend on whether the
|
|
379
|
-
* - Private
|
|
380
|
-
* - Shared
|
|
372
|
+
* Available types depend on whether the focus is shared:
|
|
373
|
+
* - Private focuses: "action" (default for tasks), "notes" (default), "idea", "goal", "decision"
|
|
374
|
+
* - Shared focuses: all above plus "discussion" (default), "announcement", "ask"
|
|
381
375
|
*/
|
|
382
376
|
export type ThreadType =
|
|
383
377
|
| "action"
|
|
@@ -430,8 +424,8 @@ export type NewReactions = Record<Reaction, NewActor[]>;
|
|
|
430
424
|
|
|
431
425
|
/**
|
|
432
426
|
* Thread access level determining visibility.
|
|
433
|
-
* - "public": Visible to all users with
|
|
434
|
-
* - "members": Visible to
|
|
427
|
+
* - "public": Visible to all users with focus access
|
|
428
|
+
* - "members": Visible to focus members (default for shared focuses)
|
|
435
429
|
* - "private": Visible only to creator and contacts listed in accessContacts
|
|
436
430
|
*/
|
|
437
431
|
export type ThreadAccessLevel = "public" | "members" | "private";
|
|
@@ -469,8 +463,8 @@ export type ThreadCommon = {
|
|
|
469
463
|
type ThreadFields = ThreadCommon & {
|
|
470
464
|
/** The display title/summary of the thread */
|
|
471
465
|
title: string;
|
|
472
|
-
/** The
|
|
473
|
-
|
|
466
|
+
/** The focus context this thread belongs to */
|
|
467
|
+
focus: Focus;
|
|
474
468
|
/** The thread's sub-type/category. Determines the displayed icon. */
|
|
475
469
|
type: ThreadType | null;
|
|
476
470
|
/** Thread access level: "public", "members", or "private" */
|
|
@@ -506,7 +500,7 @@ export type NewThreadWithNotes = NewThread & {
|
|
|
506
500
|
* ```
|
|
507
501
|
*/
|
|
508
502
|
export type NewThread = Partial<
|
|
509
|
-
Omit<ThreadFields, "
|
|
503
|
+
Omit<ThreadFields, "focus" | "tags" | "reactions" | "id" | "accessContacts">
|
|
510
504
|
> &
|
|
511
505
|
(
|
|
512
506
|
| {
|
|
@@ -518,8 +512,8 @@ export type NewThread = Partial<
|
|
|
518
512
|
}
|
|
519
513
|
) &
|
|
520
514
|
{
|
|
521
|
-
/** Explicit
|
|
522
|
-
|
|
515
|
+
/** Explicit focus - disables automatic focus matching. When omitted, the server classifies the thread using the user's focus rules. */
|
|
516
|
+
focus?: Pick<Focus, "id">;
|
|
523
517
|
} & {
|
|
524
518
|
/**
|
|
525
519
|
* All tags to set on the new thread.
|
|
@@ -550,7 +544,7 @@ export type NewThread = Partial<
|
|
|
550
544
|
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
551
545
|
* as read for the author if they are the twist owner (user)
|
|
552
546
|
* - true: Thread is explicitly unread for ALL users (use sparingly)
|
|
553
|
-
* - false: Thread is marked as read for all users in the
|
|
547
|
+
* - false: Thread is marked as read for all users in the focus at creation time
|
|
554
548
|
*/
|
|
555
549
|
unread?: boolean;
|
|
556
550
|
|
|
@@ -638,10 +632,10 @@ type ThreadSingleUpdateFields = ThreadBulkUpdateFields & {
|
|
|
638
632
|
preview?: string | null;
|
|
639
633
|
|
|
640
634
|
/**
|
|
641
|
-
* Move the thread to a different
|
|
642
|
-
* The target
|
|
635
|
+
* Move the thread to a different focus. Requires ThreadAccess.Full.
|
|
636
|
+
* The target focus must be owned by the twist's user.
|
|
643
637
|
*/
|
|
644
|
-
|
|
638
|
+
focus?: Pick<Focus, "id">;
|
|
645
639
|
};
|
|
646
640
|
|
|
647
641
|
export type ThreadUpdate =
|
|
@@ -699,7 +693,7 @@ export type Note = ThreadCommon & {
|
|
|
699
693
|
* When set (even to []), the note is private to the listed contacts plus the creator.
|
|
700
694
|
*/
|
|
701
695
|
accessContacts: ActorId[] | null;
|
|
702
|
-
/**
|
|
696
|
+
/** Focus twist IDs (twists/connectors) mentioned for dispatch routing. Does not include user contacts. */
|
|
703
697
|
mentions: ActorId[];
|
|
704
698
|
};
|
|
705
699
|
|
|
@@ -771,7 +765,7 @@ export type NewNote = Partial<
|
|
|
771
765
|
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
772
766
|
* as read for the author if they are the twist owner (user)
|
|
773
767
|
* - true: Thread is explicitly unread for ALL users (use sparingly)
|
|
774
|
-
* - false: Thread is marked as read for all users in the
|
|
768
|
+
* - false: Thread is marked as read for all users in the focus at note creation time
|
|
775
769
|
*
|
|
776
770
|
* For the default behavior, omit this field entirely.
|
|
777
771
|
* Use false for initial sync to avoid marking historical items as unread.
|
|
@@ -1044,7 +1038,7 @@ export type NewLink = Partial<
|
|
|
1044
1038
|
> & {
|
|
1045
1039
|
/**
|
|
1046
1040
|
* Canonical ID for the item in an external system.
|
|
1047
|
-
* When set, uniquely identifies the link
|
|
1041
|
+
* When set, uniquely identifies the link for the user. This performs
|
|
1048
1042
|
* an upsert.
|
|
1049
1043
|
*
|
|
1050
1044
|
* @deprecated Pass `sources: [...]` instead. Both fields can be set during
|
|
@@ -1078,7 +1072,7 @@ export type NewLink = Partial<
|
|
|
1078
1072
|
* Whether the thread should be marked as unread for users.
|
|
1079
1073
|
* - undefined/omitted (default): Thread is unread for users, except auto-marked
|
|
1080
1074
|
* as read for the author if they are the twist owner (user)
|
|
1081
|
-
* - false: Thread is marked as read for all users in the
|
|
1075
|
+
* - false: Thread is marked as read for all users in the focus at creation time
|
|
1082
1076
|
*/
|
|
1083
1077
|
unread?: boolean;
|
|
1084
1078
|
/**
|
|
@@ -1089,11 +1083,11 @@ export type NewLink = Partial<
|
|
|
1089
1083
|
*/
|
|
1090
1084
|
archived?: boolean;
|
|
1091
1085
|
/**
|
|
1092
|
-
* Explicit
|
|
1086
|
+
* Explicit focus (disables automatic focus matching).
|
|
1093
1087
|
* Only used when the link creates a new thread. When omitted, the
|
|
1094
|
-
* server classifies the thread using the user's
|
|
1088
|
+
* server classifies the thread using the user's focus rules.
|
|
1095
1089
|
*/
|
|
1096
|
-
|
|
1090
|
+
focus?: Pick<Focus, "id">;
|
|
1097
1091
|
};
|
|
1098
1092
|
|
|
1099
1093
|
/**
|
|
@@ -1141,8 +1135,8 @@ export type PlanOperation =
|
|
|
1141
1135
|
/** Current thread title for display */
|
|
1142
1136
|
threadTitle: string;
|
|
1143
1137
|
changes: Partial<Pick<ThreadFields, "archived" | "title" | "type">> & {
|
|
1144
|
-
/** Move to this
|
|
1145
|
-
|
|
1138
|
+
/** Move to this focus */
|
|
1139
|
+
focus?: { id: Uuid; title: string };
|
|
1146
1140
|
};
|
|
1147
1141
|
}
|
|
1148
1142
|
| {
|
|
@@ -1159,9 +1153,9 @@ export type PlanOperation =
|
|
|
1159
1153
|
| {
|
|
1160
1154
|
type: "createThread";
|
|
1161
1155
|
title: string;
|
|
1162
|
-
|
|
1163
|
-
/**
|
|
1164
|
-
|
|
1156
|
+
focusId: Uuid;
|
|
1157
|
+
/** Focus title for display */
|
|
1158
|
+
focusTitle: string;
|
|
1165
1159
|
}
|
|
1166
1160
|
| {
|
|
1167
1161
|
type: "createNote";
|
|
@@ -1171,12 +1165,9 @@ export type PlanOperation =
|
|
|
1171
1165
|
content: string;
|
|
1172
1166
|
}
|
|
1173
1167
|
| {
|
|
1174
|
-
type: "
|
|
1175
|
-
|
|
1176
|
-
/** Current
|
|
1177
|
-
|
|
1178
|
-
changes: Partial<Pick<
|
|
1179
|
-
/** Move under this parent */
|
|
1180
|
-
parent?: { id: Uuid; title: string };
|
|
1181
|
-
};
|
|
1168
|
+
type: "updateFocus";
|
|
1169
|
+
focusId: Uuid;
|
|
1170
|
+
/** Current focus title for display */
|
|
1171
|
+
focusTitle: string;
|
|
1172
|
+
changes: Partial<Pick<Focus, "title" | "archived">>;
|
|
1182
1173
|
};
|
package/src/schedule.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { Uuid } from "./utils/uuid";
|
|
|
14
14
|
* Represents a schedule entry for a thread.
|
|
15
15
|
*
|
|
16
16
|
* Schedules define when a thread occurs in time. A thread may have zero or more schedules:
|
|
17
|
-
* - Shared schedules (userId is null): visible to all members of the thread's
|
|
17
|
+
* - Shared schedules (userId is null): visible to all members of the thread's focus
|
|
18
18
|
* - Per-user schedules (userId set): private ordering/scheduling for a specific user
|
|
19
19
|
*
|
|
20
20
|
* For recurring events in the SDK, start/end represent the first occurrence's
|
package/src/tools/ai.ts
CHANGED
|
@@ -69,8 +69,11 @@ export abstract class AI extends ITool {
|
|
|
69
69
|
* Returns which AI capabilities are currently available.
|
|
70
70
|
* Check this before calling prompt() or embed() to gracefully
|
|
71
71
|
* handle cases where AI is disabled by the user.
|
|
72
|
+
*
|
|
73
|
+
* Built-in tools are accessed as RPC stubs, so from a twist this call
|
|
74
|
+
* resolves asynchronously — always `await` it.
|
|
72
75
|
*/
|
|
73
|
-
abstract available(): AICapabilities
|
|
76
|
+
abstract available(): AICapabilities | Promise<AICapabilities>;
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
79
|
* Sends a request to an AI model and returns the response using the Vercel AI SDK.
|
|
@@ -134,7 +137,7 @@ export abstract class AI extends ITool {
|
|
|
134
137
|
* tools: {
|
|
135
138
|
* getWeather: {
|
|
136
139
|
* description: "Get weather for a city",
|
|
137
|
-
*
|
|
140
|
+
* inputSchema: Type.Object({
|
|
138
141
|
* city: Type.String()
|
|
139
142
|
* }),
|
|
140
143
|
* execute: async ({ city }) => {
|
|
@@ -165,6 +168,12 @@ export type AICapabilities = {
|
|
|
165
168
|
prompt: boolean;
|
|
166
169
|
/** Whether AI embedding generation is available. */
|
|
167
170
|
embed: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Whether provider-native web search is available. True for Plot AI and
|
|
173
|
+
* Anthropic/Google BYOK providers; false for OpenAI/custom BYOK providers
|
|
174
|
+
* that don't expose a server-side web search tool through this runtime.
|
|
175
|
+
*/
|
|
176
|
+
webSearch: boolean;
|
|
168
177
|
};
|
|
169
178
|
|
|
170
179
|
/**
|
|
@@ -345,6 +354,31 @@ export interface AIRequest<
|
|
|
345
354
|
* Controls diversity by limiting to top probability tokens.
|
|
346
355
|
*/
|
|
347
356
|
topP?: number;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Enable provider-native web search so the model can retrieve
|
|
360
|
+
* up-to-date information from the web. The search is executed
|
|
361
|
+
* server-side by the provider and any pages used are returned in
|
|
362
|
+
* {@link AIResponse.sources}.
|
|
363
|
+
*
|
|
364
|
+
* Only available on web-search-capable providers (Anthropic and
|
|
365
|
+
* Google). Check {@link AICapabilities.webSearch} via `available()`
|
|
366
|
+
* before relying on it; on unsupported providers the flag is ignored.
|
|
367
|
+
*
|
|
368
|
+
* Pass `true` for defaults, or an object to cap the number of searches.
|
|
369
|
+
*/
|
|
370
|
+
webSearch?: boolean | { maxUses?: number };
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Maximum number of sequential generation steps for agentic tool use.
|
|
374
|
+
* When the model calls a tool, its result is fed back and the model is
|
|
375
|
+
* called again, up to `maxSteps` times, until it produces a final answer.
|
|
376
|
+
*
|
|
377
|
+
* Defaults to 1 (single step — tool calls are returned but not looped),
|
|
378
|
+
* preserving prior behavior. Set higher (e.g. 6) to let the model chain
|
|
379
|
+
* tool calls into a final answer.
|
|
380
|
+
*/
|
|
381
|
+
maxSteps?: number;
|
|
348
382
|
}
|
|
349
383
|
|
|
350
384
|
/**
|
|
@@ -742,17 +776,19 @@ export interface ToolExecutionOptions {
|
|
|
742
776
|
*/
|
|
743
777
|
export type AITool<PARAMETERS extends ToolParameters = any, RESULT = any> = {
|
|
744
778
|
/**
|
|
745
|
-
* The schema of the input that the tool expects
|
|
746
|
-
*
|
|
747
|
-
* Use descriptions to make the input
|
|
779
|
+
* The schema of the input that the tool expects, expressed as a Typebox
|
|
780
|
+
* schema. The language model uses this to generate (and the runtime to
|
|
781
|
+
* validate) the tool input. Use field descriptions to make the input
|
|
782
|
+
* understandable for the model.
|
|
783
|
+
*
|
|
784
|
+
* This is the canonical field read by the runtime. `parameters` is an
|
|
785
|
+
* accepted alias for backwards compatibility.
|
|
748
786
|
*/
|
|
749
|
-
|
|
787
|
+
inputSchema: TSchema;
|
|
750
788
|
/**
|
|
751
|
-
*
|
|
752
|
-
* It is also used to validate the output of the language model.
|
|
753
|
-
* Use descriptions to make the input understandable for the language model.
|
|
789
|
+
* @deprecated Alias for {@link inputSchema}. Prefer `inputSchema`.
|
|
754
790
|
*/
|
|
755
|
-
|
|
791
|
+
parameters?: PARAMETERS;
|
|
756
792
|
/**
|
|
757
793
|
* An optional description of what the tool does.
|
|
758
794
|
* Will be used by the language model to decide whether to use the tool.
|
package/src/tools/files.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { ITool } from "..";
|
|
|
14
14
|
*/
|
|
15
15
|
export abstract class Files extends ITool {
|
|
16
16
|
/**
|
|
17
|
-
* Read a file uploaded by a client and attached to a note in a
|
|
17
|
+
* Read a file uploaded by a client and attached to a note in a focus
|
|
18
18
|
* where this twist is installed.
|
|
19
19
|
*
|
|
20
20
|
* @param fileId The id from an ActionType.file action.
|
|
@@ -17,6 +17,26 @@ export type Channel = {
|
|
|
17
17
|
id: string;
|
|
18
18
|
/** Display name shown in the UI */
|
|
19
19
|
title: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether this channel should be selected by default when the user first
|
|
22
|
+
* adds the connection. Tri-state:
|
|
23
|
+
* - `true` — pre-select it (e.g. the user's own/primary calendar).
|
|
24
|
+
* - `false` — exclude it from the default selection (low-value or
|
|
25
|
+
* irrelevant resources that would crowd the user's view, or containers
|
|
26
|
+
* whose contents are too broad to sync wholesale — e.g. a holiday or
|
|
27
|
+
* someone-else's shared calendar, a GitHub org that cascades to every
|
|
28
|
+
* repo, a Microsoft Teams team container). The user can still enable it
|
|
29
|
+
* manually.
|
|
30
|
+
* - `undefined` — no opinion; the client decides. The client defaults to
|
|
31
|
+
* enabling the channel unless its title looks low-value (holidays,
|
|
32
|
+
* birthdays, spam/sent/draft, …).
|
|
33
|
+
*
|
|
34
|
+
* The guiding principle is "sync everything the user would reasonably want
|
|
35
|
+
* by default" — for most connectors that's all channels, so only set this
|
|
36
|
+
* where the connector can distinguish the user's own/relevant channels from
|
|
37
|
+
* low-value ones (e.g. Google Calendar via `accessRole === "owner"`).
|
|
38
|
+
*/
|
|
39
|
+
enabledByDefault?: boolean;
|
|
20
40
|
/** Optional nested channel resources (e.g., subfolders) */
|
|
21
41
|
children?: Channel[];
|
|
22
42
|
/** Per-channel link type configs. Overrides twist-level linkTypes when present. */
|
|
@@ -39,6 +59,28 @@ export type LinkTypeConfig = {
|
|
|
39
59
|
* when omitted. Use the singular noun in title case (e.g. "Comment").
|
|
40
60
|
*/
|
|
41
61
|
noteLabel?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Placeholder shown in the editor when this link type is the target of a
|
|
64
|
+
* new thread (NewThreadPage). Example: "Send a Gmail email".
|
|
65
|
+
* If unset, Plot derives "Create a new {connector} {label.toLowerCase()}".
|
|
66
|
+
*/
|
|
67
|
+
composePlaceholder?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Label for the Send button on NewThreadPage when this link type is the
|
|
70
|
+
* target. Example: "Send". If unset, defaults to "Create".
|
|
71
|
+
*/
|
|
72
|
+
composeVerb?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Placeholder shown in the in-thread editor for the default reply mode.
|
|
75
|
+
* Example: "Reply" (Gmail), "Add a comment" (Linear). If unset, Plot derives
|
|
76
|
+
* "Add a {noteLabel.toLowerCase()}" or "Add a note".
|
|
77
|
+
*/
|
|
78
|
+
replyPlaceholder?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Label for the Send button in the in-thread editor. Example: "Send"
|
|
81
|
+
* (Gmail), "Comment" (Linear). If unset, defaults to "Send".
|
|
82
|
+
*/
|
|
83
|
+
replyVerb?: string;
|
|
42
84
|
/** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */
|
|
43
85
|
logo?: string;
|
|
44
86
|
/** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */
|
|
@@ -62,32 +104,26 @@ export type LinkTypeConfig = {
|
|
|
62
104
|
*/
|
|
63
105
|
active?: boolean;
|
|
64
106
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
task?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Mark the thread `to_read=true` in Plot when a link enters this status.
|
|
74
|
-
* Use for connectors that explicitly track read-later state (Pocket
|
|
75
|
-
* archives, Slack "remind me", etc).
|
|
76
|
-
*/
|
|
77
|
-
toRead?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated Use `active` (messaging) or `task` (project tracker) instead.
|
|
80
|
-
* Treated as `task: true` for backward compatibility.
|
|
81
|
-
*
|
|
82
|
-
* Original meaning: whether this status represents the connector's
|
|
83
|
-
* "to-do" / active state. When a user adds a thread to Plot's agenda,
|
|
84
|
-
* done-status links flip to the status marked `todo: true` (e.g.,
|
|
85
|
-
* Gmail's "starred", Linear's "todo").
|
|
107
|
+
* Marks this status as the connector's "to-do" / active state. When a
|
|
108
|
+
* user brings a done thread back into Plot's agenda, done-status links
|
|
109
|
+
* are flipped to the status marked `todo: true` (e.g. Gmail's "starred",
|
|
110
|
+
* Linear's "unstarted"); connectors that don't mark one fall back to the
|
|
111
|
+
* first non-done status.
|
|
86
112
|
*/
|
|
87
113
|
todo?: boolean;
|
|
88
114
|
}>;
|
|
89
115
|
/** Whether this link type supports displaying and changing the assignee */
|
|
90
116
|
supportsAssignee?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Whether this link type produces time-anchored schedule/agenda items
|
|
119
|
+
* (i.e. calendar events). The Plot app shows the agenda (the bottom-nav
|
|
120
|
+
* tab on mobile and the left-sidebar agenda on desktop) only when the
|
|
121
|
+
* user has at least one active connection whose link types include one
|
|
122
|
+
* with `includesSchedules: true`. Calendar connectors (Google / Apple /
|
|
123
|
+
* Outlook Calendar) set this on their `event` link type. Defaults to
|
|
124
|
+
* false — non-calendar link types (messages, issues, tasks, docs) omit it.
|
|
125
|
+
*/
|
|
126
|
+
includesSchedules?: boolean;
|
|
91
127
|
/** Default thread creation mode for this link type: 'all' | 'actionable' | 'manual' */
|
|
92
128
|
defaultCreateThreads?: string;
|
|
93
129
|
/**
|
|
@@ -119,6 +155,22 @@ export type LinkTypeConfig = {
|
|
|
119
155
|
* false when omitted.
|
|
120
156
|
*/
|
|
121
157
|
supportsContactChanges?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Whether a note/reply on this link type can carry a link (a pasted URL or
|
|
160
|
+
* connector-created item) that Plot forwards to the source. When false (the
|
|
161
|
+
* default), the "Add link" button is hidden for threads of this link type.
|
|
162
|
+
* Only set true if the connector's reply path actually forwards the link
|
|
163
|
+
* action to the source. Private Plot notes (no link type) always allow links.
|
|
164
|
+
*/
|
|
165
|
+
supportsLinks?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether a note/reply on this link type can carry an uploaded file that Plot
|
|
168
|
+
* forwards to the source as an attachment. When false (the default), the
|
|
169
|
+
* "Attach file" button is hidden for threads of this link type. Only set true
|
|
170
|
+
* if the connector's reply path actually uploads file actions to the source.
|
|
171
|
+
* Private Plot notes (no link type) always allow attachments.
|
|
172
|
+
*/
|
|
173
|
+
supportsFileAttachments?: boolean;
|
|
122
174
|
/**
|
|
123
175
|
* Declares how sharing on threads of this link type is scoped:
|
|
124
176
|
*
|
|
@@ -130,12 +182,16 @@ export type LinkTypeConfig = {
|
|
|
130
182
|
* - `"message"`: each note carries its own recipient set via
|
|
131
183
|
* `note.access_contacts`; the thread roster is the union across
|
|
132
184
|
* all messages. Email.
|
|
185
|
+
* - `"none"`: the link type has no recipient roster at all. No
|
|
186
|
+
* contacts/sharing UI is shown for these threads. Use for purely
|
|
187
|
+
* personal destinations with no sharing concept (e.g. Google
|
|
188
|
+
* Tasks). The per-thread `contacts` array is ignored for sharing UI.
|
|
133
189
|
*
|
|
134
190
|
* Omit to default to `"thread"`. When set to `"message"`, every
|
|
135
191
|
* note this connector ingests must populate `access_contacts`
|
|
136
192
|
* explicitly (never NULL).
|
|
137
193
|
*/
|
|
138
|
-
sharingModel?: "thread" | "channel" | "message";
|
|
194
|
+
sharingModel?: "thread" | "channel" | "message" | "none";
|
|
139
195
|
};
|
|
140
196
|
|
|
141
197
|
/**
|
|
@@ -316,7 +372,7 @@ export abstract class Integrations extends ITool {
|
|
|
316
372
|
abstract get(provider: AuthProvider, channelId: string): Promise<AuthToken | null>;
|
|
317
373
|
|
|
318
374
|
/**
|
|
319
|
-
* Saves a link with notes to the connector's
|
|
375
|
+
* Saves a link with notes to the connector's focus.
|
|
320
376
|
*
|
|
321
377
|
* Creates a thread+link pair. The thread is a lightweight container;
|
|
322
378
|
* the link holds the external entity data (source, meta, type, status, etc.).
|
|
@@ -355,7 +411,7 @@ export abstract class Integrations extends ITool {
|
|
|
355
411
|
abstract saveLinks(links: NewLinkWithNotes[]): Promise<(Uuid | null)[]>;
|
|
356
412
|
|
|
357
413
|
/**
|
|
358
|
-
* Upserts contacts into the connector's
|
|
414
|
+
* Upserts contacts into the connector's focus without requiring a Link.
|
|
359
415
|
*
|
|
360
416
|
* Use this for messaging connectors to bulk-sync workspace members so the
|
|
361
417
|
* recipient picker can filter contacts by reachable platform account. Populate
|