Uh oh!
There was an error while loading. Please reload this page.
Declare what each link type is - #387
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
kindtoLinkTypeConfigso a connector can declare what each of its link types fundamentally is, and declares it across every connector in this repo.calendar— time-anchored events from a calendartask— an item in a personal task managerteam-task— work tracked with other people: issues, tickets, cards, documents, meeting notes, CRM recordsmessage— a conversation: email threads, chats, DMsPlot 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 isteam-task— both aretype: "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:includesSchedulesalready 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.tsasserts every link type in this repo declares akind.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+labelshape, so they are excluded by matching the closedOptionDefunion fromtwister/src/options.ts.Scope
Nothing consumes
kindin this repo yet — it is metadata for the host.🤖 Generated with Claude Code
https://claude.ai/code/session_012x5Gr2fFrLpjyRbUF5zXwK