feat: add Slack connector plugin - #24
Open
mgd43b wants to merge 3 commits into
Open
Conversation
Index public Slack channels as one document per channel, rendered as a chronological transcript with resolved author names, thread replies, and attachment text. - conversations.list/history/replies with cursor pagination - users.list resolves author IDs and <@U...> mentions to display names - retries on HTTP 429 honoring Retry-After, and surfaces Slack's HTTP 200 + ok:false failures as errors - maxMessages caps history reads and logs when it truncates Wires the connector into the server bootstrap map, the admin connector allowlist, the CLI dependency set, and the Web UI connectors page (en/ko). Slack was previously removed for not being wired into the supported surface; that wiring now exists, so it leaves the unsupported-connector guard list. Closes joungminsung#2
Adding a connector requires the type to appear in the bootstrap map, the admin allowlist, and the CLI dependencies, and nothing checked those against each other - a missed entry showed up as a 400 from the Web UI or a connector that was silently invisible. Export CONNECTOR_PLUGINS_MAP and CONFIGURABLE_CONNECTOR_TYPES, and assert every configurable type is mapped, every mapped package is a CLI dependency, and every mapped package resolves to a connector plugin. Also record the Slack connector in the README improvement lists.
There was a problem hiding this comment.
Pull request overview
Adds a first-class Slack connector plugin to the OpenDocuments plugin ecosystem, wiring it through server bootstrap/configuration, CLI deps, Web UI configuration, and documentation so public Slack channels can be indexed as per-channel transcript documents.
Changes:
- Introduce
@opendocuments/connector-slackwith Slack Web API pagination, transcript rendering (threads/mentions/attachments), and bounded 429 retry handling. - Wire the new connector into server bootstrap + admin allowlist, CLI dependency preset, and Web UI connector configuration + i18n.
- Update README/docs/changeset to document Slack as a supported source and reflect updated package/test counts.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
README.md |
Adds Slack to supported sources and updates connector plugin/test counts. |
README.ko.md |
Adds Slack to supported sources and updates connector plugin/test counts (Korean). |
plugins/connector-slack/vitest.config.ts |
Adds Vitest config for the new plugin’s test suite. |
plugins/connector-slack/tsconfig.json |
Adds TS build/typecheck config for the new plugin. |
plugins/connector-slack/tests/slack.test.ts |
Adds mocked-fetch integration tests covering Slack connector behavior. |
plugins/connector-slack/src/index.ts |
Implements Slack connector (discover/fetch, transcript rendering, retry/throttle handling). |
plugins/connector-slack/package.json |
Declares the new plugin package metadata, scripts, and dependencies. |
packages/web/src/lib/i18n.ts |
Adds Slack connector name/help text and “channels” field labels (EN/KR). |
packages/web/src/lib/api.ts |
Allows 'slack' as a configurable connector type for the admin connect API. |
packages/web/src/components/connectors/ConnectorsPage.tsx |
Adds Slack connector fields (token + channels) and form-to-config parsing. |
packages/server/tests/unsupported-connectors.test.ts |
Removes Slack from the “unsupported connector packages” denylist and documents the rule. |
packages/server/src/http/routes/admin.ts |
Adds slack to the configurable connector allowlist. |
packages/server/src/bootstrap.ts |
Registers slack -> @opendocuments/connector-slack in the connector bootstrap map. |
packages/cli/package.json |
Adds Slack connector to the CLI’s bundled connector dependencies. |
package-lock.json |
Updates lockfile to include the new workspace plugin. |
docs/pipeline.ko.md |
Documents the Slack connector in the Korean pipeline docs. |
docs-site/plugins/connector-api.md |
Includes Slack connector in connector API examples/listing. |
docs-site/index.md |
Updates plugin ecosystem counts/listing on the docs-site home page. |
docs-site/guide/deployment.md |
Adds SLACK_TOKEN to the deployment environment variable guidance. |
docs-site/guide/configuration.md |
Adds Slack connector config example and SLACK_TOKEN env var entry. |
CONTRIBUTING.md |
Lists the Slack connector in the repository structure overview. |
AGENTS.md |
Updates plugin counts and test task/test totals for repo overview/checklists. |
.changeset/slack-connector.md |
Adds a changeset bumping CLI/server for the new Slack connector feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
29
to
32
| src: /icons/plugin.svg | ||
| title: Plugin Ecosystem | ||
| details: 21 installable packages — 8 parsers (PDF, DOCX, code, Jupyter), 8 connectors (GitHub, Notion, Drive), and 5 AI model providers. | ||
| details: 22 installable packages — 8 parsers (PDF, DOCX, code, Jupyter), 9 connectors (GitHub, Notion, Drive, Slack), and 5 AI model providers. | ||
| - icon: |
- Skip channels the app has not joined. conversations.list returns every public channel, but conversations.history only works where the app is a member, so a workspace with 400 channels and a bot in 3 produced 397 not_in_channel errors and wasted calls on every sync. - Guard formatTimestamp against finite-but-out-of-range values. Number .isFinite passed them through to toISOString(), which throws RangeError and discarded the whole channel transcript. - Retry the user directory after a cooldown instead of latching the failure. A single transient users.list error degraded author names to raw IDs for the lifetime of the process. - Bound thread reply pagination with maxThreadReplies. maxMessages capped history only, so one 20k-reply thread ran unbounded past the limit. - Split channel config on whitespace and report entries that match no channel, so a typo no longer looks like an empty workspace. - Declare the connector packages as server devDependencies. The wiring test imported build output turbo never produced for that filter, so `turbo test --filter=opendocuments-server` failed on a clean tree. Slack plugin tests 18 -> 25.
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 free
to 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.
Summary
Adds
@opendocuments/connector-slack, which indexes public Slack channels as one document per channel, rendered as a chronological transcript with resolved author names, thread replies, and attachment text.discover()—conversations.listwith cursor pagination, filtered by the configuredchannels(accepts#general,general, orC0123456789)fetch()—conversations.history+conversations.replies, withusers.listresolving author IDs and<@U123>mentions to display names;<#C1|name>,<url|label>,<!here>and HTML entities are unwrapped toook: false, and throttling arrives as HTTP 429 withRetry-After(bounded retry, capped delay)maxMessagescaps history reads and logs when it truncatesConfig is
{ token, channels?, syncInterval }as requested in the issue, plus optionalmaxMessages(default 1000) andincludeThreads(default true). The token falls back toSLACK_TOKEN. Required scopes:channels:readandchannels:history;users:readis optional and only improves author names — without it the transcript keeps raw user IDs rather than failing the sync.Wired into the server bootstrap connector map, the admin connector allowlist, the CLI dependency set, and the Web UI connectors page (English + Korean strings).
Note on the previous removal
A Slack connector was deleted in 6358786, with
packages/server/tests/unsupported-connectors.test.tsguarding its return. Perdocs/superpowers/plans/2026-06-25-remove-unsupported-connectors.md, the rule was to remove "connector packages that exist in the workspace but are not supported by the product bootstrap, CLI presets, or official docs" — an orphan cleanup, not a decision against Slack. This connector is wired into all three, so it leaves that denylist (discord/jira/linear stay, and the test now carries a comment explaining the rule).Type of Change
Related Issue
Closes #2
Checklist
npx changesetrun for user-facing changesnpm run typecheckpassesnpm run testpassesanytypes introducedBreaking Changes
None.
Test Plan
18 new tests in
plugins/connector-slack/tests/slack.test.ts, all against a routedvi.stubGlobal('fetch', ...)mock that dispatches by Slack method name — no network. They cover metadata, the missing-token andinvalid_authhealth paths,SLACK_TOKENfallback, cursor pagination, channel filtering, revision reporting, transcript ordering, thread replies, join/leave filtering, markup unwrapping, attachment/file text, theusers.listfallback, themaxMessagescap, 429 retry, and HTTP failures.Connector plugin tests: 42 -> 60.