@plotday/twister 0.48.0 → 0.50.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/bin/templates/AGENTS.template.md +8 -2
- package/cli/templates/AGENTS.template.md +8 -2
- package/dist/connector.d.ts +97 -10
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +15 -5
- 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 +84 -51
- 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 +55 -9
- package/dist/docs/classes/tools_network.Network.html +1 -1
- package/dist/docs/classes/tools_plot.Plot.html +11 -19
- package/dist/docs/classes/tools_store.Store.html +25 -2
- 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 +28 -28
- package/dist/docs/documents/Building_Connectors.html +8 -1
- package/dist/docs/documents/Built-in_Tools.html +1 -1
- package/dist/docs/documents/Runtime_Environment.html +25 -1
- package/dist/docs/enums/plot.ActorType.html +4 -4
- package/dist/docs/enums/tag.Tag.html +11 -1
- package/dist/docs/enums/tools_integrations.AuthProvider.html +13 -13
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/media/AGENTS.md +298 -775
- package/dist/docs/media/MULTI_USER_AUTH.md +6 -4
- package/dist/docs/media/SYNC_STRATEGIES.md +20 -14
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/types/index.CreateLinkDraft.html +7 -12
- package/dist/docs/types/index.NewScheduleOccurrence.html +15 -2
- package/dist/docs/types/index.NoteWriteBackResult.html +38 -0
- package/dist/docs/types/index.ScheduleOccurrence.html +2 -4
- package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +1 -1
- 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 +15 -15
- 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 +1 -1
- package/dist/docs/types/plot.NewLinkWithNotes.html +1 -1
- package/dist/docs/types/plot.NewNote.html +1 -1
- package/dist/docs/types/plot.Note.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.SyncContext.html +21 -2
- 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/schedule.d.ts +1 -1
- package/dist/llm-docs/schedule.d.ts.map +1 -1
- package/dist/llm-docs/schedule.js +1 -1
- package/dist/llm-docs/schedule.js.map +1 -1
- 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/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/store.d.ts +1 -1
- package/dist/llm-docs/tools/store.d.ts.map +1 -1
- package/dist/llm-docs/tools/store.js +1 -1
- package/dist/llm-docs/tools/store.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 +8 -1
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js.map +1 -1
- package/dist/schedule.d.ts +18 -2
- package/dist/schedule.d.ts.map +1 -1
- package/dist/tag.d.ts +11 -1
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +10 -0
- package/dist/tag.js.map +1 -1
- package/dist/tools/integrations.d.ts +86 -0
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/plot.d.ts +0 -11
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/store.d.ts +40 -0
- package/dist/tools/store.d.ts.map +1 -1
- package/dist/tools/store.js.map +1 -1
- package/dist/twist-guide.d.ts +1 -1
- package/dist/twist-guide.d.ts.map +1 -1
- package/dist/twist.d.ts +2 -1
- package/dist/twist.d.ts.map +1 -1
- package/dist/twist.js.map +1 -1
- package/dist/utils/markdown.d.ts +27 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +82 -0
- package/dist/utils/markdown.js.map +1 -0
- package/package.json +6 -1
- package/src/connector.ts +98 -10
- package/src/llm-docs/connector.ts +1 -1
- package/src/llm-docs/plot.ts +1 -1
- package/src/llm-docs/schedule.ts +1 -1
- package/src/llm-docs/tag.ts +1 -1
- package/src/llm-docs/tools/integrations.ts +1 -1
- package/src/llm-docs/tools/plot.ts +1 -1
- package/src/llm-docs/tools/store.ts +1 -1
- package/src/llm-docs/twist-guide-template.ts +1 -1
- package/src/llm-docs/twist.ts +1 -1
- package/src/plot.ts +8 -1
- package/src/schedule.ts +19 -3
- package/src/tag.ts +10 -0
- package/src/tools/integrations.ts +93 -0
- package/src/tools/plot.ts +0 -12
- package/src/tools/store.ts +44 -0
- package/src/twist.ts +2 -1
- package/src/utils/markdown.ts +94 -0
|
@@ -183,9 +183,15 @@ async onThreadUpdated(thread: Thread, changes: { tagsAdded, tagsRemoved }): Prom
|
|
|
183
183
|
if (tool?.updateIssue) await tool.updateIssue(thread);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
async onNoteCreated(note: Note): Promise<void> {
|
|
186
|
+
async onNoteCreated(note: Note, thread: Thread): Promise<NoteWriteBackResult | void> {
|
|
187
187
|
if (note.author.type === ActorType.Twist) return; // Prevent loops
|
|
188
|
-
// Sync note to external service as a comment
|
|
188
|
+
// Sync note to external service as a comment. Return the external
|
|
189
|
+
// system's id + stored content so the runtime can set note.key AND
|
|
190
|
+
// record a sync baseline that preserves Plot's content on round-trip.
|
|
191
|
+
// See connectors/AGENTS.md → "Sync baseline preservation".
|
|
192
|
+
const comment = await externalApi.createComment(thread.meta.externalId, { body: note.content ?? "" });
|
|
193
|
+
if (!comment?.id) return;
|
|
194
|
+
return { key: `comment-${comment.id}`, externalContent: comment.body };
|
|
189
195
|
}
|
|
190
196
|
```
|
|
191
197
|
|
|
@@ -183,9 +183,15 @@ async onThreadUpdated(thread: Thread, changes: { tagsAdded, tagsRemoved }): Prom
|
|
|
183
183
|
if (tool?.updateIssue) await tool.updateIssue(thread);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
async onNoteCreated(note: Note): Promise<void> {
|
|
186
|
+
async onNoteCreated(note: Note, thread: Thread): Promise<NoteWriteBackResult | void> {
|
|
187
187
|
if (note.author.type === ActorType.Twist) return; // Prevent loops
|
|
188
|
-
// Sync note to external service as a comment
|
|
188
|
+
// Sync note to external service as a comment. Return the external
|
|
189
|
+
// system's id + stored content so the runtime can set note.key AND
|
|
190
|
+
// record a sync baseline that preserves Plot's content on round-trip.
|
|
191
|
+
// See connectors/AGENTS.md → "Sync baseline preservation".
|
|
192
|
+
const comment = await externalApi.createComment(thread.meta.externalId, { body: note.content ?? "" });
|
|
193
|
+
if (!comment?.id) return;
|
|
194
|
+
return { key: `comment-${comment.id}`, externalContent: comment.body };
|
|
189
195
|
}
|
|
190
196
|
```
|
|
191
197
|
|
package/dist/connector.d.ts
CHANGED
|
@@ -10,6 +10,56 @@ import { Twist } from "./twist";
|
|
|
10
10
|
* The platform attaches the returned `NewLinkWithNotes` to the originating
|
|
11
11
|
* thread once `onCreateLink` resolves.
|
|
12
12
|
*/
|
|
13
|
+
/**
|
|
14
|
+
* Result returned from {@link Connector.onNoteCreated} and
|
|
15
|
+
* {@link Connector.onNoteUpdated} to report what the external system now
|
|
16
|
+
* has stored for the note.
|
|
17
|
+
*
|
|
18
|
+
* The runtime hashes `externalContent` and stores it as the note's sync
|
|
19
|
+
* baseline. On the next sync-in, if the incoming content hashes to the
|
|
20
|
+
* same value, the runtime knows the external side hasn't changed and
|
|
21
|
+
* preserves Plot's (possibly formatted) content. When the external side
|
|
22
|
+
* is edited, the hash diverges and the runtime overwrites Plot's content
|
|
23
|
+
* with the new external version.
|
|
24
|
+
*
|
|
25
|
+
* Omitting `externalContent` skips baseline tracking — the next sync-in
|
|
26
|
+
* will overwrite Plot's content (previous behavior). Always provide it
|
|
27
|
+
* when the write-back's return value reflects what the external system
|
|
28
|
+
* actually stored (often lossy plain-text), so the round-trip does not
|
|
29
|
+
* clobber the original Plot markdown.
|
|
30
|
+
*
|
|
31
|
+
* The hash covers only the content string — the runtime intentionally
|
|
32
|
+
* does not include a content-type in the hash, so write-back and sync-in
|
|
33
|
+
* do not have to agree on a content-type label for the same underlying
|
|
34
|
+
* bytes. Return exactly the string your connector's sync-in path will
|
|
35
|
+
* emit as `NewNote.content` for this note on the next re-ingest.
|
|
36
|
+
*
|
|
37
|
+
* For back-compat, `onNoteCreated` may also return a plain string, which
|
|
38
|
+
* is treated as `{ key }` with no baseline.
|
|
39
|
+
*/
|
|
40
|
+
export type NoteWriteBackResult = {
|
|
41
|
+
/**
|
|
42
|
+
* External system identifier assigned to this note. Set as the note's
|
|
43
|
+
* `key` for future upsert matching. Required when the runtime does not
|
|
44
|
+
* already know the key (i.e., from `onNoteCreated`); ignored from
|
|
45
|
+
* `onNoteUpdated` when the key was already established on create.
|
|
46
|
+
*/
|
|
47
|
+
key?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The content string as the external system now stores it, post-write.
|
|
50
|
+
* For systems whose write-back returns a representation of what was
|
|
51
|
+
* actually stored (e.g. Google Drive comment `content` after a create),
|
|
52
|
+
* pass that verbatim. For systems that only accept plain text, this
|
|
53
|
+
* will often be a lossy plain-text version of the Plot markdown — that
|
|
54
|
+
* is exactly the point: storing the lossy form as baseline lets the
|
|
55
|
+
* next sync-in recognize it and skip overwriting the richer Plot
|
|
56
|
+
* version.
|
|
57
|
+
*
|
|
58
|
+
* Must exactly match the string your connector's sync-in path emits as
|
|
59
|
+
* `NewNote.content` for this note on re-ingest.
|
|
60
|
+
*/
|
|
61
|
+
externalContent?: string;
|
|
62
|
+
};
|
|
13
63
|
export type CreateLinkDraft = {
|
|
14
64
|
/** The channel (account + resource) the new item belongs to. */
|
|
15
65
|
channelId: string;
|
|
@@ -151,6 +201,29 @@ export declare abstract class Connector<TSelf> extends Twist<TSelf> {
|
|
|
151
201
|
/**
|
|
152
202
|
* Called when a channel resource is enabled for syncing.
|
|
153
203
|
*
|
|
204
|
+
* The framework dispatches this in three cases:
|
|
205
|
+
* 1. **Initial enable** — user toggled the channel on for the first time.
|
|
206
|
+
* 2. **Auto-enable** — `setChannels` discovered a new channel on a
|
|
207
|
+
* connection with `auto_enable_new_channels` set.
|
|
208
|
+
* 3. **Recovery after re-auth** — the user re-authorized a previously-
|
|
209
|
+
* broken connection. The framework calls `onChannelEnabled` for every
|
|
210
|
+
* channel that was already enabled at the time of re-auth, with
|
|
211
|
+
* `context.recovering = true`. See {@link SyncContext.recovering}.
|
|
212
|
+
*
|
|
213
|
+
* Implementations should be **idempotent and overwrite stored state**:
|
|
214
|
+
* the same channel may receive multiple `onChannelEnabled` calls across
|
|
215
|
+
* its lifetime. Use unconditional `this.set()` writes rather than
|
|
216
|
+
* coalesce/skip-if-present logic so a recovery dispatch wipes stale
|
|
217
|
+
* cursors and state from the prior session.
|
|
218
|
+
*
|
|
219
|
+
* **Sync state tracking is automatic.** The framework stamps the
|
|
220
|
+
* connection as "syncing" when it dispatches this method and clears
|
|
221
|
+
* that state when:
|
|
222
|
+
* - the connector calls `tools.integrations.channelSyncCompleted(id)`
|
|
223
|
+
* once the initial backfill is done, OR
|
|
224
|
+
* - this method throws an unhandled exception (auto-cleared so the UI
|
|
225
|
+
* doesn't get stuck in "syncing" forever).
|
|
226
|
+
*
|
|
154
227
|
* **IMPORTANT: This method runs inline in the HTTP request handler.**
|
|
155
228
|
* Any long-running work (webhook setup, API calls, sync) MUST be queued
|
|
156
229
|
* as a separate task via `this.runTask()`, not executed inline. Blocking
|
|
@@ -161,8 +234,12 @@ export declare abstract class Connector<TSelf> extends Twist<TSelf> {
|
|
|
161
234
|
*
|
|
162
235
|
* @example
|
|
163
236
|
* ```typescript
|
|
164
|
-
* async onChannelEnabled(channel: Channel): Promise<void> {
|
|
165
|
-
*
|
|
237
|
+
* async onChannelEnabled(channel: Channel, context?: SyncContext): Promise<void> {
|
|
238
|
+
* // Recovery: drop stale cursors so the next sync re-walks history.
|
|
239
|
+
* if (context?.recovering) {
|
|
240
|
+
* await this.clear(`last_sync_token_${channel.id}`);
|
|
241
|
+
* }
|
|
242
|
+
*
|
|
166
243
|
* await this.set(`sync_state_${channel.id}`, { channelId: channel.id });
|
|
167
244
|
*
|
|
168
245
|
* // Queue sync as a task — do NOT use this.run() or call sync methods inline
|
|
@@ -176,7 +253,7 @@ export declare abstract class Connector<TSelf> extends Twist<TSelf> {
|
|
|
176
253
|
* ```
|
|
177
254
|
*
|
|
178
255
|
* @param channel - The channel that was enabled
|
|
179
|
-
* @param context - Optional sync context
|
|
256
|
+
* @param context - Optional sync context (plan-based hints, recovery flag)
|
|
180
257
|
*/
|
|
181
258
|
abstract onChannelEnabled(channel: Channel, context?: SyncContext): Promise<void>;
|
|
182
259
|
/**
|
|
@@ -220,24 +297,34 @@ export declare abstract class Connector<TSelf> extends Twist<TSelf> {
|
|
|
220
297
|
* Override to write back comments to the external service
|
|
221
298
|
* (e.g., adding a comment to a Linear issue).
|
|
222
299
|
*
|
|
223
|
-
* Returning a string
|
|
224
|
-
*
|
|
225
|
-
*
|
|
300
|
+
* Returning a string or {@link NoteWriteBackResult} links the Plot note
|
|
301
|
+
* to its external counterpart. A plain string sets the note's `key`.
|
|
302
|
+
* A `NoteWriteBackResult` additionally sets a sync baseline (via
|
|
303
|
+
* `externalContent`) so the next sync-in can recognize the round-tripped
|
|
304
|
+
* content and preserve Plot's formatted version. See
|
|
305
|
+
* {@link NoteWriteBackResult} for details.
|
|
226
306
|
*
|
|
227
307
|
* @param note - The created note
|
|
228
308
|
* @param thread - The thread the note belongs to (includes thread.meta with connector-specific data)
|
|
229
|
-
* @returns Optional note key for external
|
|
309
|
+
* @returns Optional note key or NoteWriteBackResult for external dedup + baseline tracking
|
|
230
310
|
*/
|
|
231
|
-
onNoteCreated(note: Note, thread: Thread): Promise<string | void>;
|
|
311
|
+
onNoteCreated(note: Note, thread: Thread): Promise<string | NoteWriteBackResult | void>;
|
|
232
312
|
/**
|
|
233
313
|
* Called when a note on a thread owned by this connector is updated.
|
|
234
314
|
* Override to write back changes to the external service
|
|
235
|
-
* (e.g., syncing reaction tags as emoji reactions
|
|
315
|
+
* (e.g., syncing reaction tags as emoji reactions, or editing a comment
|
|
316
|
+
* whose content changed in Plot).
|
|
317
|
+
*
|
|
318
|
+
* Return a {@link NoteWriteBackResult} with `externalContent` to update
|
|
319
|
+
* the sync baseline after a successful write-back, so the next sync-in
|
|
320
|
+
* recognizes the external version as already-seen and preserves Plot's
|
|
321
|
+
* content.
|
|
236
322
|
*
|
|
237
323
|
* @param note - The updated note (includes current tags)
|
|
238
324
|
* @param thread - The thread the note belongs to (includes thread.meta with connector-specific data)
|
|
325
|
+
* @returns Optional NoteWriteBackResult for baseline tracking
|
|
239
326
|
*/
|
|
240
|
-
onNoteUpdated(note: Note, thread: Thread): Promise<void>;
|
|
327
|
+
onNoteUpdated(note: Note, thread: Thread): Promise<NoteWriteBackResult | void>;
|
|
241
328
|
/**
|
|
242
329
|
* Called when a user reads or unreads a thread owned by this connector.
|
|
243
330
|
* Override to write back read status to the external service
|
package/dist/connector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC5G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,gEAAgE;I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service
|
|
158
158
|
* (e.g., adding a comment to a Linear issue).
|
|
159
159
|
*
|
|
160
|
-
* Returning a string
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* Returning a string or {@link NoteWriteBackResult} links the Plot note
|
|
161
|
+
* to its external counterpart. A plain string sets the note's `key`.
|
|
162
|
+
* A `NoteWriteBackResult` additionally sets a sync baseline (via
|
|
163
|
+
* `externalContent`) so the next sync-in can recognize the round-tripped
|
|
164
|
+
* content and preserve Plot's formatted version. See
|
|
165
|
+
* {@link NoteWriteBackResult} for details.
|
|
163
166
|
*
|
|
164
167
|
* @param note - The created note
|
|
165
168
|
* @param thread - The thread the note belongs to (includes thread.meta with connector-specific data)
|
|
166
|
-
* @returns Optional note key for external
|
|
169
|
+
* @returns Optional note key or NoteWriteBackResult for external dedup + baseline tracking
|
|
167
170
|
*/
|
|
168
171
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
169
172
|
onNoteCreated(note, thread) {
|
|
@@ -172,10 +175,17 @@ export class Connector extends Twist {
|
|
|
172
175
|
/**
|
|
173
176
|
* Called when a note on a thread owned by this connector is updated.
|
|
174
177
|
* Override to write back changes to the external service
|
|
175
|
-
* (e.g., syncing reaction tags as emoji reactions
|
|
178
|
+
* (e.g., syncing reaction tags as emoji reactions, or editing a comment
|
|
179
|
+
* whose content changed in Plot).
|
|
180
|
+
*
|
|
181
|
+
* Return a {@link NoteWriteBackResult} with `externalContent` to update
|
|
182
|
+
* the sync baseline after a successful write-back, so the next sync-in
|
|
183
|
+
* recognizes the external version as already-seen and preserves Plot's
|
|
184
|
+
* content.
|
|
176
185
|
*
|
|
177
186
|
* @param note - The updated note (includes current tags)
|
|
178
187
|
* @param thread - The thread the note belongs to (includes thread.meta with connector-specific data)
|
|
188
|
+
* @returns Optional NoteWriteBackResult for baseline tracking
|
|
179
189
|
*/
|
|
180
190
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
181
191
|
onNoteUpdated(note, thread) {
|
package/dist/connector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAiFhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,OAAgB,SAAiB,SAAQ,KAAY;IACzD;;;OAGG;IACH,MAAM,CAAU,WAAW,GAAG,IAAI,CAAC;IAEnC,+DAA+D;IAE/D,4DAA4D;IACnD,QAAQ,CAAgB;IAEjC,kDAAkD;IACzC,MAAM,CAAY;IAE3B,uBAAuB;IAEvB;;;;;;;;;;OAUG;IACM,MAAM,CAAW;IAE1B;;;;;;;OAOG;IACM,SAAS,CAAU;IAE5B,8BAA8B;IAE9B;;;;OAIG;IACM,aAAa,CAAW;IAEjC;;;OAGG;IACM,SAAS,CAAoB;IAEtC;;;;;;OAMG;IACH,MAAM,CAAU,aAAa,CAAW;IAExC,yEAAyE;IAEzE;;;;;;;;;;;;;OAaG;IACH,6DAA6D;IAC7D,cAAc,CACZ,IAA0B,EAC1B,KAAuB;QAEvB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAoFD,wDAAwD;IAExD;;;;;;OAMG;IACH,6DAA6D;IAC7D,aAAa,CAAC,IAAU;QACtB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,6DAA6D;IAC7D,YAAY,CAAC,KAAsB;QACjC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,6DAA6D;IAC7D,aAAa,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