Skip to content

Commit 27aed55

Browse files
committed
Rename Source to Connector
Since we use the term "connections" everywhere else, renamed sources to connectors
1 parent 59f839c commit 27aed55

93 files changed

Lines changed: 290 additions & 282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"updateInternalDependencies": "patch",
1515
"ignore": [
1616
"@plotday/twist-*",
17-
"@plotday/source-*"
17+
"@plotday/connector-*"
1818
]
1919
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plotday/twister": minor
3+
---
4+
5+
Changed: BREAKING: Renamed Source to Connector across the SDK. The `Source` class is now `Connector`, the `./source` export is now `./connector`, and all `@plotday/source-*` packages are now `@plotday/connector-*`. A deprecated `Source` alias is re-exported for backward compatibility.

AGENTS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This guide helps AI assistants build Plot sources and twists correctly.
44

55
## What Are You Building?
66

7-
### Building a Source (service integration)
7+
### Building a Connector (service integration)
88

9-
Sources are packages that connect to external services (Linear, Slack, Google Calendar, etc.). They extend Source and save data directly via `integrations.saveThread()`.
9+
Connectors are packages that connect to external services (Linear, Slack, Google Calendar, etc.). They extend Connector and save data directly via `integrations.saveThread()`.
1010

11-
**Start here:** `sources/AGENTS.md` — Complete source development guide with scaffold, patterns, and checklist.
11+
**Start here:** `connectors/AGENTS.md` — Complete connector development guide with scaffold, patterns, and checklist.
1212

1313
### Building a Twist (orchestrator)
1414

@@ -20,7 +20,7 @@ Twists are the entry point that users install. They declare which tools to use a
2020

2121
All types in `twister/src/` with full JSDoc:
2222

23-
- **Source base**: `twister/src/source.ts`
23+
- **Connector base**: `twister/src/connector.ts`
2424
- **Tool base**: `twister/src/tool.ts`
2525
- **Twist base**: `twister/src/twist.ts`
2626
- **Built-in tools**: `twister/src/tools/*.ts`
@@ -30,23 +30,23 @@ All types in `twister/src/` with full JSDoc:
3030
## Additional Resources
3131

3232
- **Full Documentation**: <https://twist.plot.day>
33-
- **Building Sources Guide**: `sources/AGENTS.md`
33+
- **Building Connectors Guide**: `connectors/AGENTS.md`
3434
- **Runtime Environment**: `twister/docs/RUNTIME.md`
3535
- **Tools Guide**: `twister/docs/TOOLS_GUIDE.md`
3636
- **Multi-User Auth**: `twister/docs/MULTI_USER_AUTH.md`
3737
- **Sync Strategies**: `twister/docs/SYNC_STRATEGIES.md`
38-
- **Working Source Examples**: `sources/linear/`, `sources/google-calendar/`, `sources/slack/`, `sources/jira/`
38+
- **Working Connector Examples**: `connectors/linear/`, `connectors/google-calendar/`, `connectors/slack/`, `connectors/jira/`
3939

4040
## Common Pitfalls
4141

4242
1. **❌ Using instance variables for state** — Use `this.set()`/`this.get()` (state doesn't persist between executions)
4343
2. **❌ Long-running operations without batching** — Break into chunks with `runTask()` (~1000 requests per execution)
44-
3. **❌ Passing functions to `this.callback()`** — See `sources/AGENTS.md` for callback serialization pattern
44+
3. **❌ Passing functions to `this.callback()`** — See `connectors/AGENTS.md` for callback serialization pattern
4545
4. **❌ Forgetting sync metadata** — Always inject `syncProvider` and `channelId` into `thread.meta`
4646
5. **❌ Not handling initial vs incremental sync** — Propagate `initialSync` flag from entry point (`onChannelEnabled``true`, webhook → `false`) through all batch callbacks. Set `unread: false` and `archived: false` for initial, omit for incremental
4747
6. **❌ Missing localhost guard in webhooks** — Skip webhook registration when URL contains "localhost"
4848
7. **❌ Stripping HTML tags locally** — Pass raw HTML with `contentType: "html"` for server-side markdown conversion
4949

5050
---
5151

52-
**Remember**: When in doubt, check the type definitions in `twister/src/` and study the working examples in `sources/`.
52+
**Remember**: When in doubt, check the type definitions in `twister/src/` and study the working examples in `connectors/`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
## Packages
1515

1616
- **[@plotday/twister](./twister)** - Core twist creator package with the `plot` command, and library for building twists and tools
17-
- **[sources/](./sources)** - Source integrations that sync data from external services (Linear, Slack, Google Calendar, etc.)
17+
- **[connectors/](./connectors)** - Connector integrations that sync data from external services (Linear, Slack, Google Calendar, etc.)
1818
- **[twists/](./twists)** - Full source code for several twists
1919

2020
## Quick Start

0 commit comments

Comments
 (0)