@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 +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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AE,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,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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":""}