Skip to content

Sources#101

Merged
KrisBraun merged 25 commits intomainfrom
change/threads-links-schedules
Mar 4, 2026
Merged

Sources#101
KrisBraun merged 25 commits intomainfrom
change/threads-links-schedules

Conversation

@KrisBraun
Copy link
Copy Markdown
Contributor

Introducing Sources, a variation of Twists designed for two-way sync with external systems. This simplifies the development of sync sources, increases their capabilities (such as per-channel sync), and enables twists to process items from sources.

KrisBraun and others added 25 commits February 24, 2026 15:00
- Add Schedule as first-class type in Twister SDK (schedule.ts)
- Remove scheduling fields from Thread/NewThread types
- Add schedules/scheduleOccurrences to NewThread for calendar tools
- Update all tools to use new types (calendar tools use schedules array,
  project/messaging tools remove start field references)
- Refactor common tool interfaces (CalendarTool → CalendarSource, etc.)
- Add Source base class and channel-based integrations API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sources are a specialization of Twist that save threads directly via
integrations.saveThread() instead of passing data through callback
relay to a parent twist. This eliminates the Tool→Twist pass-through
layer.

- Add Source class extending Twist with isSource marker
- Rename Syncable → Channel, getSyncables → getChannels, etc.
- Add saveThread/saveContacts/archiveThreads to Integrations SDK
- Rename CalendarTool → CalendarSource (and all common interfaces)
- Move tools/ → sources/, rename @plotday/tool-* → @plotday/source-*
- Convert all 11 tools to extend Source, save directly
- Remove pass-through twists (calendar-sync, project-sync, etc.)
- Simplify Schedule type: remove id/threadId, add to Thread

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sources need email addresses, not just IDs, to match attendees.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Every attendee has a role; default to 'required'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Google Calendar & Outlook Calendar: replace RSVP tag mapping with
  NewScheduleContact[] on schedules and occurrences, remove
  onThreadUpdated RSVP write-back
- Twister SDK: add Link type, saveLink to integrations, thread/link
  schedule types
- All sources: adopt thread/link/schedule API changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… routing

Sources now set channelId on link objects (not just in meta) so the API can
resolve the target priority via source_channel table. Also adds priorityId
to Channel type in integrations for channel-to-priority mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sources now declare provider, scopes, linkTypes, and channel callbacks as
class members instead of burying them in Integrations provider config.
Migrates all 11 sources to the new API and adds --source flag to CLI create.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dules branch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sources are now deployed directly via the Plot CLI, not consumed as npm
packages. Mark all source packages as private, remove publishConfig and
files arrays, and ignore them in changeset config. Rewrite existing
changeset to remove source references, add 4 new twister-only changesets.
Update CI workflows to only check twister for changesets and releases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move onThreadUpdated and onNoteCreated from Plot options to Twist base
class methods. Add onLinkCreated, onLinkUpdated, onLinkNoteCreated,
onOptionsChanged to Twist. Add onThreadRead to Source for read status
write-back. Add link option and getLinks to Plot tool. Add archiveLinks
to Integrations. Remove deprecated IntegrationProviderConfig and
IntegrationOptions types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidate github-issues source into github source with separate
issue-sync and pr-sync modules. Add onThreadRead to Gmail for marking
emails as read/unread in Gmail when read status changes in Plot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate from Plot options callbacks to Twist base class methods
(onThreadUpdated, onNoteCreated, onLinkCreated). Remove unused
dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename BUILDING_TOOLS.md to BUILDING_SOURCES.md. Update AGENTS guides,
templates, and docs to reflect lifecycle hooks moving to Twist/Source
base classes, link processing support, and source-owned channel
lifecycle. Update typedoc config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KrisBraun KrisBraun merged commit d495b5c into main Mar 4, 2026
1 check passed
@KrisBraun KrisBraun deleted the change/threads-links-schedules branch March 4, 2026 05:13
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant