@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.
- package/README.md +4 -2
- package/bin/commands/create.js +37 -3
- package/bin/commands/create.js.map +1 -1
- package/bin/commands/deploy.js +4 -0
- package/bin/commands/deploy.js.map +1 -1
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/templates/AGENTS.template.md +101 -189
- package/bin/templates/README.template.md +2 -23
- package/cli/templates/AGENTS.template.md +101 -189
- package/cli/templates/README.template.md +2 -23
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/index.Options.html +1 -1
- package/dist/docs/classes/index.Source.html +200 -0
- package/dist/docs/classes/tool.ITool.html +1 -1
- package/dist/docs/classes/tool.Tool.html +21 -21
- package/dist/docs/classes/tools_ai.AI.html +1 -1
- package/dist/docs/classes/tools_callbacks.Callbacks.html +2 -2
- package/dist/docs/classes/tools_integrations.Integrations.html +45 -16
- package/dist/docs/classes/tools_network.Network.html +1 -1
- package/dist/docs/classes/tools_plot.Plot.html +93 -60
- package/dist/docs/classes/tools_store.Store.html +1 -1
- package/dist/docs/classes/tools_tasks.Tasks.html +1 -1
- package/dist/docs/classes/tools_twists.Twists.html +1 -1
- package/dist/docs/classes/twist.Twist.html +42 -10
- package/dist/docs/documents/Building_Sources.html +137 -0
- package/dist/docs/documents/Built-in_Tools.html +11 -2
- package/dist/docs/documents/Core_Concepts.html +5 -10
- package/dist/docs/documents/Getting_Started.html +1 -1
- package/dist/docs/enums/{plot.ActivityLinkType.html → plot.ActionType.html} +10 -8
- package/dist/docs/enums/plot.ActorType.html +7 -7
- package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
- package/dist/docs/enums/plot.ThemeColor.html +9 -9
- package/dist/docs/enums/tag.Tag.html +3 -10
- package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
- package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
- package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
- package/dist/docs/enums/{tools_plot.ActivityAccess.html → tools_plot.ThreadAccess.html} +6 -6
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/index.html +5 -6
- package/dist/docs/media/AGENTS.md +910 -0
- package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
- package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/plot.html +1 -1
- package/dist/docs/modules/tool.html +1 -1
- package/dist/docs/modules/tools_integrations.html +1 -1
- package/dist/docs/modules/tools_plot.html +1 -1
- package/dist/docs/modules.html +1 -1
- package/dist/docs/types/index.NewSchedule.html +33 -0
- package/dist/docs/types/index.NewScheduleContact.html +5 -0
- package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
- package/dist/docs/types/index.Schedule.html +37 -0
- package/dist/docs/types/index.ScheduleContact.html +5 -0
- package/dist/docs/types/index.ScheduleContactRole.html +1 -0
- package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
- package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
- package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
- package/dist/docs/types/plot.Action.html +28 -0
- package/dist/docs/types/plot.Actor.html +6 -6
- package/dist/docs/types/plot.ActorId.html +1 -1
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.Link.html +36 -0
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +5 -5
- package/dist/docs/types/plot.NewLink.html +26 -0
- package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
- package/dist/docs/types/plot.NewNote.html +10 -10
- package/dist/docs/types/plot.NewPriority.html +1 -1
- package/dist/docs/types/plot.NewTags.html +1 -1
- package/dist/docs/types/plot.NewThread.html +27 -0
- package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
- package/dist/docs/types/plot.Note.html +9 -8
- package/dist/docs/types/plot.NoteUpdate.html +2 -2
- package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
- package/dist/docs/types/plot.Priority.html +6 -6
- package/dist/docs/types/plot.PriorityUpdate.html +1 -1
- package/dist/docs/types/plot.Tags.html +1 -1
- package/dist/docs/types/plot.Thread.html +1 -0
- package/dist/docs/types/plot.ThreadCommon.html +17 -0
- package/dist/docs/types/plot.ThreadFilter.html +2 -0
- package/dist/docs/types/plot.ThreadMeta.html +11 -0
- package/dist/docs/types/plot.ThreadUpdate.html +3 -0
- package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
- package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
- package/dist/docs/types/tools_integrations.Authorization.html +4 -4
- package/dist/docs/types/tools_integrations.Channel.html +11 -0
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
- package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
- package/dist/docs/types/tools_plot.LinkSearchResult.html +1 -0
- package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
- package/dist/docs/types/tools_plot.NoteSearchResult.html +1 -0
- package/dist/docs/types/tools_plot.SearchOptions.html +7 -0
- package/dist/docs/types/tools_plot.SearchResult.html +1 -0
- package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
- package/dist/docs/variables/tools_plot.SEARCH_DEFAULT_LIMIT.html +2 -0
- package/dist/docs/variables/tools_plot.SEARCH_MAX_LIMIT.html +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/llm-docs/index.d.ts.map +1 -1
- package/dist/llm-docs/index.js +4 -8
- package/dist/llm-docs/index.js.map +1 -1
- package/dist/llm-docs/plot.d.ts +1 -1
- package/dist/llm-docs/plot.d.ts.map +1 -1
- package/dist/llm-docs/plot.js +1 -1
- package/dist/llm-docs/plot.js.map +1 -1
- package/dist/llm-docs/schedule.d.ts +9 -0
- package/dist/llm-docs/schedule.d.ts.map +1 -0
- package/dist/llm-docs/schedule.js +8 -0
- package/dist/llm-docs/schedule.js.map +1 -0
- package/dist/llm-docs/source.d.ts +9 -0
- package/dist/llm-docs/source.d.ts.map +1 -0
- package/dist/llm-docs/source.js +8 -0
- package/dist/llm-docs/source.js.map +1 -0
- package/dist/llm-docs/tag.d.ts +1 -1
- package/dist/llm-docs/tag.d.ts.map +1 -1
- package/dist/llm-docs/tag.js +1 -1
- package/dist/llm-docs/tag.js.map +1 -1
- package/dist/llm-docs/tool.d.ts +1 -1
- package/dist/llm-docs/tool.d.ts.map +1 -1
- package/dist/llm-docs/tool.js +1 -1
- package/dist/llm-docs/tool.js.map +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts +1 -1
- package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
- package/dist/llm-docs/tools/callbacks.js +1 -1
- package/dist/llm-docs/tools/callbacks.js.map +1 -1
- package/dist/llm-docs/tools/integrations.d.ts +1 -1
- package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
- package/dist/llm-docs/tools/integrations.js +1 -1
- package/dist/llm-docs/tools/integrations.js.map +1 -1
- package/dist/llm-docs/tools/plot.d.ts +1 -1
- package/dist/llm-docs/tools/plot.d.ts.map +1 -1
- package/dist/llm-docs/tools/plot.js +1 -1
- package/dist/llm-docs/tools/plot.js.map +1 -1
- package/dist/llm-docs/tools/twists.d.ts +1 -1
- package/dist/llm-docs/tools/twists.d.ts.map +1 -1
- package/dist/llm-docs/tools/twists.js +1 -1
- package/dist/llm-docs/tools/twists.js.map +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts +1 -1
- package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
- package/dist/llm-docs/twist-guide-template.js +1 -1
- package/dist/llm-docs/twist-guide-template.js.map +1 -1
- package/dist/llm-docs/twist.d.ts +1 -1
- package/dist/llm-docs/twist.d.ts.map +1 -1
- package/dist/llm-docs/twist.js +1 -1
- package/dist/llm-docs/twist.js.map +1 -1
- package/dist/plot.d.ts +264 -589
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js +18 -49
- package/dist/plot.js.map +1 -1
- package/dist/schedule.d.ts +172 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/schedule.js +2 -0
- package/dist/schedule.js.map +1 -0
- package/dist/source.d.ts +158 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +144 -0
- package/dist/source.js.map +1 -0
- package/dist/tag.d.ts +3 -10
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +2 -11
- package/dist/tag.js.map +1 -1
- package/dist/tool.d.ts +1 -15
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js.map +1 -1
- package/dist/tools/callbacks.d.ts +1 -1
- package/dist/tools/callbacks.js +1 -1
- package/dist/tools/integrations.d.ts +119 -52
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +23 -22
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/plot.d.ts +182 -117
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js +23 -21
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/twists.d.ts +1 -1
- package/dist/twist-guide.d.ts +1 -1
- package/dist/twist-guide.d.ts.map +1 -1
- package/dist/twist.d.ts +66 -11
- package/dist/twist.d.ts.map +1 -1
- package/dist/twist.js +79 -10
- package/dist/twist.js.map +1 -1
- package/package.json +11 -41
- package/dist/common/calendar.d.ts +0 -135
- package/dist/common/calendar.d.ts.map +0 -1
- package/dist/common/calendar.js +0 -2
- package/dist/common/calendar.js.map +0 -1
- package/dist/common/documents.d.ts +0 -122
- package/dist/common/documents.d.ts.map +0 -1
- package/dist/common/documents.js +0 -2
- package/dist/common/documents.js.map +0 -1
- package/dist/common/messaging.d.ts +0 -84
- package/dist/common/messaging.d.ts.map +0 -1
- package/dist/common/messaging.js +0 -2
- package/dist/common/messaging.js.map +0 -1
- package/dist/common/projects.d.ts +0 -112
- package/dist/common/projects.d.ts.map +0 -1
- package/dist/common/projects.js +0 -2
- package/dist/common/projects.js.map +0 -1
- package/dist/docs/documents/Building_Custom_Tools.html +0 -215
- package/dist/docs/enums/plot.ActivityKind.html +0 -14
- package/dist/docs/enums/plot.ActivityType.html +0 -10
- package/dist/docs/modules/common_calendar.html +0 -1
- package/dist/docs/types/common_calendar.Calendar.html +0 -13
- package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
- package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
- package/dist/docs/types/plot.Activity.html +0 -2
- package/dist/docs/types/plot.ActivityCommon.html +0 -20
- package/dist/docs/types/plot.ActivityFilter.html +0 -3
- package/dist/docs/types/plot.ActivityLink.html +0 -26
- package/dist/docs/types/plot.ActivityMeta.html +0 -11
- package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
- package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityUpdate.html +0 -3
- package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
- package/dist/docs/types/plot.NewActivity.html +0 -81
- package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
- package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
- package/dist/docs/types/tool.SyncToolOptions.html +0 -9
- package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
- package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
- package/dist/docs/types/tools_integrations.Syncable.html +0 -9
- package/dist/llm-docs/common/calendar.d.ts +0 -9
- package/dist/llm-docs/common/calendar.d.ts.map +0 -1
- package/dist/llm-docs/common/calendar.js +0 -8
- package/dist/llm-docs/common/calendar.js.map +0 -1
- package/dist/llm-docs/common/documents.d.ts +0 -9
- package/dist/llm-docs/common/documents.d.ts.map +0 -1
- package/dist/llm-docs/common/documents.js +0 -8
- package/dist/llm-docs/common/documents.js.map +0 -1
- package/dist/llm-docs/common/messaging.d.ts +0 -9
- package/dist/llm-docs/common/messaging.d.ts.map +0 -1
- package/dist/llm-docs/common/messaging.js +0 -8
- package/dist/llm-docs/common/messaging.js.map +0 -1
- package/dist/llm-docs/common/projects.d.ts +0 -9
- package/dist/llm-docs/common/projects.d.ts.map +0 -1
- package/dist/llm-docs/common/projects.js +0 -8
- package/dist/llm-docs/common/projects.js.map +0 -1
|
@@ -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"}
|
package/dist/common/documents.js
DELETED
|
@@ -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"}
|
package/dist/common/messaging.js
DELETED
|
@@ -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"}
|
package/dist/common/projects.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/common/projects.ts"],"names":[],"mappings":""}
|