@plotday/twister 0.54.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connector.d.ts +34 -4
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +2 -1
- package/dist/connector.js.map +1 -1
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/index.Connector.html +26 -25
- package/dist/docs/classes/index.FileNotFoundError.html +1 -1
- package/dist/docs/classes/index.Files.html +1 -1
- package/dist/docs/classes/index.Imap.html +1 -1
- package/dist/docs/classes/index.Options.html +1 -1
- package/dist/docs/classes/index.Smtp.html +1 -1
- package/dist/docs/classes/tools_ai.AI.html +1 -1
- package/dist/docs/classes/tools_callbacks.Callbacks.html +1 -1
- package/dist/docs/classes/tools_integrations.Integrations.html +16 -11
- package/dist/docs/classes/tools_network.Network.html +25 -16
- package/dist/docs/classes/tools_plot.Plot.html +1 -1
- 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/enums/plot.ActorType.html +4 -4
- package/dist/docs/enums/tools_integrations.AuthProvider.html +13 -13
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/tools_integrations.html +1 -1
- package/dist/docs/types/index.CreateLinkDraft.html +10 -8
- package/dist/docs/types/index.OptionalScopeGroup.html +12 -0
- package/dist/docs/types/index.ScopeConfig.html +9 -0
- package/dist/docs/types/plot.Actor.html +5 -5
- package/dist/docs/types/plot.Contact.html +4 -4
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.Link.html +20 -16
- package/dist/docs/types/plot.LinkUpdate.html +1 -1
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +1 -1
- package/dist/docs/types/plot.NewLink.html +18 -2
- package/dist/docs/types/plot.NewLinkWithNotes.html +13 -2
- package/dist/docs/types/plot.NewNote.html +7 -1
- package/dist/docs/types/plot.NoteUpdate.html +1 -1
- package/dist/docs/types/plot.PlanOperation.html +1 -1
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +5 -5
- package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
- package/dist/docs/types/tools_integrations.Authorization.html +4 -4
- package/dist/docs/types/tools_integrations.Channel.html +23 -4
- package/dist/docs/types/tools_integrations.ComposeConfig.html +7 -5
- package/dist/docs/types/tools_integrations.ContactRoleConfig.html +5 -5
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +56 -14
- package/dist/docs/types/tools_integrations.NewCustomEmoji.html +18 -0
- package/dist/docs/types/tools_integrations.StatusIcon.html +4 -0
- package/dist/docs/types/tools_integrations.SyncContext.html +15 -3
- package/dist/llm-docs/connector.d.ts +1 -1
- package/dist/llm-docs/connector.d.ts.map +1 -1
- package/dist/llm-docs/connector.js +1 -1
- package/dist/llm-docs/connector.js.map +1 -1
- package/dist/llm-docs/plot.d.ts +1 -1
- package/dist/llm-docs/plot.d.ts.map +1 -1
- package/dist/llm-docs/plot.js +1 -1
- package/dist/llm-docs/plot.js.map +1 -1
- package/dist/llm-docs/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/network.d.ts +1 -1
- package/dist/llm-docs/tools/network.d.ts.map +1 -1
- package/dist/llm-docs/tools/network.js +1 -1
- package/dist/llm-docs/tools/network.js.map +1 -1
- package/dist/plot.d.ts +58 -0
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js.map +1 -1
- package/dist/tools/integrations.d.ts +134 -2
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/network.d.ts +27 -15
- package/dist/tools/network.d.ts.map +1 -1
- package/dist/tools/network.js.map +1 -1
- package/package.json +1 -1
- package/src/connector.ts +36 -4
- package/src/llm-docs/connector.ts +1 -1
- package/src/llm-docs/plot.ts +1 -1
- package/src/llm-docs/tools/integrations.ts +1 -1
- package/src/llm-docs/tools/network.ts +1 -1
- package/src/plot.ts +59 -0
- package/src/tools/integrations.ts +147 -2
- package/src/tools/network.ts +27 -15
package/src/plot.ts
CHANGED
|
@@ -788,6 +788,16 @@ export type NewNote = Partial<
|
|
|
788
788
|
* - `undefined` (omitted): not a reply
|
|
789
789
|
*/
|
|
790
790
|
reNote?: { id: Uuid } | { key: string } | null;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* A link carried by this note (note-attached, NOT a thread-level canonical
|
|
794
|
+
* link). Use for augmenter content (e.g. Granola meeting notes) that should
|
|
795
|
+
* attach to an existing canonical thread without becoming its primary link.
|
|
796
|
+
* The runtime creates the link note-scoped, binds `note.link_id` to it, and
|
|
797
|
+
* — when `thread: { source }` resolves to no existing thread — find-or-creates
|
|
798
|
+
* the thread by that source so a later canonical sync can fill the primary.
|
|
799
|
+
*/
|
|
800
|
+
link?: NewLink;
|
|
791
801
|
};
|
|
792
802
|
|
|
793
803
|
/**
|
|
@@ -1025,6 +1035,12 @@ export type Link = {
|
|
|
1025
1035
|
* meeting-notes connector can bundle by setting the same alias.
|
|
1026
1036
|
*/
|
|
1027
1037
|
sources: string[];
|
|
1038
|
+
/**
|
|
1039
|
+
* Connector-supplied ranking used by clients to choose the single displayed
|
|
1040
|
+
* (primary) canonical link when a thread has more than one. Higher wins;
|
|
1041
|
+
* ties break on earliest creation. Default 0.
|
|
1042
|
+
*/
|
|
1043
|
+
priority: number;
|
|
1028
1044
|
};
|
|
1029
1045
|
|
|
1030
1046
|
/**
|
|
@@ -1082,12 +1098,36 @@ export type NewLink = Partial<
|
|
|
1082
1098
|
* - undefined (default): Preserve current archive state
|
|
1083
1099
|
*/
|
|
1084
1100
|
archived?: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Mark the thread as the connection owner's to-do at create time.
|
|
1103
|
+
* - true: the thread is added to the owner's to-do (active) bucket and
|
|
1104
|
+
* their per-user archive is lifted, atomically with the save — no
|
|
1105
|
+
* separate `integrations.setThreadToDo()` round-trip needed.
|
|
1106
|
+
* - false: the owner's thread_state is marked read (cleared from to-do).
|
|
1107
|
+
* - undefined (omitted, default): leave to-do state untouched.
|
|
1108
|
+
*
|
|
1109
|
+
* Use for messaging-style "saved for later" flags (e.g. a starred Slack
|
|
1110
|
+
* thread). This is the first-class replacement for overloading a
|
|
1111
|
+
* `statuses[]` entry with `active: true`.
|
|
1112
|
+
*/
|
|
1113
|
+
todo?: boolean;
|
|
1114
|
+
/**
|
|
1115
|
+
* The to-do date used when `todo` is true. Defaults to the "Now"
|
|
1116
|
+
* sentinel (today's bucket) when omitted. Ignored when `todo` is not true.
|
|
1117
|
+
*/
|
|
1118
|
+
todoDate?: Date | string;
|
|
1085
1119
|
/**
|
|
1086
1120
|
* Explicit focus (disables automatic focus matching).
|
|
1087
1121
|
* Only used when the link creates a new thread. When omitted, the
|
|
1088
1122
|
* server classifies the thread using the user's focus rules.
|
|
1089
1123
|
*/
|
|
1090
1124
|
focus?: Pick<Focus, "id">;
|
|
1125
|
+
/**
|
|
1126
|
+
* Primary-link ranking for this canonical link (default 0). Set higher on
|
|
1127
|
+
* the connection that "owns" the external item (e.g. the calendar that owns
|
|
1128
|
+
* an event vs a subscribed copy) so clients display it as the primary.
|
|
1129
|
+
*/
|
|
1130
|
+
priority?: number;
|
|
1091
1131
|
};
|
|
1092
1132
|
|
|
1093
1133
|
/**
|
|
@@ -1109,6 +1149,25 @@ export type NewLinkWithNotes = NewLink & {
|
|
|
1109
1149
|
schedules?: Array<Omit<NewSchedule, "threadId">>;
|
|
1110
1150
|
/** Schedule occurrence overrides */
|
|
1111
1151
|
scheduleOccurrences?: NewScheduleOccurrence[];
|
|
1152
|
+
/**
|
|
1153
|
+
* For `onCreateLink` only: binds the thread's opening note (the message the
|
|
1154
|
+
* user composed in Plot, which this hook just posted to the external system)
|
|
1155
|
+
* to its external counterpart. Mirrors the `NoteWriteBackResult` a reply
|
|
1156
|
+
* returns from `onNoteCreated` — `key` is the external message id and
|
|
1157
|
+
* `externalContent` is the post-write content baseline. Without this the
|
|
1158
|
+
* opening note stays keyless, so reactions and edits on it can't be routed
|
|
1159
|
+
* back to the external system. Ignored outside `onCreateLink`.
|
|
1160
|
+
*/
|
|
1161
|
+
originatingNote?: {
|
|
1162
|
+
/** External message id; set as the opening note's `key`. */
|
|
1163
|
+
key?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Content as the external system stored it post-write, for the sync
|
|
1166
|
+
* baseline. Must equal what your sync-in path emits as this note's
|
|
1167
|
+
* `content` on re-ingest (same contract as `NoteWriteBackResult.externalContent`).
|
|
1168
|
+
*/
|
|
1169
|
+
externalContent?: string;
|
|
1170
|
+
};
|
|
1112
1171
|
};
|
|
1113
1172
|
|
|
1114
1173
|
/**
|
|
@@ -17,12 +17,47 @@ export type Channel = {
|
|
|
17
17
|
id: string;
|
|
18
18
|
/** Display name shown in the UI */
|
|
19
19
|
title: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether this channel should be selected by default when the user first
|
|
22
|
+
* adds the connection. Tri-state:
|
|
23
|
+
* - `true` — pre-select it (e.g. the user's own/primary calendar).
|
|
24
|
+
* - `false` — exclude it from the default selection (low-value or
|
|
25
|
+
* irrelevant resources that would crowd the user's view, or containers
|
|
26
|
+
* whose contents are too broad to sync wholesale — e.g. a holiday or
|
|
27
|
+
* someone-else's shared calendar, a GitHub org that cascades to every
|
|
28
|
+
* repo, a Microsoft Teams team container). The user can still enable it
|
|
29
|
+
* manually.
|
|
30
|
+
* - `undefined` — no opinion; the client decides. The client defaults to
|
|
31
|
+
* enabling the channel unless its title looks low-value (holidays,
|
|
32
|
+
* birthdays, spam/sent/draft, …).
|
|
33
|
+
*
|
|
34
|
+
* The guiding principle is "sync everything the user would reasonably want
|
|
35
|
+
* by default" — for most connectors that's all channels, so only set this
|
|
36
|
+
* where the connector can distinguish the user's own/relevant channels from
|
|
37
|
+
* low-value ones (e.g. Google Calendar via `accessRole === "owner"`).
|
|
38
|
+
*/
|
|
39
|
+
enabledByDefault?: boolean;
|
|
20
40
|
/** Optional nested channel resources (e.g., subfolders) */
|
|
21
41
|
children?: Channel[];
|
|
22
42
|
/** Per-channel link type configs. Overrides twist-level linkTypes when present. */
|
|
23
43
|
linkTypes?: LinkTypeConfig[];
|
|
24
44
|
};
|
|
25
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Curated status-icon vocabulary. Connectors map each declared status to the
|
|
48
|
+
* closest icon; clients render a single glyph per value. Required on every
|
|
49
|
+
* status so the UI always has something to show.
|
|
50
|
+
*/
|
|
51
|
+
export type StatusIcon =
|
|
52
|
+
| "backlog"
|
|
53
|
+
| "todo"
|
|
54
|
+
| "inProgress"
|
|
55
|
+
| "blocked"
|
|
56
|
+
| "done"
|
|
57
|
+
| "cancelled"
|
|
58
|
+
| "confirmed"
|
|
59
|
+
| "tentative";
|
|
60
|
+
|
|
26
61
|
/**
|
|
27
62
|
* Describes a link type that a connector creates.
|
|
28
63
|
* Used for display in the UI (icons, labels).
|
|
@@ -39,6 +74,28 @@ export type LinkTypeConfig = {
|
|
|
39
74
|
* when omitted. Use the singular noun in title case (e.g. "Comment").
|
|
40
75
|
*/
|
|
41
76
|
noteLabel?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Placeholder shown in the editor when this link type is the target of a
|
|
79
|
+
* new thread (NewThreadPage). Example: "Send a Gmail email".
|
|
80
|
+
* If unset, Plot derives "Create a new {connector} {label.toLowerCase()}".
|
|
81
|
+
*/
|
|
82
|
+
composePlaceholder?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Label for the Send button on NewThreadPage when this link type is the
|
|
85
|
+
* target. Example: "Send". If unset, defaults to "Create".
|
|
86
|
+
*/
|
|
87
|
+
composeVerb?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Placeholder shown in the in-thread editor for the default reply mode.
|
|
90
|
+
* Example: "Reply" (Gmail), "Add a comment" (Linear). If unset, Plot derives
|
|
91
|
+
* "Add a {noteLabel.toLowerCase()}" or "Add a note".
|
|
92
|
+
*/
|
|
93
|
+
replyPlaceholder?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Label for the Send button in the in-thread editor. Example: "Send"
|
|
96
|
+
* (Gmail), "Comment" (Linear). If unset, defaults to "Send".
|
|
97
|
+
*/
|
|
98
|
+
replyVerb?: string;
|
|
42
99
|
/** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */
|
|
43
100
|
logo?: string;
|
|
44
101
|
/** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */
|
|
@@ -51,6 +108,14 @@ export type LinkTypeConfig = {
|
|
|
51
108
|
status: string;
|
|
52
109
|
/** Human-readable label (e.g., "Open", "Done") */
|
|
53
110
|
label: string;
|
|
111
|
+
/** Curated icon for this status (required so the UI always has a glyph). */
|
|
112
|
+
icon: StatusIcon;
|
|
113
|
+
/**
|
|
114
|
+
* Suppress this status's icon on the feed row (ThreadWidget) while still
|
|
115
|
+
* showing it in the ThreadPage header. Use for a "resting" default state
|
|
116
|
+
* that would otherwise clutter the feed (e.g. calendar "Confirmed").
|
|
117
|
+
*/
|
|
118
|
+
hiddenDefault?: boolean;
|
|
54
119
|
/** Whether this status represents completion (done, closed, merged, cancelled, etc.) */
|
|
55
120
|
done?: boolean;
|
|
56
121
|
/**
|
|
@@ -72,6 +137,16 @@ export type LinkTypeConfig = {
|
|
|
72
137
|
}>;
|
|
73
138
|
/** Whether this link type supports displaying and changing the assignee */
|
|
74
139
|
supportsAssignee?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether this link type produces time-anchored schedule/agenda items
|
|
142
|
+
* (i.e. calendar events). The Plot app shows the agenda (the bottom-nav
|
|
143
|
+
* tab on mobile and the left-sidebar agenda on desktop) only when the
|
|
144
|
+
* user has at least one active connection whose link types include one
|
|
145
|
+
* with `includesSchedules: true`. Calendar connectors (Google / Apple /
|
|
146
|
+
* Outlook Calendar) set this on their `event` link type. Defaults to
|
|
147
|
+
* false — non-calendar link types (messages, issues, tasks, docs) omit it.
|
|
148
|
+
*/
|
|
149
|
+
includesSchedules?: boolean;
|
|
75
150
|
/** Default thread creation mode for this link type: 'all' | 'actionable' | 'manual' */
|
|
76
151
|
defaultCreateThreads?: string;
|
|
77
152
|
/**
|
|
@@ -103,6 +178,22 @@ export type LinkTypeConfig = {
|
|
|
103
178
|
* false when omitted.
|
|
104
179
|
*/
|
|
105
180
|
supportsContactChanges?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether a note/reply on this link type can carry a link (a pasted URL or
|
|
183
|
+
* connector-created item) that Plot forwards to the source. When false (the
|
|
184
|
+
* default), the "Add link" button is hidden for threads of this link type.
|
|
185
|
+
* Only set true if the connector's reply path actually forwards the link
|
|
186
|
+
* action to the source. Private Plot notes (no link type) always allow links.
|
|
187
|
+
*/
|
|
188
|
+
supportsLinks?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Whether a note/reply on this link type can carry an uploaded file that Plot
|
|
191
|
+
* forwards to the source as an attachment. When false (the default), the
|
|
192
|
+
* "Attach file" button is hidden for threads of this link type. Only set true
|
|
193
|
+
* if the connector's reply path actually uploads file actions to the source.
|
|
194
|
+
* Private Plot notes (no link type) always allow attachments.
|
|
195
|
+
*/
|
|
196
|
+
supportsFileAttachments?: boolean;
|
|
106
197
|
/**
|
|
107
198
|
* Declares how sharing on threads of this link type is scoped:
|
|
108
199
|
*
|
|
@@ -114,12 +205,16 @@ export type LinkTypeConfig = {
|
|
|
114
205
|
* - `"message"`: each note carries its own recipient set via
|
|
115
206
|
* `note.access_contacts`; the thread roster is the union across
|
|
116
207
|
* all messages. Email.
|
|
208
|
+
* - `"none"`: the link type has no recipient roster at all. No
|
|
209
|
+
* contacts/sharing UI is shown for these threads. Use for purely
|
|
210
|
+
* personal destinations with no sharing concept (e.g. Google
|
|
211
|
+
* Tasks). The per-thread `contacts` array is ignored for sharing UI.
|
|
117
212
|
*
|
|
118
213
|
* Omit to default to `"thread"`. When set to `"message"`, every
|
|
119
214
|
* note this connector ingests must populate `access_contacts`
|
|
120
215
|
* explicitly (never NULL).
|
|
121
216
|
*/
|
|
122
|
-
sharingModel?: "thread" | "channel" | "message";
|
|
217
|
+
sharingModel?: "thread" | "channel" | "message" | "none";
|
|
123
218
|
};
|
|
124
219
|
|
|
125
220
|
/**
|
|
@@ -155,8 +250,11 @@ export type ComposeConfig = {
|
|
|
155
250
|
* `onCreateLink` resolves itself (e.g. Linear's `"unstarted"` category is
|
|
156
251
|
* resolved per-team to a state UUID inside the connector — see
|
|
157
252
|
* `connectors/linear/src/linear.ts`).
|
|
253
|
+
*
|
|
254
|
+
* Omit for status-less link types (e.g. messaging connectors that don't
|
|
255
|
+
* model a status): composed links are created with no status.
|
|
158
256
|
*/
|
|
159
|
-
status
|
|
257
|
+
status?: string;
|
|
160
258
|
/**
|
|
161
259
|
* Optional override for the picker chip / "Create new …" copy. Defaults
|
|
162
260
|
* to the parent linkType's `label`. Use to disambiguate compose entries
|
|
@@ -225,6 +323,22 @@ export type SyncContext = {
|
|
|
225
323
|
* overwrites stored state rather than appending to it.
|
|
226
324
|
*/
|
|
227
325
|
recovering?: boolean;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* True when the channel is being observed because the user composed a Plot
|
|
329
|
+
* thread INTO it (via `onCreateLink`), not because they explicitly enabled
|
|
330
|
+
* it. The connector should register webhooks / mark the channel observed so
|
|
331
|
+
* inbound events (replies, reactions) on the composed thread sync back —
|
|
332
|
+
* but must NOT backfill history. Only go-forward events matter; pulling the
|
|
333
|
+
* channel's existing content would be surprising for a channel the user
|
|
334
|
+
* only posted one thread into.
|
|
335
|
+
*
|
|
336
|
+
* Connectors whose `onChannelEnabled` already skips historical backfill can
|
|
337
|
+
* ignore this flag. Connectors that initial-sync on enable MUST short-
|
|
338
|
+
* circuit that backfill when `observeOnly` is true (still set up webhooks
|
|
339
|
+
* and any go-forward state).
|
|
340
|
+
*/
|
|
341
|
+
observeOnly?: boolean;
|
|
228
342
|
};
|
|
229
343
|
|
|
230
344
|
/**
|
|
@@ -427,6 +541,15 @@ export abstract class Integrations extends ITool {
|
|
|
427
541
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
428
542
|
abstract markNeedsReauth(channelId: string): Promise<void>;
|
|
429
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Upsert workspace custom emoji into Plot's shared cache so reactions using
|
|
546
|
+
* `provider:workspace/name` refs render as images and round-trip. Idempotent;
|
|
547
|
+
* keyed on `id`. Pass `archived: true` to mark an emoji removed. Workspace-
|
|
548
|
+
* scoped (shared across all users of that workspace).
|
|
549
|
+
*/
|
|
550
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
551
|
+
abstract saveCustomEmoji(emoji: NewCustomEmoji[]): Promise<void>;
|
|
552
|
+
|
|
430
553
|
}
|
|
431
554
|
|
|
432
555
|
/**
|
|
@@ -444,6 +567,28 @@ export type ArchiveLinkFilter = {
|
|
|
444
567
|
meta?: Record<string, JSONValue>;
|
|
445
568
|
};
|
|
446
569
|
|
|
570
|
+
/**
|
|
571
|
+
* A workspace custom emoji to cache so Plot can render and round-trip it as a
|
|
572
|
+
* reaction. `id` is the provider-scoped ref stored on reactions, of the form
|
|
573
|
+
* `<provider>:<workspace>/<name>` (e.g. `slack:T0123ABC/party_parrot`).
|
|
574
|
+
*/
|
|
575
|
+
export type NewCustomEmoji = {
|
|
576
|
+
/** Provider-scoped ref: `<provider>:<workspace>/<name>`. The reaction value. */
|
|
577
|
+
id: string;
|
|
578
|
+
/** e.g. "slack". */
|
|
579
|
+
provider: string;
|
|
580
|
+
/** Provider workspace/team id (e.g. Slack team id `T0123ABC`). */
|
|
581
|
+
workspace: string;
|
|
582
|
+
/** Bare emoji name without colons (e.g. "party_parrot"). */
|
|
583
|
+
name: string;
|
|
584
|
+
/** Image URL to render, or null for an alias (see `aliasOf`). */
|
|
585
|
+
imageUrl: string | null;
|
|
586
|
+
/** When this emoji aliases another, the target ref (`id` of the canonical emoji); else null. */
|
|
587
|
+
aliasOf: string | null;
|
|
588
|
+
/** True to mark the emoji removed (archive it) rather than upsert it. */
|
|
589
|
+
archived: boolean;
|
|
590
|
+
};
|
|
591
|
+
|
|
447
592
|
/**
|
|
448
593
|
* Enumeration of supported OAuth providers.
|
|
449
594
|
*
|
package/src/tools/network.ts
CHANGED
|
@@ -133,27 +133,27 @@ export abstract class Network extends ITool {
|
|
|
133
133
|
*
|
|
134
134
|
* **Provider-Specific Behavior:**
|
|
135
135
|
* - **Slack**: Uses provider-specific routing via team_id. Requires `authorization` parameter.
|
|
136
|
-
* - **
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* can be passed to any Google API that accepts a Pub/Sub notification endpoint.
|
|
136
|
+
* - **Pub/Sub** (`pubsub: "gmail" | "workspace"`): Returns a Google Pub/Sub topic name instead
|
|
137
|
+
* of a webhook URL. `"gmail"` targets Gmail `users.watch` (set this only on the Gmail
|
|
138
|
+
* connector); `"workspace"` targets Google Workspace Events (Chat, etc.). A Pub/Sub topic and
|
|
139
|
+
* push subscription are created automatically; the returned topic name (e.g.
|
|
140
|
+
* "projects/plot-prod/topics/gmail-abc123") is passed to the relevant Google API. Other Google
|
|
141
|
+
* connectors (Calendar, Drive) omit `pubsub` and use the default HTTPS webhook.
|
|
143
142
|
* - **Default**: Returns a standard webhook URL for all other cases.
|
|
144
143
|
*
|
|
145
144
|
* @param options - Webhook creation options
|
|
146
145
|
* @param options.provider - Optional provider for provider-specific webhook routing
|
|
147
|
-
* @param options.authorization - Optional authorization for provider-specific webhooks (required for Slack
|
|
146
|
+
* @param options.authorization - Optional authorization for provider-specific webhooks (required for Slack)
|
|
147
|
+
* @param options.pubsub - Optional Google Pub/Sub push product ("gmail" | "workspace")
|
|
148
148
|
* @param callback - Function receiving (request, ...extraArgs)
|
|
149
149
|
* @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
|
|
150
|
-
* @returns Promise resolving to the webhook URL, or for
|
|
150
|
+
* @returns Promise resolving to the webhook URL, or for Pub/Sub, a Pub/Sub topic name
|
|
151
151
|
*
|
|
152
152
|
* @example
|
|
153
153
|
* ```typescript
|
|
154
|
-
* // Pub/Sub webhook for Workspace Events API
|
|
154
|
+
* // Pub/Sub webhook for Workspace Events API (Chat, etc.)
|
|
155
155
|
* const topicName = await this.tools.network.createWebhook(
|
|
156
|
-
* { pubsub:
|
|
156
|
+
* { pubsub: "workspace" },
|
|
157
157
|
* this.onEventReceived,
|
|
158
158
|
* channelId
|
|
159
159
|
* );
|
|
@@ -165,9 +165,9 @@ export abstract class Network extends ITool {
|
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
167
|
* ```typescript
|
|
168
|
-
* // Gmail webhook -
|
|
168
|
+
* // Gmail webhook - returns a Gmail Pub/Sub topic name for users.watch
|
|
169
169
|
* const topicName = await this.tools.network.createWebhook(
|
|
170
|
-
* {},
|
|
170
|
+
* { pubsub: "gmail" },
|
|
171
171
|
* this.onGmailNotification,
|
|
172
172
|
* "inbox"
|
|
173
173
|
* );
|
|
@@ -180,8 +180,20 @@ export abstract class Network extends ITool {
|
|
|
180
180
|
options: {
|
|
181
181
|
provider?: AuthProvider;
|
|
182
182
|
authorization?: Authorization;
|
|
183
|
-
/**
|
|
184
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Create a Google Pub/Sub topic instead of a webhook URL, and return
|
|
185
|
+
* the topic name. Selects the push product:
|
|
186
|
+
*
|
|
187
|
+
* - `"gmail"` — Gmail `users.watch` (topic published to by
|
|
188
|
+
* `gmail-api-push`). Set this only on the Gmail connector.
|
|
189
|
+
* - `"workspace"` — Google Workspace Events (Chat, etc.).
|
|
190
|
+
*
|
|
191
|
+
* This opt-in must be explicit. Other Google connectors (Calendar,
|
|
192
|
+
* Drive) omit it and receive a standard HTTPS webhook URL — they must
|
|
193
|
+
* never be routed to a Pub/Sub topic, which `events.watch` /
|
|
194
|
+
* `files.watch` reject as non-HTTPS.
|
|
195
|
+
*/
|
|
196
|
+
pubsub?: "gmail" | "workspace";
|
|
185
197
|
/**
|
|
186
198
|
* Controls whether the returned webhook URL runs callbacks synchronously
|
|
187
199
|
* or asynchronously.
|