Skip to content

Commit 9cf38be

Browse files
committed
Source documentation in README
1 parent ae61166 commit 9cf38be

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

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-
- **[tools/](./tools)** - Additional tools for building twists, including integrations with popular services
17+
- **[sources/](./sources)** - Source 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

twister/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Twist tools provide capabilities to twists. They are usually unopinionated and d
122122
- **Plot** - Manage activities and priorities
123123
- **Store** - Persistent key-value storage
124124
- **AI** - Language models with structured output
125-
- **Integrations** - OAuth authentication
125+
- **Integrations** - OAuth authentication and channel lifecycle
126126
- **Network** - HTTP access and webhooks
127127
- **Tasks** - Background task execution
128128
- **Callbacks** - Persistent function references
@@ -243,27 +243,33 @@ export default class WelcomeTwist extends Twist<WelcomeTwist> {
243243
}
244244
```
245245

246-
### GitHub Integration
246+
### GitHub Source
247247

248248
```typescript
249-
export default class GitHubTwist extends Twist<GitHubTwist> {
250-
build(build: ToolBuilder) {
249+
import { Source, type SourceBuilder, type Channel } from "@plotday/twister";
250+
import { Integrations } from "@plotday/twister/tools/integrations";
251+
252+
export default class GitHubSource extends Source<GitHubSource> {
253+
build(build: SourceBuilder) {
251254
return {
252-
plot: build(Plot),
253-
network: build(Network, {
254-
urls: ["https://api.github.com/*"],
255-
}),
255+
integrations: build(Integrations),
256256
};
257257
}
258258

259-
async activate(priority: Pick<Priority, "id">) {
260-
// Set up webhook for issue updates
261-
const webhookUrl = await this.tools.network.createWebhook("onIssueUpdate");
262-
await this.set("webhook_url", webhookUrl);
259+
async getChannels(): Promise<Channel[]> {
260+
// Return repositories the user can sync
261+
return repos.map((repo) => ({
262+
id: repo.id,
263+
name: repo.full_name,
264+
}));
265+
}
266+
267+
async onChannelEnabled(channel: Channel) {
268+
// Start syncing issues from this repository
263269
}
264270

265-
async onIssueUpdate(request: WebhookRequest) {
266-
// Sync GitHub issues to Plot activities
271+
async onChannelDisabled(channel: Channel) {
272+
// Stop syncing and clean up
267273
}
268274
}
269275
```

0 commit comments

Comments
 (0)