@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.
Files changed (262) 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 +188 -271
  9. package/bin/templates/README.template.md +2 -23
  10. package/cli/templates/AGENTS.template.md +188 -271
  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 +10 -0
  16. package/dist/docs/classes/index.Source.html +184 -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 +38 -16
  22. package/dist/docs/classes/tools_network.Network.html +1 -1
  23. package/dist/docs/classes/tools_plot.Plot.html +86 -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} +8 -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/interfaces/utils_types.ToolShed.html +5 -5
  44. package/dist/docs/media/AGENTS.md +910 -0
  45. package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
  46. package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
  47. package/dist/docs/modules/index.html +1 -1
  48. package/dist/docs/modules/plot.html +1 -1
  49. package/dist/docs/modules/tool.html +1 -1
  50. package/dist/docs/modules/tools_integrations.html +1 -1
  51. package/dist/docs/modules/tools_plot.html +1 -1
  52. package/dist/docs/modules.html +1 -1
  53. package/dist/docs/types/index.BooleanDef.html +7 -0
  54. package/dist/docs/types/index.NewSchedule.html +33 -0
  55. package/dist/docs/types/index.NewScheduleContact.html +5 -0
  56. package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
  57. package/dist/docs/types/index.NumberDef.html +9 -0
  58. package/dist/docs/types/index.OptionDef.html +2 -0
  59. package/dist/docs/types/index.OptionsSchema.html +3 -0
  60. package/dist/docs/types/index.ResolvedOptions.html +4 -0
  61. package/dist/docs/types/index.Schedule.html +37 -0
  62. package/dist/docs/types/index.ScheduleContact.html +5 -0
  63. package/dist/docs/types/index.ScheduleContactRole.html +1 -0
  64. package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
  65. package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
  66. package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
  67. package/dist/docs/types/index.SelectDef.html +8 -0
  68. package/dist/docs/types/index.TextDef.html +8 -0
  69. package/dist/docs/types/plot.Action.html +26 -0
  70. package/dist/docs/types/plot.Actor.html +6 -6
  71. package/dist/docs/types/plot.ActorId.html +1 -1
  72. package/dist/docs/types/plot.ContentType.html +1 -1
  73. package/dist/docs/types/plot.Link.html +36 -0
  74. package/dist/docs/types/plot.NewActor.html +1 -1
  75. package/dist/docs/types/plot.NewContact.html +5 -5
  76. package/dist/docs/types/plot.NewLink.html +26 -0
  77. package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
  78. package/dist/docs/types/plot.NewNote.html +10 -10
  79. package/dist/docs/types/plot.NewPriority.html +1 -1
  80. package/dist/docs/types/plot.NewTags.html +1 -1
  81. package/dist/docs/types/plot.NewThread.html +27 -0
  82. package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
  83. package/dist/docs/types/plot.Note.html +9 -8
  84. package/dist/docs/types/plot.NoteUpdate.html +2 -2
  85. package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
  86. package/dist/docs/types/plot.Priority.html +6 -6
  87. package/dist/docs/types/plot.PriorityUpdate.html +1 -1
  88. package/dist/docs/types/plot.Tags.html +1 -1
  89. package/dist/docs/types/plot.Thread.html +1 -0
  90. package/dist/docs/types/plot.ThreadCommon.html +17 -0
  91. package/dist/docs/types/plot.ThreadFilter.html +2 -0
  92. package/dist/docs/types/plot.ThreadMeta.html +11 -0
  93. package/dist/docs/types/plot.ThreadUpdate.html +3 -0
  94. package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
  95. package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
  96. package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
  97. package/dist/docs/types/tools_integrations.Authorization.html +4 -4
  98. package/dist/docs/types/tools_integrations.Channel.html +11 -0
  99. package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
  100. package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
  101. package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
  102. package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
  103. package/dist/docs/types/utils_types.BuiltInTools.html +2 -2
  104. package/dist/docs/types/utils_types.ExtractBuildReturn.html +1 -1
  105. package/dist/docs/types/utils_types.InferOptions.html +1 -1
  106. package/dist/docs/types/utils_types.InferTools.html +1 -1
  107. package/dist/docs/types/utils_types.JSONValue.html +1 -1
  108. package/dist/docs/types/utils_types.PromiseValues.html +1 -1
  109. package/dist/docs/types/utils_types.ToolBuilder.html +2 -2
  110. package/dist/index.d.ts +3 -0
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +3 -0
  113. package/dist/index.js.map +1 -1
  114. package/dist/llm-docs/index.d.ts.map +1 -1
  115. package/dist/llm-docs/index.js +6 -8
  116. package/dist/llm-docs/index.js.map +1 -1
  117. package/dist/llm-docs/options.d.ts +9 -0
  118. package/dist/llm-docs/options.d.ts.map +1 -0
  119. package/dist/llm-docs/options.js +8 -0
  120. package/dist/llm-docs/options.js.map +1 -0
  121. package/dist/llm-docs/plot.d.ts +1 -1
  122. package/dist/llm-docs/plot.d.ts.map +1 -1
  123. package/dist/llm-docs/plot.js +1 -1
  124. package/dist/llm-docs/plot.js.map +1 -1
  125. package/dist/llm-docs/schedule.d.ts +9 -0
  126. package/dist/llm-docs/schedule.d.ts.map +1 -0
  127. package/dist/llm-docs/schedule.js +8 -0
  128. package/dist/llm-docs/schedule.js.map +1 -0
  129. package/dist/llm-docs/source.d.ts +9 -0
  130. package/dist/llm-docs/source.d.ts.map +1 -0
  131. package/dist/llm-docs/source.js +8 -0
  132. package/dist/llm-docs/source.js.map +1 -0
  133. package/dist/llm-docs/tag.d.ts +1 -1
  134. package/dist/llm-docs/tag.d.ts.map +1 -1
  135. package/dist/llm-docs/tag.js +1 -1
  136. package/dist/llm-docs/tag.js.map +1 -1
  137. package/dist/llm-docs/tool.d.ts +1 -1
  138. package/dist/llm-docs/tool.d.ts.map +1 -1
  139. package/dist/llm-docs/tool.js +1 -1
  140. package/dist/llm-docs/tool.js.map +1 -1
  141. package/dist/llm-docs/tools/callbacks.d.ts +1 -1
  142. package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
  143. package/dist/llm-docs/tools/callbacks.js +1 -1
  144. package/dist/llm-docs/tools/callbacks.js.map +1 -1
  145. package/dist/llm-docs/tools/integrations.d.ts +1 -1
  146. package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
  147. package/dist/llm-docs/tools/integrations.js +1 -1
  148. package/dist/llm-docs/tools/integrations.js.map +1 -1
  149. package/dist/llm-docs/tools/plot.d.ts +1 -1
  150. package/dist/llm-docs/tools/plot.d.ts.map +1 -1
  151. package/dist/llm-docs/tools/plot.js +1 -1
  152. package/dist/llm-docs/tools/plot.js.map +1 -1
  153. package/dist/llm-docs/tools/twists.d.ts +1 -1
  154. package/dist/llm-docs/tools/twists.d.ts.map +1 -1
  155. package/dist/llm-docs/tools/twists.js +1 -1
  156. package/dist/llm-docs/tools/twists.js.map +1 -1
  157. package/dist/llm-docs/twist-guide-template.d.ts +1 -1
  158. package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
  159. package/dist/llm-docs/twist-guide-template.js +1 -1
  160. package/dist/llm-docs/twist-guide-template.js.map +1 -1
  161. package/dist/llm-docs/twist.d.ts +1 -1
  162. package/dist/llm-docs/twist.d.ts.map +1 -1
  163. package/dist/llm-docs/twist.js +1 -1
  164. package/dist/llm-docs/twist.js.map +1 -1
  165. package/dist/options.d.ts +104 -0
  166. package/dist/options.d.ts.map +1 -0
  167. package/dist/options.js +40 -0
  168. package/dist/options.js.map +1 -0
  169. package/dist/plot.d.ts +254 -588
  170. package/dist/plot.d.ts.map +1 -1
  171. package/dist/plot.js +16 -49
  172. package/dist/plot.js.map +1 -1
  173. package/dist/schedule.d.ts +172 -0
  174. package/dist/schedule.d.ts.map +1 -0
  175. package/dist/schedule.js +2 -0
  176. package/dist/schedule.js.map +1 -0
  177. package/dist/source.d.ts +133 -0
  178. package/dist/source.d.ts.map +1 -0
  179. package/dist/source.js +116 -0
  180. package/dist/source.js.map +1 -0
  181. package/dist/tag.d.ts +3 -10
  182. package/dist/tag.d.ts.map +1 -1
  183. package/dist/tag.js +2 -11
  184. package/dist/tag.js.map +1 -1
  185. package/dist/tool.d.ts +1 -15
  186. package/dist/tool.d.ts.map +1 -1
  187. package/dist/tool.js.map +1 -1
  188. package/dist/tools/callbacks.d.ts +1 -1
  189. package/dist/tools/callbacks.js +1 -1
  190. package/dist/tools/integrations.d.ts +107 -50
  191. package/dist/tools/integrations.d.ts.map +1 -1
  192. package/dist/tools/integrations.js +23 -22
  193. package/dist/tools/integrations.js.map +1 -1
  194. package/dist/tools/plot.d.ts +133 -117
  195. package/dist/tools/plot.d.ts.map +1 -1
  196. package/dist/tools/plot.js +19 -21
  197. package/dist/tools/plot.js.map +1 -1
  198. package/dist/tools/twists.d.ts +1 -1
  199. package/dist/twist-guide.d.ts +1 -1
  200. package/dist/twist-guide.d.ts.map +1 -1
  201. package/dist/twist.d.ts +66 -11
  202. package/dist/twist.d.ts.map +1 -1
  203. package/dist/twist.js +79 -10
  204. package/dist/twist.js.map +1 -1
  205. package/dist/utils/types.d.ts +5 -1
  206. package/dist/utils/types.d.ts.map +1 -1
  207. package/package.json +16 -41
  208. package/dist/common/calendar.d.ts +0 -135
  209. package/dist/common/calendar.d.ts.map +0 -1
  210. package/dist/common/calendar.js +0 -2
  211. package/dist/common/calendar.js.map +0 -1
  212. package/dist/common/documents.d.ts +0 -122
  213. package/dist/common/documents.d.ts.map +0 -1
  214. package/dist/common/documents.js +0 -2
  215. package/dist/common/documents.js.map +0 -1
  216. package/dist/common/messaging.d.ts +0 -84
  217. package/dist/common/messaging.d.ts.map +0 -1
  218. package/dist/common/messaging.js +0 -2
  219. package/dist/common/messaging.js.map +0 -1
  220. package/dist/common/projects.d.ts +0 -112
  221. package/dist/common/projects.d.ts.map +0 -1
  222. package/dist/common/projects.js +0 -2
  223. package/dist/common/projects.js.map +0 -1
  224. package/dist/docs/documents/Building_Custom_Tools.html +0 -215
  225. package/dist/docs/enums/plot.ActivityKind.html +0 -14
  226. package/dist/docs/enums/plot.ActivityType.html +0 -10
  227. package/dist/docs/modules/common_calendar.html +0 -1
  228. package/dist/docs/types/common_calendar.Calendar.html +0 -13
  229. package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
  230. package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
  231. package/dist/docs/types/plot.Activity.html +0 -2
  232. package/dist/docs/types/plot.ActivityCommon.html +0 -20
  233. package/dist/docs/types/plot.ActivityFilter.html +0 -3
  234. package/dist/docs/types/plot.ActivityLink.html +0 -26
  235. package/dist/docs/types/plot.ActivityMeta.html +0 -11
  236. package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
  237. package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
  238. package/dist/docs/types/plot.ActivityUpdate.html +0 -3
  239. package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
  240. package/dist/docs/types/plot.NewActivity.html +0 -81
  241. package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
  242. package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
  243. package/dist/docs/types/tool.SyncToolOptions.html +0 -9
  244. package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
  245. package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
  246. package/dist/docs/types/tools_integrations.Syncable.html +0 -7
  247. package/dist/llm-docs/common/calendar.d.ts +0 -9
  248. package/dist/llm-docs/common/calendar.d.ts.map +0 -1
  249. package/dist/llm-docs/common/calendar.js +0 -8
  250. package/dist/llm-docs/common/calendar.js.map +0 -1
  251. package/dist/llm-docs/common/documents.d.ts +0 -9
  252. package/dist/llm-docs/common/documents.d.ts.map +0 -1
  253. package/dist/llm-docs/common/documents.js +0 -8
  254. package/dist/llm-docs/common/documents.js.map +0 -1
  255. package/dist/llm-docs/common/messaging.d.ts +0 -9
  256. package/dist/llm-docs/common/messaging.d.ts.map +0 -1
  257. package/dist/llm-docs/common/messaging.js +0 -8
  258. package/dist/llm-docs/common/messaging.js.map +0 -1
  259. package/dist/llm-docs/common/projects.d.ts +0 -9
  260. package/dist/llm-docs/common/projects.d.ts.map +0 -1
  261. package/dist/llm-docs/common/projects.js +0 -8
  262. package/dist/llm-docs/common/projects.js.map +0 -1
@@ -1,135 +0,0 @@
1
- import type { NewActivityWithNotes, Serializable } from "../index";
2
- /**
3
- * Represents a calendar from an external calendar service.
4
- *
5
- * Contains metadata about a specific calendar that can be synced
6
- * with Plot. Different calendar providers may have additional
7
- * provider-specific properties.
8
- */
9
- export type Calendar = {
10
- /** Unique identifier for the calendar within the provider */
11
- id: string;
12
- /** Human-readable name of the calendar */
13
- name: string;
14
- /** Optional description or additional details about the calendar */
15
- description: string | null;
16
- /** Whether this is the user's primary/default calendar */
17
- primary: boolean;
18
- };
19
- /**
20
- * Configuration options for calendar synchronization.
21
- *
22
- * Controls the time range and other parameters for calendar sync operations.
23
- * Used to limit sync scope and optimize performance.
24
- */
25
- export type SyncOptions = {
26
- /**
27
- * Earliest date to sync events from (inclusive).
28
- * - If undefined: defaults to 2 years in the past
29
- * - If null: syncs all history from the beginning of time
30
- * - If Date: syncs from the specified date
31
- */
32
- timeMin?: Date | null;
33
- /**
34
- * Latest date to sync events to (exclusive).
35
- * - If undefined: no limit (syncs all future events)
36
- * - If null: no limit (syncs all future events)
37
- * - If Date: syncs up to but not including the specified date
38
- *
39
- * Use cases:
40
- * - Daily digest: Set to end of today
41
- * - Week view: Set to end of current week
42
- * - Performance: Limit initial sync range
43
- */
44
- timeMax?: Date | null;
45
- };
46
- /**
47
- * Base interface for calendar integration tools.
48
- *
49
- * Defines the standard operations that all calendar tools must implement
50
- * to integrate with external calendar services like Google Calendar,
51
- * Outlook Calendar, etc.
52
- *
53
- * **Architecture: Tools Build, Twists Save**
54
- *
55
- * Calendar tools follow Plot's core architectural principle:
56
- * - **Tools**: Fetch external data and transform it into Plot format (NewActivity objects)
57
- * - **Twists**: Receive the data and decide what to do with it (create, update, filter, etc.)
58
- *
59
- * This separation allows:
60
- * - Tools to be reusable across different twists with different behaviors
61
- * - Twists to have full control over what gets saved and how
62
- * - Easier testing of tools in isolation
63
- *
64
- * **Implementation Pattern:**
65
- * 1. Authorization is handled via the twist edit modal (Integrations provider config)
66
- * 2. Tool declares providers and lifecycle callbacks in build()
67
- * 3. onAuthorized lists available calendars and calls setSyncables()
68
- * 4. User enables calendars in the modal → onSyncEnabled fires
69
- * 5. **Tool builds NewActivity objects** and passes them to the twist via callback
70
- * 6. **Twist decides** whether to save using createActivity/updateActivity
71
- *
72
- * **Tool Implementation Rules:**
73
- * - **DO** build Activity/Note objects from external data
74
- * - **DO** pass them to the twist via the callback
75
- * - **DON'T** call plot.createActivity/updateActivity directly
76
- * - **DON'T** save anything to Plot database
77
- *
78
- * **Recommended Data Sync Strategy:**
79
- * Use Activity.source and Note.key for automatic upserts without manual ID tracking.
80
- * See SYNC_STRATEGIES.md for detailed patterns and when to use alternative approaches.
81
- *
82
- * @example
83
- * ```typescript
84
- * class MyCalendarTwist extends Twist {
85
- * build(build: ToolBuilder) {
86
- * return {
87
- * googleCalendar: build(GoogleCalendar),
88
- * plot: build(Plot, { activity: { access: ActivityAccess.Create } }),
89
- * };
90
- * }
91
- *
92
- * // Auth and calendar selection handled in the twist edit modal.
93
- * // Events are delivered via the startSync callback.
94
- * }
95
- * ```
96
- */
97
- export type CalendarTool = {
98
- /**
99
- * Retrieves the list of calendars accessible to the authenticated user.
100
- *
101
- * @param calendarId - A calendar ID to use for auth lookup
102
- * @returns Promise resolving to array of available calendars
103
- * @throws When no valid authorization is available
104
- */
105
- getCalendars(calendarId: string): Promise<Calendar[]>;
106
- /**
107
- * Begins synchronizing events from a specific calendar.
108
- *
109
- * Sets up real-time sync for the specified calendar, including initial
110
- * event import and ongoing change notifications. The callback function
111
- * will be invoked for each synced event.
112
- *
113
- * Auth is obtained automatically via integrations.get(provider, calendarId).
114
- *
115
- * @param options - Sync configuration options
116
- * @param options.calendarId - ID of the calendar to sync
117
- * @param options.timeMin - Earliest date to sync events from (inclusive)
118
- * @param options.timeMax - Latest date to sync events to (exclusive)
119
- * @param callback - Function receiving (activity, ...extraArgs) for each synced event
120
- * @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
121
- * @returns Promise that resolves when sync setup is complete
122
- * @throws When no valid authorization or calendar doesn't exist
123
- */
124
- startSync<TArgs extends Serializable[], TCallback extends (activity: NewActivityWithNotes, ...args: TArgs) => any>(options: {
125
- calendarId: string;
126
- } & SyncOptions, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
127
- /**
128
- * Stops synchronizing events from a specific calendar.
129
- *
130
- * @param calendarId - ID of the calendar to stop syncing
131
- * @returns Promise that resolves when sync is stopped
132
- */
133
- stopSync(calendarId: string): Promise<void>;
134
- };
135
- //# sourceMappingURL=calendar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/common/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;OAMG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CACP,KAAK,SAAS,YAAY,EAAE,EAC5B,SAAS,SAAS,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,GAAG,EAEzE,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,WAAW,EACf,QAAQ,EAAE,SAAS,EACnB,GAAG,SAAS,EAAE,KAAK,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=calendar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/common/calendar.ts"],"names":[],"mappings":""}
@@ -1,122 +0,0 @@
1
- import type { ActivityMeta, NewActivityWithNotes, Serializable } from "../index";
2
- /**
3
- * Represents a folder from an external document service.
4
- *
5
- * Contains metadata about a specific folder that can be synced
6
- * with Plot. Different document providers may have additional
7
- * provider-specific properties.
8
- */
9
- export type DocumentFolder = {
10
- /** Unique identifier for the folder within the provider */
11
- id: string;
12
- /** Human-readable name of the folder */
13
- name: string;
14
- /** Optional description or additional details about the folder */
15
- description: string | null;
16
- /** Whether this is a root-level folder (e.g., "My Drive" in Google Drive) */
17
- root: boolean;
18
- };
19
- /**
20
- * Configuration options for document synchronization.
21
- *
22
- * Controls the time range and other parameters for document sync operations.
23
- * Used to limit sync scope and optimize performance.
24
- */
25
- export type DocumentSyncOptions = {
26
- /** Earliest date to sync documents from (inclusive) */
27
- timeMin?: Date;
28
- };
29
- /**
30
- * Base interface for document service integration tools.
31
- *
32
- * All synced documents are converted to ActivityWithNotes objects.
33
- * Each document becomes an Activity with Notes for the description and comments.
34
- *
35
- * **Architecture: Tools Build, Twists Save**
36
- *
37
- * Document tools follow Plot's core architectural principle:
38
- * - **Tools**: Fetch external data and transform it into Plot format (NewActivity objects)
39
- * - **Twists**: Receive the data and decide what to do with it (create, update, filter, etc.)
40
- *
41
- * **Implementation Pattern:**
42
- * 1. Authorization is handled via the twist edit modal (Integrations provider config)
43
- * 2. Tool declares providers and lifecycle callbacks in build()
44
- * 3. onAuthorized lists available folders and calls setSyncables()
45
- * 4. User enables folders in the modal → onSyncEnabled fires
46
- * 5. **Tool builds NewActivity objects** and passes them to the twist via callback
47
- * 6. **Twist decides** whether to save using createActivity/updateActivity
48
- *
49
- * **Recommended Data Sync Strategy:**
50
- * Use Activity.source and Note.key for automatic upserts.
51
- *
52
- * - Set `Activity.source` to `"{provider}:file:{fileId}"` (e.g., `"google-drive:file:abc123"`)
53
- * - Use `Note.key` for document details:
54
- * - key: `"summary"` for the document description or metadata summary
55
- * - key: `"comment-{commentId}"` for individual comments (unique per comment)
56
- * - key: `"reply-{commentId}-{replyId}"` for comment replies
57
- * - No manual ID tracking needed - Plot handles deduplication automatically
58
- * - Send NewActivityWithNotes for all documents (creates new or updates existing)
59
- * - Set `activity.unread = false` for initial sync, omit for incremental updates
60
- */
61
- export type DocumentTool = {
62
- /**
63
- * Retrieves the list of folders accessible to the user.
64
- *
65
- * @param folderId - A folder ID to use for auth lookup
66
- * @returns Promise resolving to array of available folders
67
- */
68
- getFolders(folderId: string): Promise<DocumentFolder[]>;
69
- /**
70
- * Begins synchronizing documents from a specific folder.
71
- *
72
- * Documents are converted to NewActivityWithNotes objects.
73
- *
74
- * Auth is obtained automatically via integrations.get(provider, folderId).
75
- *
76
- * @param options - Sync configuration options
77
- * @param options.folderId - ID of the folder to sync
78
- * @param options.timeMin - Earliest date to sync documents from (inclusive)
79
- * @param callback - Function receiving (activity, ...extraArgs) for each synced document
80
- * @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
81
- * @returns Promise that resolves when sync setup is complete
82
- */
83
- startSync<TArgs extends Serializable[], TCallback extends (activity: NewActivityWithNotes, ...args: TArgs) => any>(options: {
84
- folderId: string;
85
- } & DocumentSyncOptions, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
86
- /**
87
- * Stops synchronizing documents from a specific folder.
88
- *
89
- * @param folderId - ID of the folder to stop syncing
90
- * @returns Promise that resolves when sync is stopped
91
- */
92
- stopSync(folderId: string): Promise<void>;
93
- /**
94
- * Adds a comment to a document.
95
- *
96
- * Optional method for bidirectional sync. When implemented, allows Plot to
97
- * sync notes added to activities back as comments on the external document.
98
- *
99
- * Auth is obtained automatically. The tool should extract its own ID
100
- * from meta (e.g., fileId).
101
- *
102
- * @param meta - Activity metadata containing the tool's document identifier
103
- * @param body - The comment text content
104
- * @param noteId - Optional Plot note ID for deduplication
105
- * @returns The external comment key (e.g. "comment-123") for dedup, or void
106
- */
107
- addDocumentComment?(meta: ActivityMeta, body: string, noteId?: string): Promise<string | void>;
108
- /**
109
- * Adds a reply to an existing comment thread on a document.
110
- *
111
- * Auth is obtained automatically. The tool should extract its own ID
112
- * from meta (e.g., fileId).
113
- *
114
- * @param meta - Activity metadata containing the tool's document identifier
115
- * @param commentId - The external comment ID to reply to
116
- * @param body - The reply text content
117
- * @param noteId - Optional Plot note ID for deduplication
118
- * @returns The external reply key (e.g. "reply-123-456") for dedup, or void
119
- */
120
- addDocumentReply?(meta: ActivityMeta, commentId: string, body: string, noteId?: string): Promise<string | void>;
121
- };
122
- //# sourceMappingURL=documents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/common/documents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,uDAAuD;IACvD,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAExD;;;;;;;;;;;;;OAaG;IACH,SAAS,CACP,KAAK,SAAS,YAAY,EAAE,EAC5B,SAAS,SAAS,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,GAAG,EAEzE,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,mBAAmB,EACvB,QAAQ,EAAE,SAAS,EACnB,GAAG,SAAS,EAAE,KAAK,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,CACjB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE1B;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,CACf,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=documents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/common/documents.ts"],"names":[],"mappings":""}
@@ -1,84 +0,0 @@
1
- import type { NewActivityWithNotes, Serializable } from "../index";
2
- /**
3
- * Represents a channel from an external messaging service.
4
- *
5
- * Contains metadata about a specific channel that can be synced
6
- * with Plot. Different messaging providers may have additional
7
- * provider-specific properties.
8
- */
9
- export type MessageChannel = {
10
- /** Unique identifier for the channel within the provider */
11
- id: string;
12
- /** Human-readable name of the channel (e.g., "Inbox", "#general", "My Team Thread") */
13
- name: string;
14
- /** Optional description or additional details about the channel */
15
- description: string | null;
16
- /** Whether this is the user's primary/default channel (e.g. email inbox) */
17
- primary: boolean;
18
- };
19
- /**
20
- * Configuration options for messaging synchronization.
21
- *
22
- * Controls the time range and other parameters for messaging sync operations.
23
- * Used to limit sync scope and optimize performance.
24
- */
25
- export type MessageSyncOptions = {
26
- /** Earliest date to sync events from (inclusive) */
27
- timeMin?: Date;
28
- };
29
- /**
30
- * Base interface for email and chat integration tools.
31
- *
32
- * All synced messages/emails are converted to ActivityWithNotes objects.
33
- * Each email thread or chat conversation becomes an Activity with Notes for each message.
34
- *
35
- * **Architecture: Tools Build, Twists Save**
36
- *
37
- * Messaging tools follow Plot's core architectural principle:
38
- * - **Tools**: Fetch external data and transform it into Plot format (NewActivity objects)
39
- * - **Twists**: Receive the data and decide what to do with it (create, update, filter, etc.)
40
- *
41
- * **Implementation Pattern:**
42
- * 1. Authorization is handled via the twist edit modal (Integrations provider config)
43
- * 2. Tool declares providers and lifecycle callbacks in build()
44
- * 3. onAuthorized lists available channels and calls setSyncables()
45
- * 4. User enables channels in the modal → onSyncEnabled fires
46
- * 5. **Tool builds NewActivity objects** and passes them to the twist via callback
47
- * 6. **Twist decides** whether to save using createActivity/updateActivity
48
- *
49
- * **Recommended Data Sync Strategy:**
50
- * Use Activity.source (thread URL or ID) and Note.key (message ID) for automatic upserts.
51
- * See SYNC_STRATEGIES.md for detailed patterns.
52
- */
53
- export type MessagingTool = {
54
- /**
55
- * Retrieves the list of conversation channels (inboxes, channels) accessible to the user.
56
- *
57
- * @param channelId - A channel ID to use for auth lookup
58
- * @returns Promise resolving to array of available conversation channels
59
- */
60
- getChannels(channelId: string): Promise<MessageChannel[]>;
61
- /**
62
- * Begins synchronizing messages from a specific channel.
63
- *
64
- * Auth is obtained automatically via integrations.get(provider, channelId).
65
- *
66
- * @param options - Sync configuration options
67
- * @param options.channelId - ID of the channel (e.g., channel, inbox) to sync
68
- * @param options.timeMin - Earliest date to sync events from (inclusive)
69
- * @param callback - Function receiving (thread, ...extraArgs) for each synced conversation
70
- * @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
71
- * @returns Promise that resolves when sync setup is complete
72
- */
73
- startSync<TArgs extends Serializable[], TCallback extends (thread: NewActivityWithNotes, ...args: TArgs) => any>(options: {
74
- channelId: string;
75
- } & MessageSyncOptions, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
76
- /**
77
- * Stops synchronizing messages from a specific channel.
78
- *
79
- * @param channelId - ID of the channel to stop syncing
80
- * @returns Promise that resolves when sync is stopped
81
- */
82
- stopSync(channelId: string): Promise<void>;
83
- };
84
- //# sourceMappingURL=messaging.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/common/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE1D;;;;;;;;;;;OAWG;IACH,SAAS,CACP,KAAK,SAAS,YAAY,EAAE,EAC5B,SAAS,SAAS,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,GAAG,EAEvE,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,kBAAkB,EACtB,QAAQ,EAAE,SAAS,EACnB,GAAG,SAAS,EAAE,KAAK,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=messaging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/common/messaging.ts"],"names":[],"mappings":""}
@@ -1,112 +0,0 @@
1
- import type { Activity, ActivityMeta, NewActivityWithNotes, Serializable } from "../index";
2
- /**
3
- * Represents a project from an external project management service.
4
- *
5
- * Contains metadata about a specific project/board/workspace that can be synced
6
- * with Plot. Different project providers may have additional
7
- * provider-specific properties.
8
- */
9
- export type Project = {
10
- /** Unique identifier for the project within the provider */
11
- id: string;
12
- /** Human-readable name of the project (e.g., "Q1 Roadmap", "Engineering") */
13
- name: string;
14
- /** Optional description or additional details about the project */
15
- description: string | null;
16
- /** Optional project key/abbreviation (e.g., "PROJ" in Jira, "ENG" in Linear) */
17
- key: string | null;
18
- };
19
- /**
20
- * Configuration options for project synchronization.
21
- *
22
- * Controls the time range and other parameters for project sync operations.
23
- * Used to limit sync scope and optimize performance.
24
- */
25
- export type ProjectSyncOptions = {
26
- /** Earliest date to sync issues from (inclusive) */
27
- timeMin?: Date;
28
- };
29
- /**
30
- * Base interface for project management integration tools.
31
- *
32
- * All synced issues/tasks are converted to ActivityWithNotes objects.
33
- * Each issue becomes an Activity with Notes for the description and comments.
34
- *
35
- * **Architecture: Tools Build, Twists Save**
36
- *
37
- * Project tools follow Plot's core architectural principle:
38
- * - **Tools**: Fetch external data and transform it into Plot format (NewActivity objects)
39
- * - **Twists**: Receive the data and decide what to do with it (create, update, filter, etc.)
40
- *
41
- * **Implementation Pattern:**
42
- * 1. Authorization is handled via the twist edit modal (Integrations provider config)
43
- * 2. Tool declares providers and lifecycle callbacks in build()
44
- * 3. onAuthorized lists available projects and calls setSyncables()
45
- * 4. User enables projects in the modal → onSyncEnabled fires
46
- * 5. **Tool builds NewActivity objects** and passes them to the twist via callback
47
- * 6. **Twist decides** whether to save using createActivity/updateActivity
48
- *
49
- * **Recommended Data Sync Strategy:**
50
- * Use Activity.source (issue URL) and Note.key for automatic upserts.
51
- * See SYNC_STRATEGIES.md for detailed patterns.
52
- */
53
- export type ProjectTool = {
54
- /**
55
- * Retrieves the list of projects accessible to the user.
56
- *
57
- * @param projectId - A project ID to use for auth lookup
58
- * @returns Promise resolving to array of available projects
59
- */
60
- getProjects(projectId: string): Promise<Project[]>;
61
- /**
62
- * Begins synchronizing issues from a specific project.
63
- *
64
- * Auth is obtained automatically via integrations.get(provider, projectId).
65
- *
66
- * @param options - Sync configuration options
67
- * @param options.projectId - ID of the project to sync
68
- * @param options.timeMin - Earliest date to sync issues from (inclusive)
69
- * @param callback - Function receiving (activity, ...extraArgs) for each synced issue
70
- * @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
71
- * @returns Promise that resolves when sync setup is complete
72
- */
73
- startSync<TArgs extends Serializable[], TCallback extends (activity: NewActivityWithNotes, ...args: TArgs) => any>(options: {
74
- projectId: string;
75
- } & ProjectSyncOptions, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
76
- /**
77
- * Stops synchronizing issues from a specific project.
78
- *
79
- * @param projectId - ID of the project to stop syncing
80
- * @returns Promise that resolves when sync is stopped
81
- */
82
- stopSync(projectId: string): Promise<void>;
83
- /**
84
- * Updates an issue/task with new values.
85
- *
86
- * Optional method for bidirectional sync. When implemented, allows Plot to
87
- * sync activity updates back to the external service.
88
- *
89
- * Auth is obtained automatically via integrations.get(provider, projectId)
90
- * using the projectId from activity.meta.
91
- *
92
- * @param activity - The updated activity
93
- * @returns Promise that resolves when the update is synced
94
- */
95
- updateIssue?(activity: Activity): Promise<void>;
96
- /**
97
- * Adds a comment to an issue/task.
98
- *
99
- * Optional method for bidirectional sync. When implemented, allows Plot to
100
- * sync notes added to activities back as comments on the external service.
101
- *
102
- * Auth is obtained automatically. The tool should extract its own ID
103
- * from meta (e.g., linearId, taskGid, issueKey).
104
- *
105
- * @param meta - Activity metadata containing the tool's issue/task identifier
106
- * @param body - The comment text content
107
- * @param noteId - Optional Plot note ID, used by tools that support comment metadata (e.g. Jira)
108
- * @returns The external comment key (e.g. "comment-123") for dedup, or void
109
- */
110
- addIssueComment?(meta: ActivityMeta, body: string, noteId?: string): Promise<string | void>;
111
- };
112
- //# sourceMappingURL=projects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/common/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gFAAgF;IAChF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAEnD;;;;;;;;;;;OAWG;IACH,SAAS,CACP,KAAK,SAAS,YAAY,EAAE,EAC5B,SAAS,SAAS,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,GAAG,EAEzE,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,kBAAkB,EACtB,QAAQ,EAAE,SAAS,EACnB,GAAG,SAAS,EAAE,KAAK,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,CACd,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=projects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/common/projects.ts"],"names":[],"mappings":""}