@plotday/twister 0.36.0 → 0.38.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.
Files changed (243) hide show
  1. package/README.md +4 -2
  2. package/bin/commands/create.js +37 -3
  3. package/bin/commands/create.js.map +1 -1
  4. package/bin/commands/deploy.js +4 -0
  5. package/bin/commands/deploy.js.map +1 -1
  6. package/bin/index.js +1 -0
  7. package/bin/index.js.map +1 -1
  8. package/bin/templates/AGENTS.template.md +101 -189
  9. package/bin/templates/README.template.md +2 -23
  10. package/cli/templates/AGENTS.template.md +101 -189
  11. package/cli/templates/README.template.md +2 -23
  12. package/dist/docs/assets/hierarchy.js +1 -1
  13. package/dist/docs/assets/navigation.js +1 -1
  14. package/dist/docs/assets/search.js +1 -1
  15. package/dist/docs/classes/index.Options.html +1 -1
  16. package/dist/docs/classes/index.Source.html +200 -0
  17. package/dist/docs/classes/tool.ITool.html +1 -1
  18. package/dist/docs/classes/tool.Tool.html +21 -21
  19. package/dist/docs/classes/tools_ai.AI.html +1 -1
  20. package/dist/docs/classes/tools_callbacks.Callbacks.html +2 -2
  21. package/dist/docs/classes/tools_integrations.Integrations.html +45 -16
  22. package/dist/docs/classes/tools_network.Network.html +1 -1
  23. package/dist/docs/classes/tools_plot.Plot.html +93 -60
  24. package/dist/docs/classes/tools_store.Store.html +1 -1
  25. package/dist/docs/classes/tools_tasks.Tasks.html +1 -1
  26. package/dist/docs/classes/tools_twists.Twists.html +1 -1
  27. package/dist/docs/classes/twist.Twist.html +42 -10
  28. package/dist/docs/documents/Building_Sources.html +137 -0
  29. package/dist/docs/documents/Built-in_Tools.html +11 -2
  30. package/dist/docs/documents/Core_Concepts.html +5 -10
  31. package/dist/docs/documents/Getting_Started.html +1 -1
  32. package/dist/docs/enums/{plot.ActivityLinkType.html → plot.ActionType.html} +10 -8
  33. package/dist/docs/enums/plot.ActorType.html +7 -7
  34. package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
  35. package/dist/docs/enums/plot.ThemeColor.html +9 -9
  36. package/dist/docs/enums/tag.Tag.html +3 -10
  37. package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
  38. package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
  39. package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
  40. package/dist/docs/enums/{tools_plot.ActivityAccess.html → tools_plot.ThreadAccess.html} +6 -6
  41. package/dist/docs/hierarchy.html +1 -1
  42. package/dist/docs/index.html +5 -6
  43. package/dist/docs/media/AGENTS.md +910 -0
  44. package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
  45. package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
  46. package/dist/docs/modules/index.html +1 -1
  47. package/dist/docs/modules/plot.html +1 -1
  48. package/dist/docs/modules/tool.html +1 -1
  49. package/dist/docs/modules/tools_integrations.html +1 -1
  50. package/dist/docs/modules/tools_plot.html +1 -1
  51. package/dist/docs/modules.html +1 -1
  52. package/dist/docs/types/index.NewSchedule.html +33 -0
  53. package/dist/docs/types/index.NewScheduleContact.html +5 -0
  54. package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
  55. package/dist/docs/types/index.Schedule.html +37 -0
  56. package/dist/docs/types/index.ScheduleContact.html +5 -0
  57. package/dist/docs/types/index.ScheduleContactRole.html +1 -0
  58. package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
  59. package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
  60. package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
  61. package/dist/docs/types/plot.Action.html +28 -0
  62. package/dist/docs/types/plot.Actor.html +6 -6
  63. package/dist/docs/types/plot.ActorId.html +1 -1
  64. package/dist/docs/types/plot.ContentType.html +1 -1
  65. package/dist/docs/types/plot.Link.html +36 -0
  66. package/dist/docs/types/plot.NewActor.html +1 -1
  67. package/dist/docs/types/plot.NewContact.html +5 -5
  68. package/dist/docs/types/plot.NewLink.html +26 -0
  69. package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
  70. package/dist/docs/types/plot.NewNote.html +10 -10
  71. package/dist/docs/types/plot.NewPriority.html +1 -1
  72. package/dist/docs/types/plot.NewTags.html +1 -1
  73. package/dist/docs/types/plot.NewThread.html +27 -0
  74. package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
  75. package/dist/docs/types/plot.Note.html +9 -8
  76. package/dist/docs/types/plot.NoteUpdate.html +2 -2
  77. package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
  78. package/dist/docs/types/plot.Priority.html +6 -6
  79. package/dist/docs/types/plot.PriorityUpdate.html +1 -1
  80. package/dist/docs/types/plot.Tags.html +1 -1
  81. package/dist/docs/types/plot.Thread.html +1 -0
  82. package/dist/docs/types/plot.ThreadCommon.html +17 -0
  83. package/dist/docs/types/plot.ThreadFilter.html +2 -0
  84. package/dist/docs/types/plot.ThreadMeta.html +11 -0
  85. package/dist/docs/types/plot.ThreadUpdate.html +3 -0
  86. package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
  87. package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
  88. package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
  89. package/dist/docs/types/tools_integrations.Authorization.html +4 -4
  90. package/dist/docs/types/tools_integrations.Channel.html +11 -0
  91. package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
  92. package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
  93. package/dist/docs/types/tools_plot.LinkSearchResult.html +1 -0
  94. package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
  95. package/dist/docs/types/tools_plot.NoteSearchResult.html +1 -0
  96. package/dist/docs/types/tools_plot.SearchOptions.html +7 -0
  97. package/dist/docs/types/tools_plot.SearchResult.html +1 -0
  98. package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
  99. package/dist/docs/variables/tools_plot.SEARCH_DEFAULT_LIMIT.html +2 -0
  100. package/dist/docs/variables/tools_plot.SEARCH_MAX_LIMIT.html +2 -0
  101. package/dist/index.d.ts +2 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +2 -0
  104. package/dist/index.js.map +1 -1
  105. package/dist/llm-docs/index.d.ts.map +1 -1
  106. package/dist/llm-docs/index.js +4 -8
  107. package/dist/llm-docs/index.js.map +1 -1
  108. package/dist/llm-docs/plot.d.ts +1 -1
  109. package/dist/llm-docs/plot.d.ts.map +1 -1
  110. package/dist/llm-docs/plot.js +1 -1
  111. package/dist/llm-docs/plot.js.map +1 -1
  112. package/dist/llm-docs/schedule.d.ts +9 -0
  113. package/dist/llm-docs/schedule.d.ts.map +1 -0
  114. package/dist/llm-docs/schedule.js +8 -0
  115. package/dist/llm-docs/schedule.js.map +1 -0
  116. package/dist/llm-docs/source.d.ts +9 -0
  117. package/dist/llm-docs/source.d.ts.map +1 -0
  118. package/dist/llm-docs/source.js +8 -0
  119. package/dist/llm-docs/source.js.map +1 -0
  120. package/dist/llm-docs/tag.d.ts +1 -1
  121. package/dist/llm-docs/tag.d.ts.map +1 -1
  122. package/dist/llm-docs/tag.js +1 -1
  123. package/dist/llm-docs/tag.js.map +1 -1
  124. package/dist/llm-docs/tool.d.ts +1 -1
  125. package/dist/llm-docs/tool.d.ts.map +1 -1
  126. package/dist/llm-docs/tool.js +1 -1
  127. package/dist/llm-docs/tool.js.map +1 -1
  128. package/dist/llm-docs/tools/callbacks.d.ts +1 -1
  129. package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
  130. package/dist/llm-docs/tools/callbacks.js +1 -1
  131. package/dist/llm-docs/tools/callbacks.js.map +1 -1
  132. package/dist/llm-docs/tools/integrations.d.ts +1 -1
  133. package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
  134. package/dist/llm-docs/tools/integrations.js +1 -1
  135. package/dist/llm-docs/tools/integrations.js.map +1 -1
  136. package/dist/llm-docs/tools/plot.d.ts +1 -1
  137. package/dist/llm-docs/tools/plot.d.ts.map +1 -1
  138. package/dist/llm-docs/tools/plot.js +1 -1
  139. package/dist/llm-docs/tools/plot.js.map +1 -1
  140. package/dist/llm-docs/tools/twists.d.ts +1 -1
  141. package/dist/llm-docs/tools/twists.d.ts.map +1 -1
  142. package/dist/llm-docs/tools/twists.js +1 -1
  143. package/dist/llm-docs/tools/twists.js.map +1 -1
  144. package/dist/llm-docs/twist-guide-template.d.ts +1 -1
  145. package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
  146. package/dist/llm-docs/twist-guide-template.js +1 -1
  147. package/dist/llm-docs/twist-guide-template.js.map +1 -1
  148. package/dist/llm-docs/twist.d.ts +1 -1
  149. package/dist/llm-docs/twist.d.ts.map +1 -1
  150. package/dist/llm-docs/twist.js +1 -1
  151. package/dist/llm-docs/twist.js.map +1 -1
  152. package/dist/plot.d.ts +264 -589
  153. package/dist/plot.d.ts.map +1 -1
  154. package/dist/plot.js +18 -49
  155. package/dist/plot.js.map +1 -1
  156. package/dist/schedule.d.ts +172 -0
  157. package/dist/schedule.d.ts.map +1 -0
  158. package/dist/schedule.js +2 -0
  159. package/dist/schedule.js.map +1 -0
  160. package/dist/source.d.ts +158 -0
  161. package/dist/source.d.ts.map +1 -0
  162. package/dist/source.js +144 -0
  163. package/dist/source.js.map +1 -0
  164. package/dist/tag.d.ts +3 -10
  165. package/dist/tag.d.ts.map +1 -1
  166. package/dist/tag.js +2 -11
  167. package/dist/tag.js.map +1 -1
  168. package/dist/tool.d.ts +1 -15
  169. package/dist/tool.d.ts.map +1 -1
  170. package/dist/tool.js.map +1 -1
  171. package/dist/tools/callbacks.d.ts +1 -1
  172. package/dist/tools/callbacks.js +1 -1
  173. package/dist/tools/integrations.d.ts +119 -52
  174. package/dist/tools/integrations.d.ts.map +1 -1
  175. package/dist/tools/integrations.js +23 -22
  176. package/dist/tools/integrations.js.map +1 -1
  177. package/dist/tools/plot.d.ts +182 -117
  178. package/dist/tools/plot.d.ts.map +1 -1
  179. package/dist/tools/plot.js +23 -21
  180. package/dist/tools/plot.js.map +1 -1
  181. package/dist/tools/twists.d.ts +1 -1
  182. package/dist/twist-guide.d.ts +1 -1
  183. package/dist/twist-guide.d.ts.map +1 -1
  184. package/dist/twist.d.ts +66 -11
  185. package/dist/twist.d.ts.map +1 -1
  186. package/dist/twist.js +79 -10
  187. package/dist/twist.js.map +1 -1
  188. package/package.json +11 -41
  189. package/dist/common/calendar.d.ts +0 -135
  190. package/dist/common/calendar.d.ts.map +0 -1
  191. package/dist/common/calendar.js +0 -2
  192. package/dist/common/calendar.js.map +0 -1
  193. package/dist/common/documents.d.ts +0 -122
  194. package/dist/common/documents.d.ts.map +0 -1
  195. package/dist/common/documents.js +0 -2
  196. package/dist/common/documents.js.map +0 -1
  197. package/dist/common/messaging.d.ts +0 -84
  198. package/dist/common/messaging.d.ts.map +0 -1
  199. package/dist/common/messaging.js +0 -2
  200. package/dist/common/messaging.js.map +0 -1
  201. package/dist/common/projects.d.ts +0 -112
  202. package/dist/common/projects.d.ts.map +0 -1
  203. package/dist/common/projects.js +0 -2
  204. package/dist/common/projects.js.map +0 -1
  205. package/dist/docs/documents/Building_Custom_Tools.html +0 -215
  206. package/dist/docs/enums/plot.ActivityKind.html +0 -14
  207. package/dist/docs/enums/plot.ActivityType.html +0 -10
  208. package/dist/docs/modules/common_calendar.html +0 -1
  209. package/dist/docs/types/common_calendar.Calendar.html +0 -13
  210. package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
  211. package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
  212. package/dist/docs/types/plot.Activity.html +0 -2
  213. package/dist/docs/types/plot.ActivityCommon.html +0 -20
  214. package/dist/docs/types/plot.ActivityFilter.html +0 -3
  215. package/dist/docs/types/plot.ActivityLink.html +0 -26
  216. package/dist/docs/types/plot.ActivityMeta.html +0 -11
  217. package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
  218. package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
  219. package/dist/docs/types/plot.ActivityUpdate.html +0 -3
  220. package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
  221. package/dist/docs/types/plot.NewActivity.html +0 -81
  222. package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
  223. package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
  224. package/dist/docs/types/tool.SyncToolOptions.html +0 -9
  225. package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
  226. package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
  227. package/dist/docs/types/tools_integrations.Syncable.html +0 -9
  228. package/dist/llm-docs/common/calendar.d.ts +0 -9
  229. package/dist/llm-docs/common/calendar.d.ts.map +0 -1
  230. package/dist/llm-docs/common/calendar.js +0 -8
  231. package/dist/llm-docs/common/calendar.js.map +0 -1
  232. package/dist/llm-docs/common/documents.d.ts +0 -9
  233. package/dist/llm-docs/common/documents.d.ts.map +0 -1
  234. package/dist/llm-docs/common/documents.js +0 -8
  235. package/dist/llm-docs/common/documents.js.map +0 -1
  236. package/dist/llm-docs/common/messaging.d.ts +0 -9
  237. package/dist/llm-docs/common/messaging.d.ts.map +0 -1
  238. package/dist/llm-docs/common/messaging.js +0 -8
  239. package/dist/llm-docs/common/messaging.js.map +0 -1
  240. package/dist/llm-docs/common/projects.d.ts +0 -9
  241. package/dist/llm-docs/common/projects.d.ts.map +0 -1
  242. package/dist/llm-docs/common/projects.js +0 -8
  243. package/dist/llm-docs/common/projects.js.map +0 -1
@@ -1,13 +1,14 @@
1
- import { type Activity, type ActivityOccurrence, type ActivityUpdate, type Actor, type ActorId, ITool, type NewActivity, type NewActivityWithNotes, type NewContact, type NewNote, type NewPriority, type Note, type NoteUpdate, type Priority, type PriorityUpdate, type Tag, Uuid } from "..";
2
- export declare enum ActivityAccess {
1
+ import { type Thread, type ThreadUpdate, type Actor, type ActorId, ITool, type Link, type NewThread, type NewThreadWithNotes, type NewContact, type NewNote, type NewPriority, type Note, type NoteUpdate, type Priority, type PriorityUpdate, Uuid } from "..";
2
+ import { type Schedule, type NewSchedule } from "../schedule";
3
+ export declare enum ThreadAccess {
3
4
  /**
4
- * Create new Note on an Activity where the twist was mentioned.
5
- * Add/remove tags on Activity or Note where the twist was mentioned.
5
+ * Create new Note on a Thread where the twist was mentioned.
6
+ * Add/remove tags on Thread or Note where the twist was mentioned.
6
7
  */
7
8
  Respond = 0,
8
9
  /**
9
- * Create new Activity.
10
- * Create new Note in an Activity the twist created.
10
+ * Create new Thread.
11
+ * Create new Note in a Thread the twist created.
11
12
  * All Respond permissions.
12
13
  */
13
14
  Create = 1
@@ -32,8 +33,8 @@ export declare enum ContactAccess {
32
33
  Write = 1
33
34
  }
34
35
  /**
35
- * Intent handler for activity mentions.
36
- * Defines how the twist should respond when mentioned in an activity.
36
+ * Intent handler for thread mentions.
37
+ * Defines how the twist should respond when mentioned in a thread.
37
38
  */
38
39
  export type NoteIntentHandler = {
39
40
  /** Human-readable description of what this intent handles */
@@ -43,10 +44,59 @@ export type NoteIntentHandler = {
43
44
  /** The function to call when this intent is matched */
44
45
  handler: (note: Note) => Promise<void>;
45
46
  };
47
+ /**
48
+ * Filter for querying links from connected source channels.
49
+ */
50
+ export type LinkFilter = {
51
+ /** Only return links from these channel IDs. */
52
+ channelIds?: string[];
53
+ /** Only return links created/updated after this date. */
54
+ since?: Date;
55
+ /** Only return links of this type. */
56
+ type?: string;
57
+ /** Maximum number of links to return. */
58
+ limit?: number;
59
+ };
60
+ type SearchResultBase = {
61
+ thread: {
62
+ id: string;
63
+ title: string | null;
64
+ };
65
+ priority: {
66
+ id: string;
67
+ title: string | null;
68
+ };
69
+ similarity: number;
70
+ };
71
+ export type NoteSearchResult = SearchResultBase & {
72
+ type: 'note';
73
+ id: string;
74
+ content: string | null;
75
+ };
76
+ export type LinkSearchResult = SearchResultBase & {
77
+ type: 'link';
78
+ id: string;
79
+ title: string | null;
80
+ sourceUrl: string | null;
81
+ content: string | null;
82
+ };
83
+ export type SearchResult = NoteSearchResult | LinkSearchResult;
84
+ /** Default number of search results returned */
85
+ export declare const SEARCH_DEFAULT_LIMIT = 10;
86
+ /** Maximum number of search results allowed */
87
+ export declare const SEARCH_MAX_LIMIT = 30;
88
+ export type SearchOptions = {
89
+ /** Max results to return (default: 10, max: 30) */
90
+ limit?: number;
91
+ /** Minimum similarity score 0-1 (default: 0.3) */
92
+ threshold?: number;
93
+ /** Scope search to this priority + descendants (default: twist's installed priority). Must be within the twist's allowed scope. */
94
+ priorityId?: string;
95
+ };
46
96
  /**
47
97
  * Built-in tool for interacting with the core Plot data layer.
48
98
  *
49
- * The Plot tool provides twists with the ability to create and manage activities,
99
+ * The Plot tool provides twists with the ability to create and manage threads,
50
100
  * priorities, and contacts within the Plot system. This is the primary interface
51
101
  * for twists to persist data and interact with the Plot database.
52
102
  *
@@ -61,13 +111,12 @@ export type NoteIntentHandler = {
61
111
  * }
62
112
  *
63
113
  * async activate(priority) {
64
- * // Create a welcome activity
65
- * await this.plot.createActivity({
66
- * type: ActivityType.Note,
114
+ * // Create a welcome thread
115
+ * await this.plot.createThread({
67
116
  * title: "Welcome to Plot!",
68
- * links: [{
117
+ * actions: [{
69
118
  * title: "Get Started",
70
- * type: ActivityLinkType.external,
119
+ * type: ActionType.external,
71
120
  * url: "https://plot.day/docs"
72
121
  * }]
73
122
  * });
@@ -87,8 +136,8 @@ export declare abstract class Plot extends ITool {
87
136
  * build(build: ToolBuilder) {
88
137
  * return {
89
138
  * plot: build(Plot, {
90
- * activity: {
91
- * access: ActivityAccess.Create
139
+ * thread: {
140
+ * access: ThreadAccess.Create
92
141
  * }
93
142
  * })
94
143
  * };
@@ -98,9 +147,8 @@ export declare abstract class Plot extends ITool {
98
147
  * build(build: ToolBuilder) {
99
148
  * return {
100
149
  * plot: build(Plot, {
101
- * activity: {
102
- * access: ActivityAccess.Create,
103
- * updated: this.onActivityUpdated
150
+ * thread: {
151
+ * access: ThreadAccess.Create,
104
152
  * },
105
153
  * note: {
106
154
  * intents: [{
@@ -108,8 +156,8 @@ export declare abstract class Plot extends ITool {
108
156
  * examples: ["Schedule a meeting tomorrow"],
109
157
  * handler: this.onSchedulingIntent
110
158
  * }],
111
- * created: this.onNoteCreated
112
159
  * },
160
+ * link: true,
113
161
  * priority: {
114
162
  * access: PriorityAccess.Full
115
163
  * },
@@ -122,27 +170,12 @@ export declare abstract class Plot extends ITool {
122
170
  * ```
123
171
  */
124
172
  static readonly Options: {
125
- activity?: {
173
+ thread?: {
126
174
  /**
127
175
  * Capability to create Notes and modify tags.
128
176
  * Must be explicitly set to grant permissions.
129
177
  */
130
- access?: ActivityAccess;
131
- /**
132
- * Called when an activity created by this twist is updated.
133
- * This is often used to implement two-way sync with an external system.
134
- *
135
- * @param activity - The updated activity
136
- * @param changes - Changes to the activity and the previous version
137
- */
138
- updated?: (activity: Activity, changes: {
139
- tagsAdded: Record<Tag, ActorId[]>;
140
- tagsRemoved: Record<Tag, ActorId[]>;
141
- /**
142
- * If present, this update is for a specific occurrence of a recurring activity.
143
- */
144
- occurrence?: ActivityOccurrence;
145
- }) => Promise<void>;
178
+ access?: ThreadAccess;
146
179
  };
147
180
  note?: {
148
181
  /**
@@ -165,120 +198,98 @@ export declare abstract class Plot extends ITool {
165
198
  * ```
166
199
  */
167
200
  intents?: NoteIntentHandler[];
168
- /**
169
- * Called when a note is created on an activity created by this twist.
170
- * This is often used to implement two-way sync with an external system,
171
- * such as syncing notes as comments back to the source system.
172
- *
173
- * Notes created by the twist itself are automatically filtered out to prevent loops.
174
- * The parent activity is available via note.activity.
175
- *
176
- * @param note - The newly created note
177
- */
178
- created?: (note: Note) => Promise<void>;
179
201
  };
202
+ /** Enable link processing from connected source channels. */
203
+ link?: true;
180
204
  priority?: {
181
205
  access?: PriorityAccess;
182
206
  };
183
207
  contact?: {
184
208
  access?: ContactAccess;
185
209
  };
210
+ /** Enable semantic search across notes and links in the twist's priority scope. */
211
+ search?: true;
186
212
  };
187
213
  /**
188
- * Creates a new activity in the Plot system.
214
+ * Creates a new thread in the Plot system.
189
215
  *
190
- * The activity will be automatically assigned an ID and author information
191
- * based on the current execution context. All other fields from NewActivity
192
- * will be preserved in the created activity.
216
+ * The thread will be automatically assigned an ID and author information
217
+ * based on the current execution context. All other fields from NewThread
218
+ * will be preserved in the created thread.
193
219
  *
194
- * @param activity - The activity data to create
195
- * @returns Promise resolving to the created activity's ID
220
+ * @param thread - The thread data to create
221
+ * @returns Promise resolving to the created thread's ID
196
222
  */
197
- abstract createActivity(activity: NewActivity | NewActivityWithNotes): Promise<Uuid>;
223
+ abstract createThread(thread: NewThread | NewThreadWithNotes): Promise<Uuid>;
198
224
  /**
199
- * Creates multiple activities in a single batch operation.
225
+ * Creates multiple threads in a single batch operation.
200
226
  *
201
- * This method efficiently creates multiple activities at once, which is
202
- * more performant than calling createActivity() multiple times individually.
203
- * All activities are created with the same author and access control rules.
227
+ * This method efficiently creates multiple threads at once, which is
228
+ * more performant than calling createThread() multiple times individually.
229
+ * All threads are created with the same author and access control rules.
204
230
  *
205
- * @param activities - Array of activity data to create
206
- * @returns Promise resolving to array of created activity IDs
231
+ * @param threads - Array of thread data to create
232
+ * @returns Promise resolving to array of created thread IDs
207
233
  */
208
- abstract createActivities(activities: (NewActivity | NewActivityWithNotes)[]): Promise<Uuid[]>;
234
+ abstract createThreads(threads: (NewThread | NewThreadWithNotes)[]): Promise<Uuid[]>;
209
235
  /**
210
- * Updates an existing activity in the Plot system.
236
+ * Updates an existing thread in the Plot system.
211
237
  *
212
- * **Important**: This method only updates existing activities. It will throw an error
213
- * if the activity does not exist. Use `createActivity()` to create or update (upsert)
214
- * activities.
238
+ * **Important**: This method only updates existing threads. It will throw an error
239
+ * if the thread does not exist. Use `createThread()` to create or update (upsert)
240
+ * threads.
215
241
  *
216
242
  * Only the fields provided in the update object will be modified - all other fields
217
243
  * remain unchanged. This enables partial updates without needing to fetch and resend
218
- * the entire activity object.
244
+ * the entire thread object.
219
245
  *
220
246
  * For tags, provide a Record<number, boolean> where true adds a tag and false removes it.
221
247
  * Tags not included in the update remain unchanged.
222
248
  *
223
- * When updating the parent, the activity's path will be automatically recalculated to
249
+ * When updating the parent, the thread's path will be automatically recalculated to
224
250
  * maintain the correct hierarchical structure.
225
251
  *
226
- * When updating scheduling fields (start, end, recurrence*), the database will
227
- * automatically recalculate duration and range values to maintain consistency.
252
+ * Scheduling is handled separately via `createSchedule()` / `updateSchedule()`.
228
253
  *
229
- * @param activity - The activity update containing the ID or source and fields to change
254
+ * @param thread - The thread update containing the ID or source and fields to change
230
255
  * @returns Promise that resolves when the update is complete
231
- * @throws Error if the activity does not exist
256
+ * @throws Error if the thread does not exist
232
257
  *
233
258
  * @example
234
259
  * ```typescript
235
260
  * // Mark a task as complete
236
- * await this.plot.updateActivity({
261
+ * await this.plot.updateThread({
237
262
  * id: "task-123",
238
263
  * done: new Date()
239
264
  * });
240
265
  *
241
- * // Reschedule an event
242
- * await this.plot.updateActivity({
243
- * id: "event-456",
244
- * start: new Date("2024-03-15T10:00:00Z"),
245
- * end: new Date("2024-03-15T11:00:00Z")
246
- * });
247
- *
248
266
  * // Add and remove tags
249
- * await this.plot.updateActivity({
250
- * id: "activity-789",
267
+ * await this.plot.updateThread({
268
+ * id: "thread-789",
251
269
  * tags: {
252
270
  * 1: true, // Add tag with ID 1
253
271
  * 2: false // Remove tag with ID 2
254
272
  * }
255
273
  * });
256
- *
257
- * // Update a recurring event exception
258
- * await this.plot.updateActivity({
259
- * id: "exception-123",
260
- * occurrence: new Date("2024-03-20T09:00:00Z"),
261
- * title: "Rescheduled meeting"
262
- * });
263
274
  * ```
264
275
  */
265
- abstract updateActivity(activity: ActivityUpdate): Promise<void>;
276
+ abstract updateThread(thread: ThreadUpdate): Promise<void>;
266
277
  /**
267
- * Retrieves all notes within an activity.
278
+ * Retrieves all notes within a thread.
268
279
  *
269
- * Notes are detailed entries within an activity, ordered by creation time.
270
- * Each note can contain markdown content, links, and other detailed information
271
- * related to the parent activity.
280
+ * Notes are detailed entries within a thread, ordered by creation time.
281
+ * Each note can contain markdown content, actions, and other detailed information
282
+ * related to the parent thread.
272
283
  *
273
- * @param activity - The activity whose notes to retrieve
274
- * @returns Promise resolving to array of notes in the activity
284
+ * @param thread - The thread whose notes to retrieve
285
+ * @returns Promise resolving to array of notes in the thread
275
286
  */
276
- abstract getNotes(activity: Activity): Promise<Note[]>;
287
+ abstract getNotes(thread: Thread): Promise<Note[]>;
277
288
  /**
278
- * Creates a new note in an activity.
289
+ * Creates a new note in a thread.
279
290
  *
280
- * Notes provide detailed content within an activity, supporting markdown,
281
- * links, and other rich content. The note will be automatically assigned
291
+ * Notes provide detailed content within a thread, supporting markdown,
292
+ * actions, and other rich content. The note will be automatically assigned
282
293
  * an ID and author information based on the current execution context.
283
294
  *
284
295
  * @param note - The note data to create
@@ -288,17 +299,17 @@ export declare abstract class Plot extends ITool {
288
299
  * ```typescript
289
300
  * // Create a note with content
290
301
  * await this.plot.createNote({
291
- * activity: { id: "activity-123" },
302
+ * thread: { id: "thread-123" },
292
303
  * note: "Discussion notes from the meeting...",
293
304
  * contentType: "markdown"
294
305
  * });
295
306
  *
296
- * // Create a note with links
307
+ * // Create a note with actions
297
308
  * await this.plot.createNote({
298
- * activity: { id: "activity-456" },
309
+ * thread: { id: "thread-456" },
299
310
  * note: "Meeting recording available",
300
- * links: [{
301
- * type: ActivityLinkType.external,
311
+ * actions: [{
312
+ * type: ActionType.external,
302
313
  * title: "View Recording",
303
314
  * url: "https://example.com/recording"
304
315
  * }]
@@ -321,11 +332,11 @@ export declare abstract class Plot extends ITool {
321
332
  * // Create multiple notes in one batch
322
333
  * await this.plot.createNotes([
323
334
  * {
324
- * activity: { id: "activity-123" },
335
+ * thread: { id: "thread-123" },
325
336
  * note: "First message in thread"
326
337
  * },
327
338
  * {
328
- * activity: { id: "activity-123" },
339
+ * thread: { id: "thread-123" },
329
340
  * note: "Second message in thread"
330
341
  * }
331
342
  * ]);
@@ -365,25 +376,25 @@ export declare abstract class Plot extends ITool {
365
376
  */
366
377
  abstract updateNote(note: NoteUpdate): Promise<void>;
367
378
  /**
368
- * Retrieves an activity by ID or source.
379
+ * Retrieves a thread by ID or source.
369
380
  *
370
- * This method enables lookup of activities either by their unique ID or by their
371
- * source identifier (canonical URL from an external system). Archived activities
381
+ * This method enables lookup of threads either by their unique ID or by their
382
+ * source identifier (canonical URL from an external system). Archived threads
372
383
  * are included in the results.
373
384
  *
374
- * @param activity - Activity lookup by ID or source
375
- * @returns Promise resolving to the matching activity or null if not found
385
+ * @param thread - Thread lookup by ID or source
386
+ * @returns Promise resolving to the matching thread or null if not found
376
387
  */
377
- abstract getActivity(activity: {
388
+ abstract getThread(thread: {
378
389
  id: Uuid;
379
390
  } | {
380
391
  source: string;
381
- }): Promise<Activity | null>;
392
+ }): Promise<Thread | null>;
382
393
  /**
383
394
  * Retrieves a note by ID or key.
384
395
  *
385
396
  * This method enables lookup of notes either by their unique ID or by their
386
- * key (unique identifier within the activity). Archived notes are included
397
+ * key (unique identifier within the thread). Archived notes are included
387
398
  * in the results.
388
399
  *
389
400
  * @param note - Note lookup by ID or key
@@ -397,7 +408,7 @@ export declare abstract class Plot extends ITool {
397
408
  /**
398
409
  * Creates a new priority in the Plot system.
399
410
  *
400
- * Priorities serve as organizational containers for activities and twists.
411
+ * Priorities serve as organizational containers for threads and twists.
401
412
  * The created priority will be automatically assigned a unique ID.
402
413
  *
403
414
  * @param priority - The priority data to create
@@ -432,7 +443,7 @@ export declare abstract class Plot extends ITool {
432
443
  /**
433
444
  * Adds contacts to the Plot system.
434
445
  *
435
- * Contacts are used for associating people with activities, such as
446
+ * Contacts are used for associating people with threads, such as
436
447
  * event attendees or task assignees. Duplicate contacts (by email)
437
448
  * will be merged or updated as appropriate.
438
449
  * This method requires ContactAccess.Write permission.
@@ -451,5 +462,59 @@ export declare abstract class Plot extends ITool {
451
462
  * @returns Promise resolving to array of actors
452
463
  */
453
464
  abstract getActors(ids: ActorId[]): Promise<Actor[]>;
465
+ /**
466
+ * Creates a new schedule for a thread.
467
+ *
468
+ * Schedules define when a thread occurs in time. A thread can have
469
+ * multiple schedules (shared and per-user).
470
+ *
471
+ * @param schedule - The schedule data to create
472
+ * @returns Promise resolving to the created schedule
473
+ *
474
+ * @example
475
+ * ```typescript
476
+ * // Schedule a timed event
477
+ * const threadId = await this.plot.createThread({
478
+ * title: "Team standup"
479
+ * });
480
+ * await this.plot.createSchedule({
481
+ * threadId,
482
+ * start: new Date("2025-01-15T10:00:00Z"),
483
+ * end: new Date("2025-01-15T10:30:00Z"),
484
+ * recurrenceRule: "FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR"
485
+ * });
486
+ * ```
487
+ */
488
+ abstract createSchedule(schedule: NewSchedule): Promise<Schedule>;
489
+ /**
490
+ * Retrieves all schedules for a thread.
491
+ *
492
+ * @param threadId - The thread whose schedules to retrieve
493
+ * @returns Promise resolving to array of schedules for the thread
494
+ */
495
+ abstract getSchedules(threadId: Uuid): Promise<Schedule[]>;
496
+ /**
497
+ * Retrieves links from connected source channels.
498
+ *
499
+ * Requires `link: true` in Plot options.
500
+ *
501
+ * @param filter - Optional filter criteria for links
502
+ * @returns Promise resolving to array of links with their notes
503
+ */
504
+ abstract getLinks(filter?: LinkFilter): Promise<Array<{
505
+ link: Link;
506
+ notes: Note[];
507
+ }>>;
508
+ /**
509
+ * Searches notes and links using semantic similarity.
510
+ *
511
+ * Requires `search: true` in Plot options.
512
+ *
513
+ * @param query - The search query text
514
+ * @param options - Optional search configuration
515
+ * @returns Promise resolving to array of search results ordered by similarity
516
+ */
517
+ abstract search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
454
518
  }
519
+ export {};
455
520
  //# sourceMappingURL=plot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/tools/plot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAA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AE1D;;;;;;;OAOG;IAEH,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC,CAAC;IAErF;;;;;;;;OAQG;IAEH,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CACjF"}
@@ -1,18 +1,18 @@
1
1
  import { ITool, } from "..";
2
- export var ActivityAccess;
3
- (function (ActivityAccess) {
2
+ export var ThreadAccess;
3
+ (function (ThreadAccess) {
4
4
  /**
5
- * Create new Note on an Activity where the twist was mentioned.
6
- * Add/remove tags on Activity or Note where the twist was mentioned.
5
+ * Create new Note on a Thread where the twist was mentioned.
6
+ * Add/remove tags on Thread or Note where the twist was mentioned.
7
7
  */
8
- ActivityAccess[ActivityAccess["Respond"] = 0] = "Respond";
8
+ ThreadAccess[ThreadAccess["Respond"] = 0] = "Respond";
9
9
  /**
10
- * Create new Activity.
11
- * Create new Note in an Activity the twist created.
10
+ * Create new Thread.
11
+ * Create new Note in a Thread the twist created.
12
12
  * All Respond permissions.
13
13
  */
14
- ActivityAccess[ActivityAccess["Create"] = 1] = "Create";
15
- })(ActivityAccess || (ActivityAccess = {}));
14
+ ThreadAccess[ThreadAccess["Create"] = 1] = "Create";
15
+ })(ThreadAccess || (ThreadAccess = {}));
16
16
  export var PriorityAccess;
17
17
  (function (PriorityAccess) {
18
18
  /**
@@ -34,10 +34,14 @@ export var ContactAccess;
34
34
  /** Create and update contacts. */
35
35
  ContactAccess[ContactAccess["Write"] = 1] = "Write";
36
36
  })(ContactAccess || (ContactAccess = {}));
37
+ /** Default number of search results returned */
38
+ export const SEARCH_DEFAULT_LIMIT = 10;
39
+ /** Maximum number of search results allowed */
40
+ export const SEARCH_MAX_LIMIT = 30;
37
41
  /**
38
42
  * Built-in tool for interacting with the core Plot data layer.
39
43
  *
40
- * The Plot tool provides twists with the ability to create and manage activities,
44
+ * The Plot tool provides twists with the ability to create and manage threads,
41
45
  * priorities, and contacts within the Plot system. This is the primary interface
42
46
  * for twists to persist data and interact with the Plot database.
43
47
  *
@@ -52,13 +56,12 @@ export var ContactAccess;
52
56
  * }
53
57
  *
54
58
  * async activate(priority) {
55
- * // Create a welcome activity
56
- * await this.plot.createActivity({
57
- * type: ActivityType.Note,
59
+ * // Create a welcome thread
60
+ * await this.plot.createThread({
58
61
  * title: "Welcome to Plot!",
59
- * links: [{
62
+ * actions: [{
60
63
  * title: "Get Started",
61
- * type: ActivityLinkType.external,
64
+ * type: ActionType.external,
62
65
  * url: "https://plot.day/docs"
63
66
  * }]
64
67
  * });
@@ -78,8 +81,8 @@ export class Plot extends ITool {
78
81
  * build(build: ToolBuilder) {
79
82
  * return {
80
83
  * plot: build(Plot, {
81
- * activity: {
82
- * access: ActivityAccess.Create
84
+ * thread: {
85
+ * access: ThreadAccess.Create
83
86
  * }
84
87
  * })
85
88
  * };
@@ -89,9 +92,8 @@ export class Plot extends ITool {
89
92
  * build(build: ToolBuilder) {
90
93
  * return {
91
94
  * plot: build(Plot, {
92
- * activity: {
93
- * access: ActivityAccess.Create,
94
- * updated: this.onActivityUpdated
95
+ * thread: {
96
+ * access: ThreadAccess.Create,
95
97
  * },
96
98
  * note: {
97
99
  * intents: [{
@@ -99,8 +101,8 @@ export class Plot extends ITool {
99
101
  * examples: ["Schedule a meeting tomorrow"],
100
102
  * handler: this.onSchedulingIntent
101
103
  * }],
102
- * created: this.onNoteCreated
103
104
  * },
105
+ * link: true,
104
106
  * priority: {
105
107
  * access: PriorityAccess.Full
106
108
  * },
@@ -1 +1 @@
1
- {"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/tools/plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GAYN,MAAM,IAAI,CAAC;AAEZ,MAAM,CAAN,IAAY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ChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAWnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAgB,IAAK,SAAQ,KAAK;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,MAAM,CAAU,OAAO,CAwCrB;CA6UH"}
@@ -41,7 +41,7 @@ export type Log = {
41
41
  * "https://googleapis.com/*": ["use"]
42
42
  * },
43
43
  * "plot": {
44
- * "activity:mentioned": ["read", "write", "update"],
44
+ * "thread:mentioned": ["read", "write", "update"],
45
45
  * "priority": ["read", "write", "update"]
46
46
  * }
47
47
  * }