@plotday/twister 0.64.0 → 0.65.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/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/index.Connector.html +1 -1
- 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_integrations.Integrations.html +15 -15
- package/dist/docs/classes/tools_network.Network.html +1 -1
- 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/enums/tools_integrations.AuthProvider.html +13 -13
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +5 -5
- package/dist/docs/types/tools_integrations.ArchiveNotesFilter.html +2 -2
- 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.ComposeConfig.html +4 -4
- package/dist/docs/types/tools_integrations.ContactRoleConfig.html +5 -5
- package/dist/docs/types/tools_integrations.LinkTypeConfig.html +31 -20
- package/dist/docs/types/tools_integrations.NewCustomEmoji.html +8 -8
- package/dist/docs/types/tools_integrations.SyncContext.html +4 -4
- 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/tools/integrations.d.ts +13 -0
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js.map +1 -1
- package/package.json +1 -1
- package/src/llm-docs/tools/integrations.ts +1 -1
- package/src/tools/integrations.ts +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,EACN,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,mFAAmF;IACnF,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,MAAM,GACN,YAAY,GACZ,SAAS,GACT,MAAM,GACN,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAA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AAE,MAAM,GAAG,IAAI,CAAC;IACvB,yEAAyE;IACzE,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,0DAA0D;IAC1D,MAAM,WAAW;IACjB,0DAA0D;IAC1D,SAAS,cAAc;IACvB,kDAAkD;IAClD,MAAM,WAAW;IACjB,gDAAgD;IAChD,KAAK,UAAU;IACf,uDAAuD;IACvD,SAAS,cAAc;IACvB,kDAAkD;IAClD,MAAM,WAAW;IACjB,gCAAgC;IAChC,MAAM,WAAW;IACjB,sEAAsE;IACtE,MAAM,WAAW;IACjB,gDAAgD;IAChD,KAAK,UAAU;IACf,6CAA6C;IAC7C,OAAO,YAAY;IACnB,yDAAyD;IACzD,OAAO,YAAY;IACnB,iDAAiD;IACjD,QAAQ,aAAa;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,mDAAmD;IACnD,QAAQ,EAAE,YAAY,CAAC;IACvB,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GACN,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GACN,MAAM,IAAI,CAAC;AA8VZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;IAC9C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,WAAuB;QAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;CAsLF;AAgDD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAyBX;AAzBD,WAAY,YAAY;IACtB,0DAA0D;IAC1D,iCAAiB,CAAA;IACjB,0DAA0D;IAC1D,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,uDAAuD;IACvD,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gCAAgC;IAChC,iCAAiB,CAAA;IACjB,sEAAsE;IACtE,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,6CAA6C;IAC7C,mCAAmB,CAAA;IACnB,yDAAyD;IACzD,mCAAmB,CAAA;IACnB,iDAAiD;IACjD,qCAAqB,CAAA;AACvB,CAAC,EAzBW,YAAY,KAAZ,YAAY,QAyBvB"}
|
package/package.json
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Generated from: prebuild.ts
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export default "import {\n type Actor,\n type ActorId,\n type NewContact,\n type NewLinkWithNotes,\n type NewNote,\n ITool,\n} from \"..\";\nimport type { JSONValue } from \"../utils/types\";\nimport type { Uuid } from \"../utils/uuid\";\n\n/**\n * A resource that can be synced (e.g., a calendar, project, channel).\n * Returned by getChannels() and managed by users in the twist setup/edit modal.\n */\nexport type Channel = {\n /** External ID shared across users (e.g., Google calendar ID) */\n id: string;\n /** Display name shown in the UI */\n title: string;\n /**\n * Whether this channel should be selected by default when the user first\n * adds the connection. Tri-state:\n * - `true` — pre-select it (e.g. the user's own/primary calendar).\n * - `false` — exclude it from the default selection (low-value or\n * irrelevant resources that would crowd the user's view, or containers\n * whose contents are too broad to sync wholesale — e.g. a holiday or\n * someone-else's shared calendar, a GitHub org that cascades to every\n * repo, a Microsoft Teams team container). The user can still enable it\n * manually.\n * - `undefined` — no opinion; the client decides. The client defaults to\n * enabling the channel unless its title looks low-value (holidays,\n * birthdays, spam/sent/draft, …).\n *\n * The guiding principle is \"sync everything the user would reasonably want\n * by default\" — for most connectors that's all channels, so only set this\n * where the connector can distinguish the user's own/relevant channels from\n * low-value ones (e.g. Google Calendar via `accessRole === \"owner\"`).\n */\n enabledByDefault?: boolean;\n /** Optional nested channel resources (e.g., subfolders) */\n children?: Channel[];\n /** Per-channel link type configs. Overrides twist-level linkTypes when present. */\n linkTypes?: LinkTypeConfig[];\n};\n\n/**\n * Curated status-icon vocabulary. Connectors map each declared status to the\n * closest icon; clients render a single glyph per value. Required on every\n * status so the UI always has something to show.\n */\nexport type StatusIcon =\n | \"backlog\"\n | \"todo\"\n | \"inProgress\"\n | \"blocked\"\n | \"done\"\n | \"cancelled\"\n | \"confirmed\"\n | \"tentative\";\n\n/**\n * Describes a link type that a connector creates.\n * Used for display in the UI (icons, labels).\n */\nexport type LinkTypeConfig = {\n /** Machine-readable type identifier (e.g., \"issue\", \"pull_request\") */\n type: string;\n /** Human-readable label (e.g., \"Issue\", \"Pull Request\") */\n label: string;\n /**\n * Connector's word for a note on a linked item of this type — used by the\n * Flutter app to adapt note/composer copy (\"Add a comment\" on Linear,\n * \"Add a message\" on Slack, \"Add a reply\" on Gmail). Defaults to \"note\"\n * when omitted. Use the singular noun in title case (e.g. \"Comment\").\n */\n noteLabel?: string;\n /**\n * Placeholder shown in the editor when this link type is the target of a\n * new thread (NewThreadPage). Example: \"Send a Gmail email\".\n * If unset, Plot derives \"Create a new {connector} {label.toLowerCase()}\".\n */\n composePlaceholder?: string;\n /**\n * Label for the Send button on NewThreadPage when this link type is the\n * target. Example: \"Send\". If unset, defaults to \"Create\".\n */\n composeVerb?: string;\n /**\n * Placeholder shown in the in-thread editor for the default reply mode.\n * Example: \"Reply\" (Gmail), \"Add a comment\" (Linear). If unset, Plot derives\n * \"Add a {noteLabel.toLowerCase()}\" or \"Add a note\".\n */\n replyPlaceholder?: string;\n /**\n * Label for the Send button in the in-thread editor. Example: \"Send\"\n * (Gmail), \"Comment\" (Linear). If unset, defaults to \"Send\".\n */\n replyVerb?: string;\n /** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */\n logo?: string;\n /** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */\n logoDark?: string;\n /** URL to a monochrome icon (uses `currentColor`). Prefer Iconify `simple-icons/*` URLs without a `?color=` param. */\n logoMono?: string;\n /** Possible status values for this type */\n statuses?: Array<{\n /** Machine-readable status (e.g., \"open\", \"done\") */\n status: string;\n /** Human-readable label (e.g., \"Open\", \"Done\") */\n label: string;\n /** Curated icon for this status (required so the UI always has a glyph). */\n icon: StatusIcon;\n /**\n * Suppress this status's icon on the feed row (ThreadWidget) while still\n * showing it in the ThreadPage header. Use for a \"resting\" default state\n * that would otherwise clutter the feed (e.g. calendar \"Confirmed\").\n */\n hiddenDefault?: boolean;\n /** Whether this status represents completion (done, closed, merged, cancelled, etc.) */\n done?: boolean;\n /**\n * Mark the thread `active=true` in Plot when a link enters this status.\n * Use for messaging-style flags where the user has indicated they want\n * to act on the thread now — Gmail's \"starred\", Slack's \"later\", etc.\n * The Plot user can later un-flag the thread without breaking the\n * connector relationship.\n */\n active?: boolean;\n /**\n * Marks this status as the connector's \"to-do\" / active state. When a\n * user brings a done thread back into Plot's agenda, done-status links\n * are flipped to the status marked `todo: true` (e.g. Gmail's \"starred\",\n * Linear's \"unstarted\"); connectors that don't mark one fall back to the\n * first non-done status.\n */\n todo?: boolean;\n }>;\n /** Whether this link type supports displaying and changing the assignee */\n supportsAssignee?: boolean;\n /**\n * Whether this link type produces time-anchored schedule/agenda items\n * (i.e. calendar events). The Plot app shows the agenda (the bottom-nav\n * tab on mobile and the left-sidebar agenda on desktop) only when the\n * user has at least one active connection whose link types include one\n * with `includesSchedules: true`. Calendar connectors (Google / Apple /\n * Outlook Calendar) set this on their `event` link type. Defaults to\n * false — non-calendar link types (messages, issues, tasks, docs) omit it.\n */\n includesSchedules?: boolean;\n /** Default thread creation mode for this link type: 'all' | 'actionable' | 'manual' */\n defaultCreateThreads?: string;\n /**\n * Opt-in: declares this link type is composable from Plot via\n * `Connector.onCreateLink`. Omit to make the link type sync-only (no\n * \"Create new …\" picker entry).\n *\n * Connectors that need multiple compose modes for what users perceive as\n * the same kind of thing (e.g. Slack channel post vs DM) should declare\n * **separate linkTypes**, one per user-facing thread type. That keeps\n * each linkType isomorphic to one filter chip.\n */\n compose?: ComposeConfig;\n /**\n * Per-connector contact roles. Examples:\n * email → [{id:\"to\",label:\"To\",default:true},{id:\"cc\",label:\"CC\"},{id:\"bcc\",label:\"BCC\",hidden:true}]\n * calendar → [{id:\"required\",label:\"Required\",default:true},{id:\"optional\",label:\"Optional\"}]\n *\n * Plot uses this list to render a role picker on each contact chip in the\n * composer and to label non-default roles on existing threads. Exactly one\n * role should be marked `default: true`. Connectors that don't distinguish\n * roles (Slack, Linear) omit this field entirely.\n */\n contactRoles?: ContactRoleConfig[];\n /**\n * Whether contacts on an existing thread can be added, removed, or have\n * their role changed (email-style mid-thread recipient changes). When\n * false, the thread's contact list is fixed after creation. Defaults to\n * false when omitted.\n */\n supportsContactChanges?: boolean;\n /**\n * Whether a note/reply on this link type can carry a link (a pasted URL or\n * connector-created item) that Plot forwards to the source. When false (the\n * default), the \"Add link\" button is hidden for threads of this link type.\n * Only set true if the connector's reply path actually forwards the link\n * action to the source. Private Plot notes (no link type) always allow links.\n */\n supportsLinks?: boolean;\n /**\n * Whether a note/reply on this link type can carry an uploaded file that Plot\n * forwards to the source as an attachment. When false (the default), the\n * \"Attach file\" button is hidden for threads of this link type. Only set true\n * if the connector's reply path actually uploads file actions to the source.\n * Private Plot notes (no link type) always allow attachments.\n */\n supportsFileAttachments?: boolean;\n /**\n * Declares how sharing on threads of this link type is scoped:\n *\n * - `\"thread\"` (default): one roster shared across all notes in the\n * thread. Native Plot threads, Slack DMs, calendar events.\n * - `\"channel\"`: visibility is the external channel's membership;\n * the per-thread `contacts` array is ignored for sharing UI.\n * Slack channels, Linear projects.\n * - `\"message\"`: each note carries its own recipient set via\n * `note.access_contacts`; the thread roster is the union across\n * all messages. Email.\n * - `\"none\"`: the link type has no recipient roster at all. No\n * contacts/sharing UI is shown for these threads. Use for purely\n * personal destinations with no sharing concept (e.g. Google\n * Tasks). The per-thread `contacts` array is ignored for sharing UI.\n *\n * Omit to default to `\"thread\"`. When set to `\"message\"`, every\n * note this connector ingests must populate `access_contacts`\n * explicitly (never NULL).\n */\n sharingModel?: \"thread\" | \"channel\" | \"message\" | \"none\";\n};\n\n/**\n * Declares how a link type is composable from Plot via\n * `Connector.onCreateLink`. Attached to {@link LinkTypeConfig.compose}.\n */\nexport type ComposeConfig = {\n /**\n * Selects the destination model for the \"Create new …\" picker.\n *\n * - `\"channels\"` (default): one chip per enabled channel (e.g. a Linear\n * team, a Slack channel). Existing behaviour for task-tracker / calendar\n * connectors.\n * - `\"contacts\"`: one chip per connection (account); the user picks\n * recipients from their contacts. The runtime pre-resolves the chosen\n * Plot contacts to platform account IDs via the per-connection\n * `contact_external_account` rows and delivers them as\n * `CreateLinkDraft.recipients`. Contacts without a row for this specific\n * connection are filtered out of the picker — used by closed-roster\n * messaging platforms (Slack DM, Teams DM, Google Chat DM, LinkedIn DM).\n * - `\"addresses\"`: one chip per connection; the picker accepts any\n * contact with an addressable identifier (e.g. an email) or a free-form\n * typed address. The runtime fills `recipients` for contacts with a\n * connection-scoped row and falls back to the contact's primary address\n * (e.g. `contact.email`) when no row exists. Free-form addresses arrive\n * via the thread's `inviteEmails`. Used by open address spaces like\n * Gmail.\n */\n targets?: \"channels\" | \"contacts\" | \"addresses\";\n /**\n * Status to assign newly-created links. Should match an entry in the\n * parent linkType's `statuses[]`, OR a symbolic id that the connector's\n * `onCreateLink` resolves itself (e.g. Linear's `\"unstarted\"` category is\n * resolved per-team to a state UUID inside the connector — see\n * `connectors/linear/src/linear.ts`).\n *\n * Omit for status-less link types (e.g. messaging connectors that don't\n * model a status): composed links are created with no status.\n */\n status?: string;\n /**\n * Optional override for the picker chip / \"Create new …\" copy. Defaults\n * to the parent linkType's `label`. Use to disambiguate compose entries\n * when the parent label alone isn't specific enough (e.g. \"Direct\n * messages\" for a DM-mode compose on a chat connector).\n */\n label?: string;\n};\n\n/**\n * Declares one contact role for a connector's link type. See\n * `LinkTypeConfig.contactRoles`.\n */\nexport type ContactRoleConfig = {\n /** Stable machine id, e.g. \"to\" / \"cc\" / \"bcc\" / \"required\" / \"optional\". */\n id: string;\n /** Display label shown next to a contact chip, e.g. \"To\", \"CC\", \"Required\". */\n label: string;\n /** Exactly one role per linkType should be marked default. */\n default?: boolean;\n /**\n * Hidden roles are visible only to (a) the contact themselves and\n * (b) the user who added them. The API filters them out of every other\n * viewer's `thread.contacts` and `thread.contactMeta`. Use for BCC-style\n * semantics where other recipients must not see the hidden contact.\n */\n hidden?: boolean;\n};\n\n/**\n * Context passed to onChannelEnabled with plan-based sync hints.\n * Connectors can use these hints to limit initial sync scope.\n */\nexport type SyncContext = {\n /**\n * Earliest date to include in initial sync, based on the user's plan.\n *\n * Non-calendar connectors should use this as their date filter (timeMin,\n * created.gte, etc.) during initial sync. Calendar connectors should\n * ignore this for API queries (to avoid missing recurring events) — the\n * API layer filters non-recurring items automatically.\n *\n * Undefined when no limit applies.\n */\n syncHistoryMin?: Date;\n\n /**\n * True when this is a recovery dispatch after the connection's auth was\n * restored (the user re-authorized a previously-broken connection).\n *\n * The framework calls `onChannelEnabled` again for every channel that was\n * already enabled at the time of re-auth so the connector can recover from\n * the auth gap. Connectors should:\n *\n * 1. Drop any persisted incremental sync cursors / sync tokens so the\n * next sync re-walks history (the cursor may be stale or invalid —\n * Google Calendar invalidates syncTokens after ~7 days).\n * 2. Re-register webhooks (any prior subscription may have been\n * invalidated during the auth outage).\n * 3. Treat this as a backfill that walks history but does NOT spam\n * notifications — set `unread: false` and `archived: false` on\n * items as you would during initial sync.\n *\n * Most connectors can take the same code path as a fresh\n * `onChannelEnabled` for `recovering: true` as long as that path\n * overwrites stored state rather than appending to it.\n */\n recovering?: boolean;\n\n /**\n * True when the channel is being observed because the user composed a Plot\n * thread INTO it (via `onCreateLink`), not because they explicitly enabled\n * it. The connector should register webhooks / mark the channel observed so\n * inbound events (replies, reactions) on the composed thread sync back —\n * but must NOT backfill history. Only go-forward events matter; pulling the\n * channel's existing content would be surprising for a channel the user\n * only posted one thread into.\n *\n * Connectors whose `onChannelEnabled` already skips historical backfill can\n * ignore this flag. Connectors that initial-sync on enable MUST short-\n * circuit that backfill when `observeOnly` is true (still set up webhooks\n * and any go-forward state).\n */\n observeOnly?: boolean;\n};\n\n/**\n * Built-in tool for managing OAuth authentication and channel resources.\n *\n * The Integrations tool:\n * 1. Manages channel resources (calendars, projects, etc.) per actor\n * 2. Returns tokens for the user who enabled sync on a channel\n * 3. Supports per-actor auth via actAs() for write-back operations\n * 4. Provides saveLink/saveContacts for Connectors to save data directly\n *\n * Connectors declare their provider, scopes, and channel lifecycle methods as\n * class properties and methods. The Integrations tool reads these automatically.\n * Auth and channel management is handled in the twist edit modal in Flutter.\n *\n * @example\n * ```typescript\n * class CalendarConnector extends Connector<CalendarConnector> {\n * readonly provider = AuthProvider.Google;\n * readonly scopes = [\"https://www.googleapis.com/auth/calendar\"];\n *\n * build(build: ToolBuilder) {\n * return {\n * integrations: build(Integrations),\n * };\n * }\n *\n * async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {\n * const calendars = await this.listCalendars(token);\n * return calendars.map(c => ({ id: c.id, title: c.name }));\n * }\n *\n * async onChannelEnabled(channel: Channel) {\n * // Start syncing\n * }\n *\n * async onChannelDisabled(channel: Channel) {\n * // Stop syncing\n * }\n * }\n * ```\n */\nexport abstract class Integrations extends ITool {\n /**\n * Merge scopes from multiple tools, deduplicating.\n *\n * @param scopeArrays - Arrays of scopes to merge\n * @returns Deduplicated array of scopes\n */\n static MergeScopes(...scopeArrays: string[][]): string[] {\n return Array.from(new Set(scopeArrays.flat()));\n }\n\n /**\n * Retrieves an access token for a channel resource.\n *\n * Returns the token of the user who enabled sync on the given channel.\n * If the channel is not enabled or the token is expired/invalid, returns null.\n *\n * @param channelId - The channel resource ID (e.g., calendar ID)\n * @returns Promise resolving to the access token or null\n */\n abstract get(channelId: string): Promise<AuthToken | null>;\n /**\n * Retrieves an access token for a channel resource.\n *\n * @param provider - The OAuth provider (deprecated, ignored for single-provider connectors)\n * @param channelId - The channel resource ID (e.g., calendar ID)\n * @returns Promise resolving to the access token or null\n * @deprecated Use get(channelId) instead. The provider is implicit from the connector.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract get(provider: AuthProvider, channelId: string): Promise<AuthToken | null>;\n\n /**\n * Saves a link with notes to the connector's focus.\n *\n * Creates a thread+link pair. The thread is a lightweight container;\n * the link holds the external entity data (source, meta, type, status, etc.).\n *\n * This method is available only to Connectors (not regular Twists).\n *\n * @param link - The link with notes to save\n * @returns Promise resolving to the saved thread's UUID, or null if the\n * link was filtered out (e.g. older than the plan's sync history limit)\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveLink(link: NewLinkWithNotes): Promise<Uuid | null>;\n\n /**\n * Batch version of {@link saveLink} — saves many links in one call.\n *\n * Connectors syncing many items per page (e.g. calendar events, issues,\n * messages) should prefer this over looping `saveLink`. Each `saveLink`\n * crosses the runtime boundary and counts against the per-execution\n * request budget; `saveLinks` collapses N saves into a single crossing.\n *\n * Failures on individual links DO NOT abort the batch. A bad item lands\n * as `null` in its slot and the rest still save. This prevents one\n * malformed record from losing an entire page of sync progress.\n *\n * This method is available only to Connectors (not regular Twists).\n *\n * @param links - Array of links with notes to save\n * @returns Array of the same length and order as `links`. Each entry is\n * the saved thread's UUID, or `null` if the link was filtered out\n * (e.g. older than the plan's sync history limit) OR failed to save.\n * The two null causes are not distinguished; the save failure is\n * logged server-side.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveLinks(links: NewLinkWithNotes[]): Promise<(Uuid | null)[]>;\n\n /**\n * Save one or more notes. Unlike saveLink (which creates a thread-level\n * canonical link), these notes attach to an EXISTING thread — addressed by\n * `note.thread: { id }` or `{ source }` — and may carry their own\n * note-attached link via `note.link` (a note-scoped link, NOT a thread-level\n * canonical link). When `{ source }` resolves to no thread yet, the runtime\n * find-or-creates the thread by that source. Use for augmenter content\n * (e.g. meeting notes attached to a calendar event).\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveNotes(notes: NewNote[]): Promise<(Uuid | null)[]>;\n /** Save a single note. See {@link saveNotes}. */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveNote(note: NewNote): Promise<Uuid | null>;\n /**\n * Archive every note this connector created (optionally scoped to a channel),\n * plus their note-attached links. Mirror of {@link archiveLinks} for the\n * note-attached content model. Use in `onChannelDisabled`.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract archiveNotes(filter: ArchiveNotesFilter): Promise<void>;\n\n /**\n * Upserts contacts into the connector's focus without requiring a Link.\n *\n * Use this for messaging connectors to bulk-sync workspace members so the\n * recipient picker can filter contacts by reachable platform account. Populate\n * `NewContact.source` to persist `contact_external_account` rows (the platform\n * identity used to address the contact). Returns one `Actor` per input, in order.\n *\n * @param contacts - Contacts to upsert, keyed by `source`/`key`\n * @returns Promise resolving to the saved actors, 1:1 with input order\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveContacts(contacts: NewContact[]): Promise<Actor[]>;\n\n /**\n * Archives links matching the given filter that were created by this connector.\n *\n * For each archived link's thread, if no other non-archived links remain,\n * the thread is also archived.\n *\n * @param filter - Filter criteria for which links to archive\n * @returns Promise that resolves when archiving is complete\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract archiveLinks(filter: ArchiveLinkFilter): Promise<void>;\n\n /**\n * Sets or clears todo status on a thread owned by this connector.\n *\n * @param source - The link source URL identifying the thread\n * @param actorId - The user to set the todo for\n * @param todo - true to mark as todo, false to clear/complete\n * @param options - Additional options\n * @param options.date - The todo date (when todo=true). Defaults to today.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract setThreadToDo(\n source: string,\n actorId: ActorId,\n todo: boolean,\n options?: { date?: Date | string }\n ): Promise<void>;\n\n /**\n * Signal that initial bulk-sync (or recovery sync) for a channel is fully\n * complete. The Flutter app uses this to clear the \"syncing…\" indicator\n * on the connection.\n *\n * The framework automatically marks a channel as syncing when it dispatches\n * `onChannelEnabled` (whether initial-enable, auto-enable from\n * `setChannels`, or recovery after re-auth). Connectors do NOT need to\n * call anything to start tracking — only to signal completion.\n *\n * Call this exactly once when the initial backfill has finished (no more\n * pages, all phases exhausted). Do NOT call it on every incremental sync.\n *\n * If `onChannelEnabled` throws an unhandled exception, the framework\n * automatically clears the syncing state — connectors don't need a\n * `try/catch` to clear state on failure.\n *\n * No-op when no auth/user mapping exists for the channel (e.g. key-based\n * connectors that don't have a per-user OAuth association).\n *\n * @param channelId - The channel resource ID whose initial sync just finished\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract channelSyncCompleted(channelId: string): Promise<void>;\n\n /**\n * Flag a connection as needing re-authentication so the Flutter app\n * surfaces a re-auth prompt on the next sync.\n *\n * Call this when a connector's API call returns a permanent auth-style\n * error that the runtime can't observe through token refresh — e.g.\n * Slack `invalid_auth` / `token_revoked` / `not_authed`, or a 401 on a\n * provider that doesn't refresh. The runtime already flags reauth\n * automatically when an OAuth refresh permanently fails or when the\n * stored token is missing on a get(); only call this for cases the\n * runtime can't see.\n *\n * Idempotent: safe to call repeatedly; existing reauth flags are not\n * overwritten. No-op when the channel has no `enabledBy` actor (e.g.\n * key-based connectors).\n *\n * @param channelId - The channel resource ID whose token is bad\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract markNeedsReauth(channelId: string): Promise<void>;\n\n /**\n * Upsert workspace custom emoji into Plot's shared cache so reactions using\n * `provider:workspace/name` refs render as images and round-trip. Idempotent;\n * keyed on `id`. Pass `archived: true` to mark an emoji removed. Workspace-\n * scoped (shared across all users of that workspace).\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveCustomEmoji(emoji: NewCustomEmoji[]): Promise<void>;\n\n}\n\n/**\n * Filter criteria for archiving links.\n * All fields are optional; only provided fields are used for matching.\n */\nexport type ArchiveLinkFilter = {\n /** Filter by channel ID */\n channelId?: string;\n /** Filter by link type (e.g., \"issue\", \"pull_request\") */\n type?: string;\n /** Filter by link status (e.g., \"open\", \"closed\") */\n status?: string;\n /** Filter by metadata fields (uses containment matching) */\n meta?: Record<string, JSONValue>;\n};\n\n/**\n * Filter criteria for archiving notes (and their note-attached links).\n * All fields are optional; only provided fields are used for matching.\n */\nexport type ArchiveNotesFilter = {\n /** Restrict to notes whose note-attached link is on this channel. */\n channelId?: string;\n};\n\n/**\n * A workspace custom emoji to cache so Plot can render and round-trip it as a\n * reaction. `id` is the provider-scoped ref stored on reactions, of the form\n * `<provider>:<workspace>/<name>` (e.g. `slack:T0123ABC/party_parrot`).\n */\nexport type NewCustomEmoji = {\n /** Provider-scoped ref: `<provider>:<workspace>/<name>`. The reaction value. */\n id: string;\n /** e.g. \"slack\". */\n provider: string;\n /** Provider workspace/team id (e.g. Slack team id `T0123ABC`). */\n workspace: string;\n /** Bare emoji name without colons (e.g. \"party_parrot\"). */\n name: string;\n /** Image URL to render, or null for an alias (see `aliasOf`). */\n imageUrl: string | null;\n /** When this emoji aliases another, the target ref (`id` of the canonical emoji); else null. */\n aliasOf: string | null;\n /** True to mark the emoji removed (archive it) rather than upsert it. */\n archived: boolean;\n};\n\n/**\n * Enumeration of supported OAuth providers.\n *\n * Each provider has different OAuth endpoints, scopes, and token formats.\n * The Integrations tool handles the provider-specific implementation details.\n */\nexport enum AuthProvider {\n /** Google OAuth provider for Google Workspace services */\n Google = \"google\",\n /** Microsoft OAuth provider for Microsoft 365 services */\n Microsoft = \"microsoft\",\n /** Notion OAuth provider for Notion workspaces */\n Notion = \"notion\",\n /** Slack OAuth provider for Slack workspaces */\n Slack = \"slack\",\n /** Atlassian OAuth provider for Jira and Confluence */\n Atlassian = \"atlassian\",\n /** Linear OAuth provider for Linear workspaces */\n Linear = \"linear\",\n /** Monday.com OAuth provider */\n Monday = \"monday\",\n /** GitHub OAuth provider for GitHub repositories and organizations */\n GitHub = \"github\",\n /** Asana OAuth provider for Asana workspaces */\n Asana = \"asana\",\n /** HubSpot OAuth provider for HubSpot CRM */\n HubSpot = \"hubspot\",\n /** Todoist OAuth provider for Todoist task management */\n Todoist = \"todoist\",\n /** Airtable OAuth provider for Airtable bases */\n Airtable = \"airtable\",\n}\n\n/**\n * Represents a completed authorization from an OAuth flow.\n *\n * Contains the provider, granted scopes, and the actor (contact) that was authorized.\n * Tokens are looked up by (provider, actorId) rather than a random ID.\n */\nexport type Authorization = {\n /** The OAuth provider this authorization is for */\n provider: AuthProvider;\n /** Array of OAuth scopes this authorization covers */\n scopes: string[];\n /** The external account that was authorized (e.g., the Google account) */\n actor: Actor;\n};\n\n/**\n * Represents a stored OAuth authentication token.\n *\n * Contains the actual access token and the scopes it was granted,\n * which may be a subset of the originally requested scopes.\n */\nexport type AuthToken = {\n /** The OAuth access token */\n token: string;\n /** Array of granted OAuth scopes */\n scopes: string[];\n /**\n * Provider-specific metadata as key-value pairs.\n *\n * For Slack (AuthProvider.Slack):\n * - authed_user_id: The authenticated user's Slack ID\n * - team_id: The Slack workspace/team ID\n * - team_name: The Slack workspace/team name\n * - enterprise_id: The Enterprise Grid org ID (when applicable)\n */\n provider?: Record<string, string>;\n};\n";
|
|
8
|
+
export default "import {\n type Actor,\n type ActorId,\n type NewContact,\n type NewLinkWithNotes,\n type NewNote,\n ITool,\n} from \"..\";\nimport type { JSONValue } from \"../utils/types\";\nimport type { Uuid } from \"../utils/uuid\";\n\n/**\n * A resource that can be synced (e.g., a calendar, project, channel).\n * Returned by getChannels() and managed by users in the twist setup/edit modal.\n */\nexport type Channel = {\n /** External ID shared across users (e.g., Google calendar ID) */\n id: string;\n /** Display name shown in the UI */\n title: string;\n /**\n * Whether this channel should be selected by default when the user first\n * adds the connection. Tri-state:\n * - `true` — pre-select it (e.g. the user's own/primary calendar).\n * - `false` — exclude it from the default selection (low-value or\n * irrelevant resources that would crowd the user's view, or containers\n * whose contents are too broad to sync wholesale — e.g. a holiday or\n * someone-else's shared calendar, a GitHub org that cascades to every\n * repo, a Microsoft Teams team container). The user can still enable it\n * manually.\n * - `undefined` — no opinion; the client decides. The client defaults to\n * enabling the channel unless its title looks low-value (holidays,\n * birthdays, spam/sent/draft, …).\n *\n * The guiding principle is \"sync everything the user would reasonably want\n * by default\" — for most connectors that's all channels, so only set this\n * where the connector can distinguish the user's own/relevant channels from\n * low-value ones (e.g. Google Calendar via `accessRole === \"owner\"`).\n */\n enabledByDefault?: boolean;\n /** Optional nested channel resources (e.g., subfolders) */\n children?: Channel[];\n /** Per-channel link type configs. Overrides twist-level linkTypes when present. */\n linkTypes?: LinkTypeConfig[];\n};\n\n/**\n * Curated status-icon vocabulary. Connectors map each declared status to the\n * closest icon; clients render a single glyph per value. Required on every\n * status so the UI always has something to show.\n */\nexport type StatusIcon =\n | \"backlog\"\n | \"todo\"\n | \"inProgress\"\n | \"blocked\"\n | \"done\"\n | \"cancelled\"\n | \"confirmed\"\n | \"tentative\";\n\n/**\n * Describes a link type that a connector creates.\n * Used for display in the UI (icons, labels).\n */\nexport type LinkTypeConfig = {\n /** Machine-readable type identifier (e.g., \"issue\", \"pull_request\") */\n type: string;\n /** Human-readable label (e.g., \"Issue\", \"Pull Request\") */\n label: string;\n /**\n * Display name of the specific product/source this link type belongs to.\n * Used in place of the connector's display name when building\n * \"{source} {label}\" copy (the thread type name, the \"Create new …\" picker\n * entry, compose chips). Only needed for **aggregate** connectors that bundle\n * several products under one display name: the Google connector's display\n * name is \"Gmail & Calendar\", but its `event` link type should read\n * \"Google Calendar event\", its `email` link type \"Gmail thread\", and its\n * `task` link type \"Google Tasks task\". Set it to the standalone product\n * name (e.g. \"Gmail\", \"Google Calendar\", \"Google Tasks\"). Single-product\n * connectors can omit it — Plot falls back to the connector display name.\n */\n sourceName?: string;\n /**\n * Connector's word for a note on a linked item of this type — used by the\n * Flutter app to adapt note/composer copy (\"Add a comment\" on Linear,\n * \"Add a message\" on Slack, \"Add a reply\" on Gmail). Defaults to \"note\"\n * when omitted. Use the singular noun in title case (e.g. \"Comment\").\n */\n noteLabel?: string;\n /**\n * Placeholder shown in the editor when this link type is the target of a\n * new thread (NewThreadPage). Example: \"Send a Gmail email\".\n * If unset, Plot derives \"Create a new {connector} {label.toLowerCase()}\".\n */\n composePlaceholder?: string;\n /**\n * Label for the Send button on NewThreadPage when this link type is the\n * target. Example: \"Send\". If unset, defaults to \"Create\".\n */\n composeVerb?: string;\n /**\n * Placeholder shown in the in-thread editor for the default reply mode.\n * Example: \"Reply\" (Gmail), \"Add a comment\" (Linear). If unset, Plot derives\n * \"Add a {noteLabel.toLowerCase()}\" or \"Add a note\".\n */\n replyPlaceholder?: string;\n /**\n * Label for the Send button in the in-thread editor. Example: \"Send\"\n * (Gmail), \"Comment\" (Linear). If unset, defaults to \"Send\".\n */\n replyVerb?: string;\n /** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */\n logo?: string;\n /** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */\n logoDark?: string;\n /** URL to a monochrome icon (uses `currentColor`). Prefer Iconify `simple-icons/*` URLs without a `?color=` param. */\n logoMono?: string;\n /** Possible status values for this type */\n statuses?: Array<{\n /** Machine-readable status (e.g., \"open\", \"done\") */\n status: string;\n /** Human-readable label (e.g., \"Open\", \"Done\") */\n label: string;\n /** Curated icon for this status (required so the UI always has a glyph). */\n icon: StatusIcon;\n /**\n * Suppress this status's icon on the feed row (ThreadWidget) while still\n * showing it in the ThreadPage header. Use for a \"resting\" default state\n * that would otherwise clutter the feed (e.g. calendar \"Confirmed\").\n */\n hiddenDefault?: boolean;\n /** Whether this status represents completion (done, closed, merged, cancelled, etc.) */\n done?: boolean;\n /**\n * Mark the thread `active=true` in Plot when a link enters this status.\n * Use for messaging-style flags where the user has indicated they want\n * to act on the thread now — Gmail's \"starred\", Slack's \"later\", etc.\n * The Plot user can later un-flag the thread without breaking the\n * connector relationship.\n */\n active?: boolean;\n /**\n * Marks this status as the connector's \"to-do\" / active state. When a\n * user brings a done thread back into Plot's agenda, done-status links\n * are flipped to the status marked `todo: true` (e.g. Gmail's \"starred\",\n * Linear's \"unstarted\"); connectors that don't mark one fall back to the\n * first non-done status.\n */\n todo?: boolean;\n }>;\n /** Whether this link type supports displaying and changing the assignee */\n supportsAssignee?: boolean;\n /**\n * Whether this link type produces time-anchored schedule/agenda items\n * (i.e. calendar events). The Plot app shows the agenda (the bottom-nav\n * tab on mobile and the left-sidebar agenda on desktop) only when the\n * user has at least one active connection whose link types include one\n * with `includesSchedules: true`. Calendar connectors (Google / Apple /\n * Outlook Calendar) set this on their `event` link type. Defaults to\n * false — non-calendar link types (messages, issues, tasks, docs) omit it.\n */\n includesSchedules?: boolean;\n /** Default thread creation mode for this link type: 'all' | 'actionable' | 'manual' */\n defaultCreateThreads?: string;\n /**\n * Opt-in: declares this link type is composable from Plot via\n * `Connector.onCreateLink`. Omit to make the link type sync-only (no\n * \"Create new …\" picker entry).\n *\n * Connectors that need multiple compose modes for what users perceive as\n * the same kind of thing (e.g. Slack channel post vs DM) should declare\n * **separate linkTypes**, one per user-facing thread type. That keeps\n * each linkType isomorphic to one filter chip.\n */\n compose?: ComposeConfig;\n /**\n * Per-connector contact roles. Examples:\n * email → [{id:\"to\",label:\"To\",default:true},{id:\"cc\",label:\"CC\"},{id:\"bcc\",label:\"BCC\",hidden:true}]\n * calendar → [{id:\"required\",label:\"Required\",default:true},{id:\"optional\",label:\"Optional\"}]\n *\n * Plot uses this list to render a role picker on each contact chip in the\n * composer and to label non-default roles on existing threads. Exactly one\n * role should be marked `default: true`. Connectors that don't distinguish\n * roles (Slack, Linear) omit this field entirely.\n */\n contactRoles?: ContactRoleConfig[];\n /**\n * Whether contacts on an existing thread can be added, removed, or have\n * their role changed (email-style mid-thread recipient changes). When\n * false, the thread's contact list is fixed after creation. Defaults to\n * false when omitted.\n */\n supportsContactChanges?: boolean;\n /**\n * Whether a note/reply on this link type can carry a link (a pasted URL or\n * connector-created item) that Plot forwards to the source. When false (the\n * default), the \"Add link\" button is hidden for threads of this link type.\n * Only set true if the connector's reply path actually forwards the link\n * action to the source. Private Plot notes (no link type) always allow links.\n */\n supportsLinks?: boolean;\n /**\n * Whether a note/reply on this link type can carry an uploaded file that Plot\n * forwards to the source as an attachment. When false (the default), the\n * \"Attach file\" button is hidden for threads of this link type. Only set true\n * if the connector's reply path actually uploads file actions to the source.\n * Private Plot notes (no link type) always allow attachments.\n */\n supportsFileAttachments?: boolean;\n /**\n * Declares how sharing on threads of this link type is scoped:\n *\n * - `\"thread\"` (default): one roster shared across all notes in the\n * thread. Native Plot threads, Slack DMs, calendar events.\n * - `\"channel\"`: visibility is the external channel's membership;\n * the per-thread `contacts` array is ignored for sharing UI.\n * Slack channels, Linear projects.\n * - `\"message\"`: each note carries its own recipient set via\n * `note.access_contacts`; the thread roster is the union across\n * all messages. Email.\n * - `\"none\"`: the link type has no recipient roster at all. No\n * contacts/sharing UI is shown for these threads. Use for purely\n * personal destinations with no sharing concept (e.g. Google\n * Tasks). The per-thread `contacts` array is ignored for sharing UI.\n *\n * Omit to default to `\"thread\"`. When set to `\"message\"`, every\n * note this connector ingests must populate `access_contacts`\n * explicitly (never NULL).\n */\n sharingModel?: \"thread\" | \"channel\" | \"message\" | \"none\";\n};\n\n/**\n * Declares how a link type is composable from Plot via\n * `Connector.onCreateLink`. Attached to {@link LinkTypeConfig.compose}.\n */\nexport type ComposeConfig = {\n /**\n * Selects the destination model for the \"Create new …\" picker.\n *\n * - `\"channels\"` (default): one chip per enabled channel (e.g. a Linear\n * team, a Slack channel). Existing behaviour for task-tracker / calendar\n * connectors.\n * - `\"contacts\"`: one chip per connection (account); the user picks\n * recipients from their contacts. The runtime pre-resolves the chosen\n * Plot contacts to platform account IDs via the per-connection\n * `contact_external_account` rows and delivers them as\n * `CreateLinkDraft.recipients`. Contacts without a row for this specific\n * connection are filtered out of the picker — used by closed-roster\n * messaging platforms (Slack DM, Teams DM, Google Chat DM, LinkedIn DM).\n * - `\"addresses\"`: one chip per connection; the picker accepts any\n * contact with an addressable identifier (e.g. an email) or a free-form\n * typed address. The runtime fills `recipients` for contacts with a\n * connection-scoped row and falls back to the contact's primary address\n * (e.g. `contact.email`) when no row exists. Free-form addresses arrive\n * via the thread's `inviteEmails`. Used by open address spaces like\n * Gmail.\n */\n targets?: \"channels\" | \"contacts\" | \"addresses\";\n /**\n * Status to assign newly-created links. Should match an entry in the\n * parent linkType's `statuses[]`, OR a symbolic id that the connector's\n * `onCreateLink` resolves itself (e.g. Linear's `\"unstarted\"` category is\n * resolved per-team to a state UUID inside the connector — see\n * `connectors/linear/src/linear.ts`).\n *\n * Omit for status-less link types (e.g. messaging connectors that don't\n * model a status): composed links are created with no status.\n */\n status?: string;\n /**\n * Optional override for the picker chip / \"Create new …\" copy. Defaults\n * to the parent linkType's `label`. Use to disambiguate compose entries\n * when the parent label alone isn't specific enough (e.g. \"Direct\n * messages\" for a DM-mode compose on a chat connector).\n */\n label?: string;\n};\n\n/**\n * Declares one contact role for a connector's link type. See\n * `LinkTypeConfig.contactRoles`.\n */\nexport type ContactRoleConfig = {\n /** Stable machine id, e.g. \"to\" / \"cc\" / \"bcc\" / \"required\" / \"optional\". */\n id: string;\n /** Display label shown next to a contact chip, e.g. \"To\", \"CC\", \"Required\". */\n label: string;\n /** Exactly one role per linkType should be marked default. */\n default?: boolean;\n /**\n * Hidden roles are visible only to (a) the contact themselves and\n * (b) the user who added them. The API filters them out of every other\n * viewer's `thread.contacts` and `thread.contactMeta`. Use for BCC-style\n * semantics where other recipients must not see the hidden contact.\n */\n hidden?: boolean;\n};\n\n/**\n * Context passed to onChannelEnabled with plan-based sync hints.\n * Connectors can use these hints to limit initial sync scope.\n */\nexport type SyncContext = {\n /**\n * Earliest date to include in initial sync, based on the user's plan.\n *\n * Non-calendar connectors should use this as their date filter (timeMin,\n * created.gte, etc.) during initial sync. Calendar connectors should\n * ignore this for API queries (to avoid missing recurring events) — the\n * API layer filters non-recurring items automatically.\n *\n * Undefined when no limit applies.\n */\n syncHistoryMin?: Date;\n\n /**\n * True when this is a recovery dispatch after the connection's auth was\n * restored (the user re-authorized a previously-broken connection).\n *\n * The framework calls `onChannelEnabled` again for every channel that was\n * already enabled at the time of re-auth so the connector can recover from\n * the auth gap. Connectors should:\n *\n * 1. Drop any persisted incremental sync cursors / sync tokens so the\n * next sync re-walks history (the cursor may be stale or invalid —\n * Google Calendar invalidates syncTokens after ~7 days).\n * 2. Re-register webhooks (any prior subscription may have been\n * invalidated during the auth outage).\n * 3. Treat this as a backfill that walks history but does NOT spam\n * notifications — set `unread: false` and `archived: false` on\n * items as you would during initial sync.\n *\n * Most connectors can take the same code path as a fresh\n * `onChannelEnabled` for `recovering: true` as long as that path\n * overwrites stored state rather than appending to it.\n */\n recovering?: boolean;\n\n /**\n * True when the channel is being observed because the user composed a Plot\n * thread INTO it (via `onCreateLink`), not because they explicitly enabled\n * it. The connector should register webhooks / mark the channel observed so\n * inbound events (replies, reactions) on the composed thread sync back —\n * but must NOT backfill history. Only go-forward events matter; pulling the\n * channel's existing content would be surprising for a channel the user\n * only posted one thread into.\n *\n * Connectors whose `onChannelEnabled` already skips historical backfill can\n * ignore this flag. Connectors that initial-sync on enable MUST short-\n * circuit that backfill when `observeOnly` is true (still set up webhooks\n * and any go-forward state).\n */\n observeOnly?: boolean;\n};\n\n/**\n * Built-in tool for managing OAuth authentication and channel resources.\n *\n * The Integrations tool:\n * 1. Manages channel resources (calendars, projects, etc.) per actor\n * 2. Returns tokens for the user who enabled sync on a channel\n * 3. Supports per-actor auth via actAs() for write-back operations\n * 4. Provides saveLink/saveContacts for Connectors to save data directly\n *\n * Connectors declare their provider, scopes, and channel lifecycle methods as\n * class properties and methods. The Integrations tool reads these automatically.\n * Auth and channel management is handled in the twist edit modal in Flutter.\n *\n * @example\n * ```typescript\n * class CalendarConnector extends Connector<CalendarConnector> {\n * readonly provider = AuthProvider.Google;\n * readonly scopes = [\"https://www.googleapis.com/auth/calendar\"];\n *\n * build(build: ToolBuilder) {\n * return {\n * integrations: build(Integrations),\n * };\n * }\n *\n * async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {\n * const calendars = await this.listCalendars(token);\n * return calendars.map(c => ({ id: c.id, title: c.name }));\n * }\n *\n * async onChannelEnabled(channel: Channel) {\n * // Start syncing\n * }\n *\n * async onChannelDisabled(channel: Channel) {\n * // Stop syncing\n * }\n * }\n * ```\n */\nexport abstract class Integrations extends ITool {\n /**\n * Merge scopes from multiple tools, deduplicating.\n *\n * @param scopeArrays - Arrays of scopes to merge\n * @returns Deduplicated array of scopes\n */\n static MergeScopes(...scopeArrays: string[][]): string[] {\n return Array.from(new Set(scopeArrays.flat()));\n }\n\n /**\n * Retrieves an access token for a channel resource.\n *\n * Returns the token of the user who enabled sync on the given channel.\n * If the channel is not enabled or the token is expired/invalid, returns null.\n *\n * @param channelId - The channel resource ID (e.g., calendar ID)\n * @returns Promise resolving to the access token or null\n */\n abstract get(channelId: string): Promise<AuthToken | null>;\n /**\n * Retrieves an access token for a channel resource.\n *\n * @param provider - The OAuth provider (deprecated, ignored for single-provider connectors)\n * @param channelId - The channel resource ID (e.g., calendar ID)\n * @returns Promise resolving to the access token or null\n * @deprecated Use get(channelId) instead. The provider is implicit from the connector.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract get(provider: AuthProvider, channelId: string): Promise<AuthToken | null>;\n\n /**\n * Saves a link with notes to the connector's focus.\n *\n * Creates a thread+link pair. The thread is a lightweight container;\n * the link holds the external entity data (source, meta, type, status, etc.).\n *\n * This method is available only to Connectors (not regular Twists).\n *\n * @param link - The link with notes to save\n * @returns Promise resolving to the saved thread's UUID, or null if the\n * link was filtered out (e.g. older than the plan's sync history limit)\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveLink(link: NewLinkWithNotes): Promise<Uuid | null>;\n\n /**\n * Batch version of {@link saveLink} — saves many links in one call.\n *\n * Connectors syncing many items per page (e.g. calendar events, issues,\n * messages) should prefer this over looping `saveLink`. Each `saveLink`\n * crosses the runtime boundary and counts against the per-execution\n * request budget; `saveLinks` collapses N saves into a single crossing.\n *\n * Failures on individual links DO NOT abort the batch. A bad item lands\n * as `null` in its slot and the rest still save. This prevents one\n * malformed record from losing an entire page of sync progress.\n *\n * This method is available only to Connectors (not regular Twists).\n *\n * @param links - Array of links with notes to save\n * @returns Array of the same length and order as `links`. Each entry is\n * the saved thread's UUID, or `null` if the link was filtered out\n * (e.g. older than the plan's sync history limit) OR failed to save.\n * The two null causes are not distinguished; the save failure is\n * logged server-side.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveLinks(links: NewLinkWithNotes[]): Promise<(Uuid | null)[]>;\n\n /**\n * Save one or more notes. Unlike saveLink (which creates a thread-level\n * canonical link), these notes attach to an EXISTING thread — addressed by\n * `note.thread: { id }` or `{ source }` — and may carry their own\n * note-attached link via `note.link` (a note-scoped link, NOT a thread-level\n * canonical link). When `{ source }` resolves to no thread yet, the runtime\n * find-or-creates the thread by that source. Use for augmenter content\n * (e.g. meeting notes attached to a calendar event).\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveNotes(notes: NewNote[]): Promise<(Uuid | null)[]>;\n /** Save a single note. See {@link saveNotes}. */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveNote(note: NewNote): Promise<Uuid | null>;\n /**\n * Archive every note this connector created (optionally scoped to a channel),\n * plus their note-attached links. Mirror of {@link archiveLinks} for the\n * note-attached content model. Use in `onChannelDisabled`.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract archiveNotes(filter: ArchiveNotesFilter): Promise<void>;\n\n /**\n * Upserts contacts into the connector's focus without requiring a Link.\n *\n * Use this for messaging connectors to bulk-sync workspace members so the\n * recipient picker can filter contacts by reachable platform account. Populate\n * `NewContact.source` to persist `contact_external_account` rows (the platform\n * identity used to address the contact). Returns one `Actor` per input, in order.\n *\n * @param contacts - Contacts to upsert, keyed by `source`/`key`\n * @returns Promise resolving to the saved actors, 1:1 with input order\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveContacts(contacts: NewContact[]): Promise<Actor[]>;\n\n /**\n * Archives links matching the given filter that were created by this connector.\n *\n * For each archived link's thread, if no other non-archived links remain,\n * the thread is also archived.\n *\n * @param filter - Filter criteria for which links to archive\n * @returns Promise that resolves when archiving is complete\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract archiveLinks(filter: ArchiveLinkFilter): Promise<void>;\n\n /**\n * Sets or clears todo status on a thread owned by this connector.\n *\n * @param source - The link source URL identifying the thread\n * @param actorId - The user to set the todo for\n * @param todo - true to mark as todo, false to clear/complete\n * @param options - Additional options\n * @param options.date - The todo date (when todo=true). Defaults to today.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract setThreadToDo(\n source: string,\n actorId: ActorId,\n todo: boolean,\n options?: { date?: Date | string }\n ): Promise<void>;\n\n /**\n * Signal that initial bulk-sync (or recovery sync) for a channel is fully\n * complete. The Flutter app uses this to clear the \"syncing…\" indicator\n * on the connection.\n *\n * The framework automatically marks a channel as syncing when it dispatches\n * `onChannelEnabled` (whether initial-enable, auto-enable from\n * `setChannels`, or recovery after re-auth). Connectors do NOT need to\n * call anything to start tracking — only to signal completion.\n *\n * Call this exactly once when the initial backfill has finished (no more\n * pages, all phases exhausted). Do NOT call it on every incremental sync.\n *\n * If `onChannelEnabled` throws an unhandled exception, the framework\n * automatically clears the syncing state — connectors don't need a\n * `try/catch` to clear state on failure.\n *\n * No-op when no auth/user mapping exists for the channel (e.g. key-based\n * connectors that don't have a per-user OAuth association).\n *\n * @param channelId - The channel resource ID whose initial sync just finished\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract channelSyncCompleted(channelId: string): Promise<void>;\n\n /**\n * Flag a connection as needing re-authentication so the Flutter app\n * surfaces a re-auth prompt on the next sync.\n *\n * Call this when a connector's API call returns a permanent auth-style\n * error that the runtime can't observe through token refresh — e.g.\n * Slack `invalid_auth` / `token_revoked` / `not_authed`, or a 401 on a\n * provider that doesn't refresh. The runtime already flags reauth\n * automatically when an OAuth refresh permanently fails or when the\n * stored token is missing on a get(); only call this for cases the\n * runtime can't see.\n *\n * Idempotent: safe to call repeatedly; existing reauth flags are not\n * overwritten. No-op when the channel has no `enabledBy` actor (e.g.\n * key-based connectors).\n *\n * @param channelId - The channel resource ID whose token is bad\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract markNeedsReauth(channelId: string): Promise<void>;\n\n /**\n * Upsert workspace custom emoji into Plot's shared cache so reactions using\n * `provider:workspace/name` refs render as images and round-trip. Idempotent;\n * keyed on `id`. Pass `archived: true` to mark an emoji removed. Workspace-\n * scoped (shared across all users of that workspace).\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n abstract saveCustomEmoji(emoji: NewCustomEmoji[]): Promise<void>;\n\n}\n\n/**\n * Filter criteria for archiving links.\n * All fields are optional; only provided fields are used for matching.\n */\nexport type ArchiveLinkFilter = {\n /** Filter by channel ID */\n channelId?: string;\n /** Filter by link type (e.g., \"issue\", \"pull_request\") */\n type?: string;\n /** Filter by link status (e.g., \"open\", \"closed\") */\n status?: string;\n /** Filter by metadata fields (uses containment matching) */\n meta?: Record<string, JSONValue>;\n};\n\n/**\n * Filter criteria for archiving notes (and their note-attached links).\n * All fields are optional; only provided fields are used for matching.\n */\nexport type ArchiveNotesFilter = {\n /** Restrict to notes whose note-attached link is on this channel. */\n channelId?: string;\n};\n\n/**\n * A workspace custom emoji to cache so Plot can render and round-trip it as a\n * reaction. `id` is the provider-scoped ref stored on reactions, of the form\n * `<provider>:<workspace>/<name>` (e.g. `slack:T0123ABC/party_parrot`).\n */\nexport type NewCustomEmoji = {\n /** Provider-scoped ref: `<provider>:<workspace>/<name>`. The reaction value. */\n id: string;\n /** e.g. \"slack\". */\n provider: string;\n /** Provider workspace/team id (e.g. Slack team id `T0123ABC`). */\n workspace: string;\n /** Bare emoji name without colons (e.g. \"party_parrot\"). */\n name: string;\n /** Image URL to render, or null for an alias (see `aliasOf`). */\n imageUrl: string | null;\n /** When this emoji aliases another, the target ref (`id` of the canonical emoji); else null. */\n aliasOf: string | null;\n /** True to mark the emoji removed (archive it) rather than upsert it. */\n archived: boolean;\n};\n\n/**\n * Enumeration of supported OAuth providers.\n *\n * Each provider has different OAuth endpoints, scopes, and token formats.\n * The Integrations tool handles the provider-specific implementation details.\n */\nexport enum AuthProvider {\n /** Google OAuth provider for Google Workspace services */\n Google = \"google\",\n /** Microsoft OAuth provider for Microsoft 365 services */\n Microsoft = \"microsoft\",\n /** Notion OAuth provider for Notion workspaces */\n Notion = \"notion\",\n /** Slack OAuth provider for Slack workspaces */\n Slack = \"slack\",\n /** Atlassian OAuth provider for Jira and Confluence */\n Atlassian = \"atlassian\",\n /** Linear OAuth provider for Linear workspaces */\n Linear = \"linear\",\n /** Monday.com OAuth provider */\n Monday = \"monday\",\n /** GitHub OAuth provider for GitHub repositories and organizations */\n GitHub = \"github\",\n /** Asana OAuth provider for Asana workspaces */\n Asana = \"asana\",\n /** HubSpot OAuth provider for HubSpot CRM */\n HubSpot = \"hubspot\",\n /** Todoist OAuth provider for Todoist task management */\n Todoist = \"todoist\",\n /** Airtable OAuth provider for Airtable bases */\n Airtable = \"airtable\",\n}\n\n/**\n * Represents a completed authorization from an OAuth flow.\n *\n * Contains the provider, granted scopes, and the actor (contact) that was authorized.\n * Tokens are looked up by (provider, actorId) rather than a random ID.\n */\nexport type Authorization = {\n /** The OAuth provider this authorization is for */\n provider: AuthProvider;\n /** Array of OAuth scopes this authorization covers */\n scopes: string[];\n /** The external account that was authorized (e.g., the Google account) */\n actor: Actor;\n};\n\n/**\n * Represents a stored OAuth authentication token.\n *\n * Contains the actual access token and the scopes it was granted,\n * which may be a subset of the originally requested scopes.\n */\nexport type AuthToken = {\n /** The OAuth access token */\n token: string;\n /** Array of granted OAuth scopes */\n scopes: string[];\n /**\n * Provider-specific metadata as key-value pairs.\n *\n * For Slack (AuthProvider.Slack):\n * - authed_user_id: The authenticated user's Slack ID\n * - team_id: The Slack workspace/team ID\n * - team_name: The Slack workspace/team name\n * - enterprise_id: The Enterprise Grid org ID (when applicable)\n */\n provider?: Record<string, string>;\n};\n";
|
|
@@ -68,6 +68,19 @@ export type LinkTypeConfig = {
|
|
|
68
68
|
type: string;
|
|
69
69
|
/** Human-readable label (e.g., "Issue", "Pull Request") */
|
|
70
70
|
label: string;
|
|
71
|
+
/**
|
|
72
|
+
* Display name of the specific product/source this link type belongs to.
|
|
73
|
+
* Used in place of the connector's display name when building
|
|
74
|
+
* "{source} {label}" copy (the thread type name, the "Create new …" picker
|
|
75
|
+
* entry, compose chips). Only needed for **aggregate** connectors that bundle
|
|
76
|
+
* several products under one display name: the Google connector's display
|
|
77
|
+
* name is "Gmail & Calendar", but its `event` link type should read
|
|
78
|
+
* "Google Calendar event", its `email` link type "Gmail thread", and its
|
|
79
|
+
* `task` link type "Google Tasks task". Set it to the standalone product
|
|
80
|
+
* name (e.g. "Gmail", "Google Calendar", "Google Tasks"). Single-product
|
|
81
|
+
* connectors can omit it — Plot falls back to the connector display name.
|
|
82
|
+
*/
|
|
83
|
+
sourceName?: string;
|
|
71
84
|
/**
|
|
72
85
|
* Connector's word for a note on a linked item of this type — used by the
|
|
73
86
|
* Flutter app to adapt note/composer copy ("Add a comment" on Linear,
|