Skip to content

Declare what each link type is - #387

Merged
KrisBraun merged 3 commits into
mainfrom
connector-link-kinds
Aug 21, 2026
Merged

Declare what each link type is#387
KrisBraun merged 3 commits into
mainfrom
connector-link-kinds

Conversation

@KrisBraun

Copy link
Copy Markdown
Contributor

Adds kind to LinkTypeConfig so a connector can declare what each of its link types fundamentally is, and declares it across every connector in this repo.

kind?: "calendar"|"task"|"team-task"|"message";
  • calendar — time-anchored events from a calendar
  • task — an item in a personal task manager
  • team-task — work tracked with other people: issues, tickets, cards, documents, meeting notes, CRM records
  • message — a conversation: email threads, chats, DMs

Plot uses this to group connectors and to decide which channels of a connection a workspace can enable, so a composite connector's calendar channels and its mail channels can be treated differently.

Why it is declared per link type

The distinction is about the tool, not the payload. A Todoist task is task; an Asana task is team-task — both are type: "task". Nothing about the type string, the connector name, or the category can tell those apart, so the connector declares it.

This follows the existing pattern for semantic capability flags on LinkTypeConfig: includesSchedules already tells Plot whether a link type produces agenda items.

For connector authors

The field is optional, so existing connectors keep type-checking unchanged. Omitting it makes Plot assume team-task. Declare it on every link type you publish.

Contract test

scripts/connector-link-kinds.test.ts asserts every link type in this repo declares a kind.

It walks the TypeScript AST rather than matching source text. That matters more than it sounds: a regex-based version could not see object literals nested inside a conditional spread — for example Trello's buildCardLinkType(), which composes ...(firstOpen ? { compose: { … } } : {}). Those link types were invisible to the check rather than merely excluded, so the test reported green while guarding almost nothing. The AST walk is depth-independent.

Options-tool config fields share the type + label shape, so they are excluded by matching the closed OptionDef union from twister/src/options.ts.

Scope

Nothing consumes kind in this repo yet — it is metadata for the host.

🤖 Generated with Claude Code

https://claude.ai/code/session_012x5Gr2fFrLpjyRbUF5zXwK

KrisBraunand others added 3 commits August 20, 2026 23:08
Declares the LinkKind added to LinkTypeConfig in the previous release
across every connector in this repo, and adds a static test asserting
every link type declares one going forward.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012x5Gr2fFrLpjyRbUF5zXwK
Rewrite the static check to walk the TypeScript AST instead of matching
source text with a regex, so a link type declared deep inside an object
(e.g. behind a conditional spread) can't slip past the check the way a
brace-counting regex could. Also rewords the test's doc comment to
describe SDK behaviour only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012x5Gr2fFrLpjyRbUF5zXwK
@KrisBraun
KrisBraun merged commit 1175bf5 into mainAug 21, 2026
1 check passed
@KrisBraun
KrisBraun deleted the connector-link-kinds branch August 21, 2026 22:01
@plot-app-builderplot-app-builderBot mentioned this pull request Aug 21, 2026
Sign up for freeto 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

@KrisBraun