An open-source, faster Devin alternative
TypeScript
docs(slack): add Slack connect guide (UI + API + reconnect); reconcile channels
Igor Zalutski61a615c2c9fe
diff --git a/docs/agent-sessions/channels.mdx b/docs/agent-sessions/channels.mdxindex acce82a9..0fdde5f6 100644--- a/docs/agent-sessions/channels.mdx+++ b/docs/agent-sessions/channels.mdx@@ -6,10 +6,10 @@ description: "Bind sessions to external threads"<Note>**Labs preview.** Channels are not part of the stable Durable Sessions API. For stable API access, use [Messaging](/agent-sessions/messaging) for input and [Webhooks](/agent-sessions/webhooks) for output.</Note>-A **channel** binds a session to an external thread, such as Slack or GitHub.+A **channel** binds a session to an external thread, such as Slack or GitHub. To connect an agent to Slack, see [Slack](/agent-sessions/slack).-- **Inbound.** A Slack `@mention` or thread reply is verified, de-duplicated, and appended to the session as a [steer](/agent-sessions/messaging) — the same inbound message you can post over the API.-- **Outbound.** The platform delivers the session's `user` and `progress` [events](/agent-sessions/events#visibility-levels) back to the thread. The agent never calls Slack itself.+- **Inbound.** A Slack `@mention` is verified, de-duplicated, and appended to the session as a [steer](/agent-sessions/messaging) — the same inbound message you can post over the API.+- **Outbound.** The platform delivers the session's `user`-level [events](/agent-sessions/events#visibility-levels) back to the thread. The agent never calls Slack itself.- **Bindings.** A session can have multiple bindings. A Slack-started session that opens a PR can also bind to that PR. Routing follows event level: conversation events go to conversation bindings, work output goes to delivery targets.A channel uses the same primitives as a custom UI: append messages and render the [event stream](/agent-sessions/events).diff --git a/docs/agent-sessions/slack.mdx b/docs/agent-sessions/slack.mdxnew file mode 100644index 00000000..8088e531--- /dev/null+++ b/docs/agent-sessions/slack.mdx@@ -0,0 +1,77 @@+---+mode: "wide"+title: "Slack"+description: "Give an agent its own Slack handle"+---++<Note>**Labs preview.** Slack connect is a control-plane flow (dashboard + REST) — there are no SDK methods for it. Inbound and outbound ride the standard session model: see [Channels](/agent-sessions/channels), [Messaging](/agent-sessions/messaging), [Webhooks](/agent-sessions/webhooks), and [Events](/agent-sessions/events).</Note>++Connect an [agent](/agent-sessions/agents) to its **own** Slack app so members can `@mention` it in a channel to start and steer [sessions](/agent-sessions/sessions). One Slack app maps to one agent and one workspace (1 ⟷ 1 ⟷ 1). The agent brings its own app — you paste three values from Slack; OpenComputer holds the bot token and signing secret in a dedicated secret store, never returns them, and never exposes them to a sandbox.++## How it works++- **Connect** is a two-step wizard: create the Slack app *from a manifest* OpenComputer generates (it already points Event Subscriptions back at OpenComputer), then paste back the App ID, Signing Secret, and Bot Token.+- **Inbound.** An `@mention` is signature-verified, de-duplicated, and appended to a session as a [steer](/agent-sessions/messaging) — the same inbound message you can post over the API. The first mention in a thread starts a session; later mentions in that thread steer the same one (thread ⟷ session).+- **Outbound.** The session's `user`-level [events](/agent-sessions/events#visibility-levels) post back to the thread. The agent never calls Slack itself.++## Connect (dashboard)++<Steps>+ <Step title="Start">On the agent's page, open **Slack → Connect Slack**. OpenComputer generates an app manifest.</Step>+ <Step title="Create the app">Copy the manifest and create the app in Slack via **From a manifest**.</Step>+ <Step title="Paste details">From **Basic Information → App Credentials**, paste the **App ID** and **Signing Secret**.</Step>+ <Step title="Install">**Install App → Install to Workspace**, then paste the **Bot User OAuth Token** (`xoxb-…`) and finish.</Step>+ <Step title="Use it">Invite the bot (`/invite @handle`), then `@mention` it to start a session.</Step>+</Steps>++## Connect (API)++The same flow over REST — org-key authenticated, scoped to the agent.++<CodeGroup>+```bash Start (manifest)+curl -X POST https://api.opencomputer.dev/v3/agents/{agent_id}/slack/manifest \+ -H "Authorization: Bearer $OC_API_KEY"+# → { manifest, create_url, steps, status }+```++```bash Finalize+curl -X POST https://api.opencomputer.dev/v3/agents/{agent_id}/slack \+ -H "Authorization: Bearer $OC_API_KEY" -H "content-type: application/json" \+ -d '{"app_id":"A0…","bot_token":"xoxb-…","signing_secret":"…"}'+# → the connection (status: active; never any secrets)+```++```bash Status+curl https://api.opencomputer.dev/v3/agents/{agent_id}/slack \+ -H "Authorization: Bearer $OC_API_KEY"+```++```bash Disconnect+curl -X DELETE https://api.opencomputer.dev/v3/agents/{agent_id}/slack \+ -H "Authorization: Bearer $OC_API_KEY"+```+</CodeGroup>++Create the Slack app from the returned `manifest`, then post the three pasted values to finalize. `status` moves `pending → active`. Disconnect purges the stored secrets and stops routing.++## Reconnect++Replacing the Slack app (new keys, or a fresh app) requires explicit intent, so a stray request can't break a live connection:++```bash+curl -X POST https://api.opencomputer.dev/v3/agents/{agent_id}/slack/manifest \+ -H "Authorization: Bearer $OC_API_KEY" -H "content-type: application/json" \+ -d '{"reconnect": true}'+```++Calling `manifest` on an already-active connection **without** `reconnect: true` returns `409`. A reconnect resets the connection to `pending` — the agent stops responding in Slack until you finish the new setup — and retires the prior threads' session bindings so future mentions start fresh. In the dashboard, use the **Reconnect** button on a connected agent.++## Limits (v1)++<Warning>+- **Anyone who can `@mention` the bot** in a channel it has joined can start and steer the agent. There is no per-user, per-channel, or per-org allow-list yet — invite the bot only to channels you trust.+- **Mention-only.** The agent responds to `@mentions`; it does not passively follow thread replies.+- **Final replies only.** Outbound posts `user`-level events; live progress narration isn't streamed into the thread yet.+- **One Slack app per agent, per workspace.**+</Warning>diff --git a/docs/docs.json b/docs/docs.jsonindex 6bec09cb..236aca58 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -84,6 +84,7 @@"agent-sessions/custom-runtimes","agent-sessions/triggers","agent-sessions/channels",+ "agent-sessions/slack","agent-sessions/workspaces","agent-sessions/artifacts"]