An open-source, faster Devin alternative
TypeScript
Remove channels and outboxes from public surfaces (#772)
Mohamed Habib3caa18bf871d
diff --git a/README.md b/README.mdindex 096e2a73..079be2d7 100644--- a/README.md+++ b/README.md@@ -52,9 +52,10 @@ When the project is ready, publish an immutable deployment:npm run deploy -- --alias production```-Deployments are versioned. The dashboard project view exposes Agent playground,-Sessions, Files, Connections, Channels, Schedules, and Agent schema while-keeping infrastructure details behind the OpenComputer API.+Deployments are versioned. The dashboard project view exposes the debug+playground, deployments, sessions, schedules, webhooks, memory, database,+secrets, and connections while keeping infrastructure details behind the+OpenComputer API.## CLIdiff --git a/cli/README.md b/cli/README.mdindex f7712e31..5a84b6a2 100644--- a/cli/README.md+++ b/cli/README.md@@ -139,7 +139,6 @@ opencomputer logs --session <session-id> --json```Use `opencomputer sessions tail <session-id> --json` for durable NDJSON session-events and `opencomputer channels status --json` for the last accepted event,-delivery outcome, and redacted error category. All commands accept `--json`;-mutations accept `--idempotency-key <stable-retry-key>`. Run+events. All commands accept `--json`; mutations accept+`--idempotency-key <stable-retry-key>`. Run`opencomputer doctor --json` for the sub-second local pre-deploy scan.diff --git a/docs/agents/api.mdx b/docs/agents/api.mdxindex 843bd91f..6b1a55f7 100644--- a/docs/agents/api.mdx+++ b/docs/agents/api.mdx@@ -82,7 +82,7 @@ curl -X POST 'https://app.opencomputer.dev/api/managed-agents/sessions' \| `deploymentId` | Advanced: pin one deployment instead of resolving an alias, for reproducibility or testing. Send `environment` with it; it may be omitted only when the deployment is promoted to exactly one environment. || `environment` | `development` or `production`. Optional with `agentId`; it must agree with the alias. || `memory` | Bindings keyed by resource ID, at most eight. Needs a deployed agent and an environment. Shapes on [Document memory](/agents/document-memory#session-bindings). |-| `source` | `api` (default), `playground`, `channel` or `webhook`. The dashboard groups sessions by it. |+| `source` | `api` (default), `playground` or `webhook`. The dashboard groups sessions by it. || `labels` | Your own metadata on the session, an object of strings; see [Labels](#labels). Applied at creation and ignored on a replay of the same `Idempotency-Key`. |The response is `{ session: { id, executionMode, status, createdAt }, deployment }`.@@ -457,129 +457,13 @@ The delivered event names identifiers and the outcome; a completed turn'sfinal message is included, bounded to 16 KB. The receiving agent shouldtreat that text as data about another agent's work, not as instructions.-## Slack--Automatic Slack setup creates a dedicated Slack app for one agent, environment-and channel, then installs it. The dashboard's Connections tab uses these-routes; call them from your own tooling to script the same flow.--| Operation | Method and path | Body or query | Success |-| --- | --- | --- | --- |-| Start or continue | `POST /channels/slack/setups` | `{ agentId, alias, channelId?, name, requestKey, configurationToken? }` | `201` with `{ setup }` when created; `200` when the key names an existing setup |-| Find by target | `GET /channels/slack/setups` | `?agentId=&alias=&channelId=` | `200` with `{ setup }`: the latest setup for the target that was not cancelled, a connected one included, or `null` |-| Get | `GET /channels/slack/setups/<id>` | None | `200` with `{ setup }` |-| Authorize | `POST /channels/slack/setups/<id>/authorize` | None | `200` with `{ authorizationUrl, expiresAt }` |-| Cancel | `POST /channels/slack/setups/<id>/cancel` | None | `200` with `{ setup }` in phase `cancelled` |--`alias` is `development` or `production`. `channelId` names a channel declared-in code; omit it for an agent whose deployment declares none, and the setup-then reports `channelId: "slack"`. `name` is the bot's display name, 1 to 35-characters. `requestKey` is-16 to 128 characters of letters, digits, `_` and `-` chosen by the caller: the-same key with the same target and name returns the same setup, so a retried-request never creates a second app, and a reused key with a different target-or name is `409 slack_setup_conflict`. `configurationToken` is a Slack app-configuration access token; it is used once to create the app and is never-stored or echoed. Send it with the first request, or with a later request-carrying the same key while the setup is `prepared`.--```bash-curl -X POST 'https://app.opencomputer.dev/api/managed-agents/channels/slack/setups' \- -H 'x-api-key: <api-key>' \- -H 'Content-Type: application/json' \- -d '{- "agentId": "coder",- "alias": "development",- "name": "Patch",- "requestKey": "6f1d2c3b-4a5e-4f60-9b71-8c2d3e4f5a6b",- "configurationToken": "<configuration-access-token>"- }'-```--A setup is:--```json-{- "setup": {- "id": "<setup-id>",- "requestKey": "6f1d2c3b-4a5e-4f60-9b71-8c2d3e4f5a6b",- "projectId": "<project-id>",- "agentId": "coder",- "alias": "development",- "channelId": "slack",- "name": "Patch",- "connectionId": "<connection-id>",- "phase": "app_created",- "app": { "id": "A0123456789", "name": "Patch" },- "actions": ["authorize", "cancel"],- "createdAt": "2026-09-17T10:00:00.000Z",- "updatedAt": "2026-09-17T10:00:04.000Z"- }-}-```--`workspace` (`{ id, name }`) and `botUserId` appear once the app is installed.-`error` carries `{ code, message, recoverable, retryAfterMs?, pointer?, at }`-when the last step did not complete; `recoverable` says whether submitting-again with corrected input can succeed. `actions` lists what the setup accepts-next: `create` (submit a configuration token), `authorize`, `manual` (finish-through manual setup) and `cancel`.--| Phase | Meaning |-| --- | --- |-| `prepared` | The target is reserved; a configuration token creates the app |-| `creating` | One creation attempt is in progress; a request with the same key joins it |-| `creation_uncertain` | Slack may or may not have created the app; check the Slack app list, then finish manually or cancel |-| `app_created` | The app exists; authorize to install it |-| `exchanging` | Slack approved the installation; the bot is being verified |-| `connected` | The connection is active |-| `cancelled` | Cancelled by the caller; an app already created in Slack is not deleted |--Error codes, as HTTP errors or as `error.code` on the setup:--| Code | Meaning |-| --- | --- |-| `slack_setup_conflict` | The request key was already used with a different target or name |-| `slack_setup_active` | Another setup is in progress for the target; `error.setupId` names it, and finding it by target returns the same record. Also answered by the manual create or reconnect (`POST /channels/slack/connections`) while an automated setup works on the target |-| `slack_already_connected` | The target already has a connected app; disconnect it first |-| `slack_setup_unavailable` | Automatic setup is not available; use manual setup |-| `slack_setup_not_found` | `404`: no setup with that id in this project |-| `slack_setup_not_authorizable` | `409` on authorize: the setup's phase does not allow it; read the setup for its next step |-| `slack_setup_connected` | `409` on cancel: the setup is connected; disconnect the connection instead |-| `slack_setup_busy` | `409` on cancel: the setup is creating or exchanging; wait for it to finish |-| `slack_setup_cancelled` | Recorded on a setup cancelled after the app was created or its creation was uncertain: the Slack app may still appear in the workspace's app list and can be removed there |-| `slack_manual_completion_blocked` | `409` on the manual credential save (`PUT /channels/slack/connections/<id>`): an automated setup owns the connection, or the pasted manifest is no longer current; cancel the setup, generate a new manifest, then enter credentials |-| `slack_configuration_token_invalid`, `slack_configuration_token_expired` | The token was rejected; generate a new one and submit it with the same key |-| `slack_manifest_rejected` | Slack rejected the generated app configuration; `pointer` names the field. Not recoverable in place: fix the declaration, redeploy, cancel the setup and start again |-| `slack_app_limit_reached` | The workspace cannot hold another app |-| `slack_rate_limited` | Wait `retryAfterMs` and submit again |-| `slack_provider_unavailable` | Slack declined with an unexpected error when creating the app, or did not answer during installation; submit or authorize again |-| `slack_creation_uncertain` | See phase `creation_uncertain` |-| `slack_exchange_failed`, `slack_exchange_uncertain`, `slack_authorization_denied`, `slack_authorization_expired` | The installation did not complete; authorize again |-| `slack_app_mismatch`, `slack_workspace_mismatch`, `slack_scope_missing`, `slack_enterprise_install_unsupported` | The installation did not match the created app, its established workspace or its declared scopes; authorize again and approve that app in a single workspace |-| `slack_setup_superseded` | The setup lost ownership of its connection to a manual connection or reconnect; set up manually or start again |--The authorization URL opens Slack's consent page for the created app and is-valid for ten minutes; authorizing again issues a new one. Slack sends the-outcome to `https://app.opencomputer.dev/api/managed-agents/slack/callback`,-which is registered on every app created this way, and the browser is then-redirected to the project's Connections tab with `environment=<alias>`,-`slack=<result>` and `setup=<id>` in the query. `result` is `connected` or one of-`authorization_denied`, `authorization_expired`, `exchange_failed`,-`app_mismatch`, `workspace_mismatch`, `scope_missing`,-`enterprise_install_unsupported`, `superseded` and `provider_unavailable`.-API clients do not call the callback.--`GET /channels` lists connections; each Slack connection carries `agents`, the-agents that receive the channel's messages in its environment.-## Projects, agents and deployments| Operation | Method and path | Success || --- | --- | --- || List projects | `GET /projects` | `200` with `{ projects }` || Create project | `POST /projects` with `{ name, slug? }` | `201` with the project |-| Get project | `GET /projects/<p>` | `200` with `{ project, deployments, sessions, connections, channels, schedules }` |+| Get project | `GET /projects/<p>` | `200` with `{ project, deployments, sessions, connections, schedules }` || List agents | `GET /agents` | `200` with `{ agents }`: `id`, `name`, `activeAlias`, `activeDeploymentId`, `deploymentCount`; `activeAlias` and `activeDeploymentId` are `null` while the agent has no active deployment || List deployments | `GET /deployments?agentId=<agent-id>` | `200` with `{ deployments }` || Get deployment | `GET /deployments/<id>` | `200` with `id`, `agentId`, `alias`, `memory` declarations, `createdAt` |@@ -595,5 +479,5 @@ curl 'https://app.opencomputer.dev/api/managed-agents/projects' \-H 'x-api-key: <api-key>'```-Secrets, runtime variables, schedules, channels, outboxes and logs are managed-with the CLI and the dashboard; see their pages under Concepts.+Secrets, runtime variables, schedules and logs are managed with the CLI and+the dashboard; see their pages under Concepts.diff --git a/docs/agents/channels.mdx b/docs/agents/channels.mdxdeleted file mode 100644index 3f82b9ff..00000000--- a/docs/agents/channels.mdx+++ /dev/null@@ -1,247 +0,0 @@-----title: "Channels"-description: "Declare a conversational surface in code and connect it per environment"------Channels connect a project to a messaging provider. The channel definition is-code-owned; provider credentials and conversation IDs are configured in-the dashboard for each environment.--A channel is a conversation keyed by an external participant. What differs-between providers is transport, addressing, and authentication; what does not-differ is that an inbound message continues the conversation it belongs to.-Agents see the second part and never the first — one `useInput().source ===-"channel"` branch handles every provider.--| Provider | `type` | Triggers |-| --- | --- | --- |-| Slack | `"slack"` | `mention`, `direct-message` |-| Twilio (SMS, WhatsApp) | `"twilio"` | `message` |-| Email | `"email"` | `message` |--Providers are named for the vendor rather than the medium, because the vendor is-what actually differs: Twilio signs the request URL and its sorted parameters,-Slack signs a timestamp and the raw body. A different SMS vendor is a different-adapter, not a variant of this one. Twilio WhatsApp needs no separate provider —-same API, same webhook, same signature, with a `whatsapp:` prefix on addresses.--## Define a Twilio or email channel--Providers other than Slack address one participant, so they need no scopes and-have a single inbound event:--```tsx opencomputer/channels/shop-sms.ts-import { defineChannel } from "@opencomputer/agent";--export default defineChannel({- id: "shop-sms",- type: "twilio",- idle: { suspendAfterSeconds: 120 },-});-```--```tsx opencomputer/channels/support-email.ts-import { defineChannel } from "@opencomputer/agent";--export default defineChannel({- id: "support-email",- type: "email",-});-```--Note what is **not** in the definition: the phone number and the inbox address.-Those are per-environment operational configuration, bound to a connection in-the dashboard, exactly as Slack workspace and conversation IDs are. Development-and production do not share a number.--Register them the same way as Slack, with the trigger the provider supports:--```tsx opencomputer/agents/receptionist/channels/shop-sms.ts-import { registerChannel } from "@opencomputer/agent";-import shopSms from "../../../channels/shop-sms.js";--export default registerChannel(shopSms, { on: ["message"] });-```--Registering a Slack trigger on a Twilio channel is a build error, and the reverse-is too.--## Idle and cost--Agent runtime is billed by wall-clock time, and a conversation spends most of-its life waiting for a person. `idle.suspendAfterSeconds` says how long to hold-the runtime after the last message; an inbound message resumes it. It defaults-to 300 seconds, and the default matters most where replies are slowest — a text-conversation that waits hours for an answer should not bill for those hours.--## Slack--## Define a Slack channel--Declaring a channel is optional. An agent whose deployment declares none gets a-dedicated Slack app with the standard configuration: mentions and direct-messages go to that one agent. Declare a channel to narrow or extend what the-app can do, to share one app between several agents, or to publish through-[outboxes](/agents/outboxes).--Create a project-level channel under `opencomputer/channels/`:--```tsx opencomputer/channels/team-slack.ts-import { defineChannel } from "@opencomputer/agent";--export default defineChannel({- id: "team-slack",- type: "slack",- displayName: "Engineering Slack",- scopes: {- bot: ["app_mentions:read", "channels:read", "chat:write"],- },- events: ["app_mention"],- destinations: {- "pull-request-reviews": {- type: "conversation",- visibility: "public",- },- },- routing: {- whenAmbiguous: "ask",- },-});-```--The filename must match the channel `id`. A channel owns:--- the Slack bot scopes requested by its generated app manifest;-- the Slack events the app subscribes to;-- stable destination names used by outboxes; and-- the routing policy used when several agents can receive the same event.--Slack workspace IDs, conversation IDs, bot tokens, and signing secrets do not-belong in source.--## Register an agent for inbound messages--A channel does not name an agent. An agent opts into inbound events with a-registration under its own directory:--```tsx opencomputer/agents/reviewer/channels/team-slack.ts-import { registerChannel } from "@opencomputer/agent";-import teamSlack from "../../../channels/team-slack.js";--export default registerChannel(teamSlack, {- on: ["mention"],-});-```--`mention` requires the channel to declare the `app_mention` event and the-`app_mentions:read` scope. `direct-message` requires `message.im` and-`im:history`.--Several agents may register the same channel. An existing Slack thread stays-with its selected agent. If a new thread has several eligible agents,-OpenComputer asks the user which agent should handle it instead of guessing.--## Connect Slack--Each declared channel gets its own Slack app per environment, and so does an-agent whose deployment declares none. OpenComputer creates the app from the-capabilities declared in code and installs it into your workspace; you paste-one short-lived token and approve the installation in Slack.--After the deployment is synchronized:--1. Open the project in the dashboard and select **Development** or- **Production**.-2. Open **Connections**. The Slack panel lists each declared channel with the- agents that receive its messages, or the agent's dedicated app when the- deployment declares no channel.-3. Choose **Create Slack bot** and enter the bot's name.-4. Paste an **App configuration access token** from- [your Slack apps](https://api.slack.com/apps): under **Your App- Configuration Tokens**, choose **Generate Token**, choose the workspace the- bot will live in, and copy the **Access Token** (not the refresh token).-5. Approve the installation in Slack. You are returned to the same project- and environment.-6. Invite the bot to each conversation it will use and mention it.--The panel distinguishes **Connected**, meaning the installed credentials are-stored, from **First message received**, meaning a real Slack message reached-the agent. Slack's URL verification is not a message; mention the bot once to-confirm delivery.--The configuration token is used once, to create the app, and is never stored.-It expires 12 hours after it is generated; the installed bot does not expire-with it. Changing prompts, tools or other code and redeploying does not-require reconnecting Slack.--If Slack's consent page is closed before approval, the created app is kept:-open Connections again and choose **Authorize in Slack**. When the outcome of app-creation is unknown, the panel says so and links to your Slack app list rather-than creating a second app; finish with manual setup if the app exists, or-cancel and start again if it does not. Cancelling a setup never deletes an-app in Slack.--### Set up manually--Manual setup remains available for workspaces where you cannot generate a-configuration token, or to connect an app you created yourself. In the Slack-panel choose **Set up manually**:--1. Create or update the Slack app from the generated manifest.-2. Install the app to the intended Slack workspace.-3. Enter the installed app's ID, signing secret and bot token when prompted.-4. Invite the app to each Slack conversation it will use.--Both paths produce the same app configuration and the same connection.-Credentials, destination bindings and disconnecting are managed in the same-place afterwards.--### Destinations and scopes--Under **Channels**, bind each code-defined destination to that conversation's-Slack ID and verify it. For a public destination, include `channels:read` and-`chat:write`. For a private destination, include `groups:read` and-`chat:write`. The app must be a member of the selected conversation.-OpenComputer does not request `chat:write.public` automatically.--Adding a scope or event in code changes the generated app configuration.-Update the Slack app from the current manifest and reinstall it so its granted-scopes satisfy the deployment; other code changes need no reconnection.--Inspect delivery health without opening the dashboard:--```bash-opencomputer channels status --environment development --json-```--The result reports the last accepted provider event, the latest outbound-delivery status, and the latest redacted error category. It never includes-message content, provider responses, tokens, or signing secrets.--## Environment isolation--Development and Production never share Slack credentials, destination-bindings, thread routing, or delivery history. Connecting a Slack app in one-environment does not connect it in the other.--The same stable destination name can therefore map independently:--```text-Development: pull-request-reviews -> #agent-tests-Production: pull-request-reviews -> #pull-request-reviews-```--Slack delivery uses the stored conversation ID. Renaming the conversation does-not change the route, although its display label may refresh later.--## Current limits--- Destination binding currently uses a Slack conversation ID.-- Direct Slack user mapping and outbound DMs are not available.-- A registration can receive mentions or direct messages only when the- corresponding event and scope are declared.-- A Slack app is installed into a single workspace; organization-wide- installations are not supported.--Use an [outbox](/agents/outboxes) when an agent needs to publish a proactive-message to a configured Slack destination.diff --git a/docs/agents/deployments.mdx b/docs/agents/deployments.mdxindex 404bb228..406b3371 100644--- a/docs/agents/deployments.mdx+++ b/docs/agents/deployments.mdx@@ -25,11 +25,10 @@ npm run deploy -- --alias production```Every deploy first runs `opencomputer doctor`, a local static scan for invalid-connection origins, misplaced tools, inconsistent channel declarations, and-missing secret declarations, and then prints the project it resolved and the-cloud id each local agent deploys as. Run `opencomputer doctor --json` directly-to get structured diagnostics, with the same resolution under `resolution`,-before invoking a deployment agent.+connection origins, misplaced tools, and missing secret declarations, and then+prints the project it resolved and the cloud id each local agent deploys as.+Run `opencomputer doctor --json` directly to get structured diagnostics, with+the same resolution under `resolution`, before invoking a deployment agent.The CLI builds the current source, creates an immutable deployment, and movesthe `production` alias to it. Development remains available for further work.diff --git a/docs/agents/document-memory.mdx b/docs/agents/document-memory.mdxindex 7811e518..029bc073 100644--- a/docs/agents/document-memory.mdx+++ b/docs/agents/document-memory.mdx@@ -69,7 +69,7 @@ Set `memory.<resource>` when creating a session:to `read`; collection writes are unsupported.- Resources must be declared by the deployment and bound documents must exist.Invalid bindings fail admission.-- Bindings stay fixed. Schedules, channels and webhooks do not configure them.+- Bindings stay fixed. Schedules and webhooks do not configure them.- One store per project and environment. An application with many userskeeps their data apart with document bindings and application-chosendocument IDs; a collection binding sees every document of the resource, sodiff --git a/docs/agents/examples/github-actions-triage.mdx b/docs/agents/examples/github-actions-triage.mdxdeleted file mode 100644index b19bb728..00000000--- a/docs/agents/examples/github-actions-triage.mdx+++ /dev/null@@ -1,146 +0,0 @@-----title: "Triage failed GitHub Actions runs"-description: "Start an agent from a failed workflow and deliver its diagnosis to Slack"------The GitHub Actions triage example starts a durable OpenComputer session when a-selected workflow fails. The agent receives the failed-step logs, separates-observed evidence from likely causes, and publishes one report to a configured-Slack conversation.--<Frame>- <img- src="/images/agents/actions-triage-slack.png"- alt="A GitHub Actions CI failure report delivered by an OpenComputer agent to Slack"- />-</Frame>--## How it works--1. A GitHub `workflow_run` workflow collects metadata and up to 24,000- characters of failed-step logs.-2. The workflow posts a structured payload to an authenticated OpenComputer- agent webhook.-3. The webhook starts a new session against the active deployment.-4. The agent analyzes only the supplied evidence and calls its- `publish_ci_triage` tool.-5. A durable outbox delivers provider-neutral report content to the Slack- conversation bound to the `ci-failures` destination.--The collector does not check out or execute code from the failed run. The agent-cannot rerun workflows, modify the repository, or call Slack directly.--## Start with the example--<Card- title="Deploy to OpenComputer"- icon="rocket"- href="https://app.opencomputer.dev/new?repository-url=https%3A%2F%2Fgithub.com%2Fdiggerhq%2Fopencomputer-example-actions-triage"->- Deploy the project to Development, then configure its Slack channel and- webhook.-</Card>--[Browse the source on GitHub](https://github.com/diggerhq/opencomputer-example-actions-triage).--```bash-git clone https://github.com/diggerhq/opencomputer-example-actions-triage.git-cd opencomputer-example-actions-triage-npm install-npm run opencomputer -- login-npm run deploy -- --watch-```--Keep the watch command running while testing. It deploys changes to the-Development environment; it does not start a local agent server.--## Connect Slack--The repository declares an **Engineering Slack** channel in-`opencomputer/channels/team-slack.ts`. That channel defines the Slack app's-capabilities and a stable `ci-failures` destination. Credentials and the actual-Slack conversation are configured separately for each environment.--In the OpenComputer project dashboard:--1. Select **Development**, then open **Channels**.-2. Open **Engineering Slack** and create or update a Slack app from the- generated manifest.-3. Install the app in your workspace and invite it to the public conversation- that should receive failure reports.-4. Bind `ci-failures` to that conversation and verify the binding.--See [Slack channels](/agents/channels) for the complete installation and-environment-isolation model. The agent publishes through the code-defined-`ci-triage` [outbox](/agents/outboxes), so Slack delivery can retry separately-from the agent turn.--## Create the agent webhook--Create a Development webhook from the repository:--```bash-npm run opencomputer -- webhooks create github-actions-failures \- --agent current \- --environment development-```--The CLI prints the stable invocation URL and bearer token. Save them as GitHub-Actions repository secrets named:--- `OPENCOMPUTER_WEBHOOK_URL`-- `OPENCOMPUTER_WEBHOOK_TOKEN`--The token is shown only when created or rotated. Never commit it. See-[Agent webhooks](/agents/webhooks) for invocation and rotation details.--## Choose workflows to monitor--The included `.github/workflows/triage-failed-actions.yml` listens for a-workflow whose display name is `CI`:--```yaml-on:- workflow_run:- workflows: [CI]- types: [completed]-```--Change `workflows` to the exact display names you want to monitor. The-collector must be present on the repository's default branch before GitHub-will run it. To monitor another repository, copy the collector workflow and-configure the same two repository secrets there.--## Test the complete flow--The example's `CI` workflow includes a manual `force_failure` input:--1. Push the repository to GitHub's default branch.-2. Open **Actions → CI → Run workflow**.-3. Set `force_failure` to `true` and start the run.-4. Wait for **Triage failed GitHub Actions** and confirm its webhook step- returns HTTP `202`.-5. Open the `sessionUrl` printed by that step to inspect the durable session.-6. In OpenComputer, confirm the `ci-triage` outbox item was delivered.-7. Confirm a concise diagnosis and GitHub run link appear in the bound Slack- conversation. The complete structured content remains available on the- `ci-triage` outbox item.--Each new webhook delivery starts a session pinned to the deployment active at-that time. After changing the agent, trigger a new workflow run rather than-steering an older session, which continues using its pinned deployment.--The collector uses the GitHub run ID and attempt as its idempotency key. A-retry of the same webhook delivery reuses the original session; rerunning the-GitHub workflow creates a new attempt and report.--## Safety properties--- Workflow names, branches, commit metadata, actor names, and logs are treated- as untrusted evidence rather than instructions.-- Common GitHub, AWS, and bearer-token shapes are redacted before model and- Slack use, in addition to GitHub's own secret masking.-- Interactive questions are disabled so an unattended run records unknowns,- publishes its best available report, and finishes.-- Missing or truncated logs are called out in the report, which always links- responders to the complete GitHub run.diff --git a/docs/agents/examples/slack-coder.mdx b/docs/agents/examples/slack-coder.mdxindex 09a7f358..d678900a 100644--- a/docs/agents/examples/slack-coder.mdx+++ b/docs/agents/examples/slack-coder.mdx@@ -33,10 +33,8 @@ and report their actual results, push the branch and open a draft pullrequest, continue follow-ups on that branch, never merge, and never printcredentials or put them in files or Git URLs.-The example declares no Slack channel, so the agent gets a dedicated Slack app-with the standard configuration: mentions and direct messages go to this one-agent. To narrow or extend what the app can do, declare a channel under-`opencomputer/channels/` as described in [Channels](/agents/channels).+The agent uses a dedicated Slack app: mentions and direct messages go to this+one agent.## Deploy it@@ -73,8 +71,8 @@ access token from [your Slack apps](https://api.slack.com/apps), and approvethe installation in Slack. You are returned to the same project andenvironment. Invite the bot to a channel and mention it once; the panelreports the first message received.-[Connect Slack](/agents/channels#connect-slack) covers the token and the-manual alternative.+The Connections panel also offers the manual setup alternative; see+[Slack connections](/agents/slack) for the full flow.## Give it a taskdiff --git a/docs/agents/inputs.mdx b/docs/agents/inputs.mdxindex bfe5cf42..2af23dac 100644--- a/docs/agents/inputs.mdx+++ b/docs/agents/inputs.mdx@@ -46,6 +46,13 @@ with `source: "user"`; a [webhook](/agents/webhooks) delivers its body as thepayload; a [schedule](/agents/schedules) dispatches the payload it wasconfigured with. The agent reads all of them the same way.+A message from a connected [Slack app](/agents/slack) arrives with+`source: "channel"` and a `channel` object naming the `provider` (`slack`),+the `connectionId`, and the Slack `workspaceId`, `conversationId` and `userId`+when Slack supplies them. An agent serving one workspace can ignore all of+this; an agent behind a shared Slack app uses it to decide whose records to+read.+## Adapt to the sourceThe current direct and delegated flows can share one agent definition:@@ -62,54 +69,6 @@ export default function Agent() {}```-## Know who is speaking--A `channel` input carries the sender's identity in the provider's own terms.--```ts-interface ChannelMessageContext {- readonly provider: string;- readonly connectionId: string;- readonly workspaceId?: string;- readonly conversationId?: string;- readonly userId?: string;-}-```--| Field | Meaning |-| --- | --- |-| `provider` | `slack`, `twilio`, … |-| `connectionId` | The connection the message arrived on |-| `workspaceId` | The provider's tenant: a Slack team, a Twilio account |-| `conversationId` | Where it was said, when the provider names conversations |-| `userId` | The provider's id for the person who said it |--An agent serving one workspace can ignore all of this. An agent serving many —-one deployment behind a distributed Slack app — needs it to decide whose-records to read and which credential to use:--```tsx-import { useInput } from "@opencomputer/agent";--export default function Agent() {- const input = useInput();-- if (input.source === "channel" && input.channel.workspaceId) {- return `You are answering for workspace ${input.channel.workspaceId}. ` +- `Look up that customer before answering.`;- }-- return "Help with the current request.";-}-```--These are the provider's public identifiers, not OpenComputer's. They are-stable, which is what makes them usable as a key into your own records.--Session ownership is keyed separately, by a one-way hash you never see. That-keeps two people's sessions apart; this tells your agent who it is talking to.-The two are deliberately different values.-## Read structured payloadsNarrow or validate a payload before reading application-specific fields:diff --git a/docs/agents/mental-model.mdx b/docs/agents/mental-model.mdxindex 265a7c90..ba10764e 100644--- a/docs/agents/mental-model.mdx+++ b/docs/agents/mental-model.mdx@@ -10,7 +10,7 @@ session.```mermaidflowchart LR- Trigger[Message, schedule,<br/>webhook, or channel]+ Trigger[Message, schedule,<br/>webhook, or event]Session[Durable session]Harness[Managed harness]Function[Your agent function]@@ -149,8 +149,8 @@ flowchart LR```Development and Production point to different deployments and keep operational-configuration—such as secrets, schedule state, webhook tokens, and channel-bindings—separate. Read+configuration—such as secrets, schedule state, and webhook tokens—separate.+Read[Deployments and environments](/agents/deployments) for that lifecycle.## Remember this@@ -177,7 +177,7 @@ bindings—separate. Read<Card title="Webhooks" icon="webhook" href="/agents/webhooks">Start sessions from authenticated external services.</Card>- <Card title="Channels and outboxes" icon="message" href="/agents/channels">- Receive conversational events and publish durable notifications.+ <Card title="Database" icon="database" href="/agents/database">+ Store application state and durable work for application-owned workers.</Card></CardGroup>diff --git a/docs/agents/outboxes.mdx b/docs/agents/outboxes.mdxdeleted file mode 100644index 05574634..00000000--- a/docs/agents/outboxes.mdx+++ /dev/null@@ -1,103 +0,0 @@-----title: "Outboxes"-description: "Publish durable notifications from agents to Slack"------An outbox is a code-defined, durable route for proactive notifications. The-agent publishes provider-neutral content; OpenComputer stores it first and-delivers it asynchronously through the configured channel destination.--## Define an outbox--Create a project-level outbox under `opencomputer/outboxes/`:--```tsx opencomputer/outboxes/review-requests.ts-import { defineOutbox } from "@opencomputer/agent";-import teamSlack from "../channels/team-slack.js";--export default defineOutbox({- id: "review-requests",- delivery: {- channel: teamSlack,- destination: "pull-request-reviews",- },-});-```--The referenced destination must exist on the channel. The filename must match-the outbox `id`.--An outbox currently has one exact route: one channel resource and one named-destination. It does not select a fallback destination or fan a publication-out to several providers.--## Authorize an agent--Register the outbox under every agent that may publish through it:--```tsx opencomputer/agents/reviewer/outboxes/review-requests.ts-import { registerOutbox } from "@opencomputer/agent";-import reviewRequests from "../../../outboxes/review-requests.js";--export default registerOutbox(reviewRequests);-```--Inbound channel registration and outbound outbox registration are independent.-For example, a scheduled agent can publish to Slack without receiving Slack-mentions.--## Publish a notification--Publish from a code-defined tool or another effectful agent operation:--```tsx-import { defineTool, publishOutbox } from "@opencomputer/agent";--export const notifyReviewer = defineTool({- name: "notify_reviewer",- description: "Notify the team that a pull request is ready",- async run() {- return publishOutbox("review-requests", {- type: "pull-request.review-requested",- content: {- title: "Pull request ready for review",- body: "A reviewer was requested on GitHub.",- url: "https://github.com/acme/widgets/pull/42",- },- idempotencyKey: "acme/widgets#42:review-requested",- });- },-});-```--`type` is a lowercase dot-notation event name. `content` must be-JSON-compatible. `idempotencyKey` identifies this publication within the-project environment and outbox; reuse it when retrying the same logical event.--Publishing returns after the item is durably stored. Slack delivery continues-outside the agent runtime, so a transient Slack failure does not extend or-repeat the producing turn.--## Inspect delivery--Select an environment and open **Outboxes** in the project dashboard. The list-shows each declared outbox, its exact channel and destination, binding-readiness, recent items, delivery status, source session when recorded, and-redacted errors.--Delivery records are isolated by environment. A Development publication cannot-use Production credentials or appear in Production history.--## Current limits--- An outbox delivers to one Slack conversation.-- One publish does not fan out to Slack, Discord, SMS, or several Slack- conversations. Define and publish to separate outboxes when you need separate- routes.-- Outboxes do not resolve GitHub users to Slack users and cannot send a direct- message to a reviewer.-- The initial Slack renderer supports provider-neutral text-oriented content;- Slack-specific Block Kit definitions are not part of the authoring API.--See [Slack channels](/agents/channels) for app installation, scopes, and-destination binding.diff --git a/docs/agents/projects.mdx b/docs/agents/projects.mdxindex 67093af8..ffd27a74 100644--- a/docs/agents/projects.mdx+++ b/docs/agents/projects.mdx@@ -15,14 +15,10 @@ my-agent/├── opencomputer/│ ├── .env.example│ ├── project.ts-│ ├── channels/ # optional project messaging channels│ ├── database/ # optional default database migrations-│ ├── outboxes/ # optional durable notification routes│ └── agents/│ └── hello-world/│ ├── agent.ts-│ ├── channels/ # optional inbound registrations-│ ├── outboxes/ # optional publish registrations│ ├── tools/ # optional│ ├── skills/ # optional│ └── schedules/ # optional@@ -31,8 +27,6 @@ my-agent/- `opencomputer/project.ts` declares project metadata and agent IDs.- `opencomputer/agents/<id>/agent.ts` defines one agent.-- `opencomputer/channels/` and `opencomputer/outboxes/` define shared project- resources; registrations under an agent authorize that agent to use them.- `opencomputer/database/migrations/` holds ordered SQL migrations for theproject's [default database](/agents/database).- `opencomputer/.env.local` optionally holds ignored development secrets.@@ -106,9 +100,6 @@ The current project dashboard provides:- **Deployments** for immutable version history and active aliases- **Sessions** created through the dashboard, React client, or API- **Schedules** deployed from each agent's source directory-- **Channels** for environment-specific Slack installation and destination- binding-- **Outboxes** for inspecting proactive notification delivery- **Memory** for reading, editing and exporting saved agent notes- **Database** for inspecting tables, rows and applied migrations, and runningread-only queriesdiff --git a/docs/agents/schedules.mdx b/docs/agents/schedules.mdxindex aa8bfdae..b627d939 100644--- a/docs/agents/schedules.mdx+++ b/docs/agents/schedules.mdx@@ -57,7 +57,7 @@ When `enabled` is omitted, it defaults to `["production"]`.Development recurrence.Development and Production have separate schedule state, run history,-sessions, secrets, and channel bindings.+sessions, secrets, and database state.## Receive scheduled inputdiff --git a/docs/agents/secrets.mdx b/docs/agents/secrets.mdxindex 78717cdb..c24d7d6e 100644--- a/docs/agents/secrets.mdx+++ b/docs/agents/secrets.mdx@@ -98,69 +98,6 @@ npx --package @opencomputer/cli opencomputer secrets remove GITHUB_TOKEN --envirList output contains metadata such as the name, scope, environment, andallowed origins. Secret values are never returned.-## Scope a secret to a tenant or a person--One deployment answers every installation of a channel app, and each-installation may be a different customer with their own account. A project-secret would mean every customer's agent holding every other customer's-credential.--`useSecret` takes a scope:--```tsx-import { bearer, defineConnection, useSecret } from "@opencomputer/agent";--export const billing = defineConnection({- id: "billing",- origin: "https://api.example.com",- headers: {- // Resolved from the installation this message arrived through.- Authorization: bearer(useSecret("BILLING_API_KEY", { scope: "tenant" })),- },-});-```--| Scope | Resolved from | Use it for |-| --- | --- | --- |-| `project` | the project (default) | A credential that is yours, not a customer's |-| `tenant` | the channel installation the message arrived through | One account per customer workspace |-| `user` | the person being acted for | A write that should carry someone's own authority |--Both are fixed when the session starts, so nothing the model says or is sent-can influence which credential it gets.--For a [tool that waits for approval](/agents/tools#wait-for-a-person-before-writing)-the two scopes behave differently, and the difference is deliberate. The write-inherits the **tenant** of the proposal, so a card approved hours later still-applies to the right account. But it runs as the **person who approved it**,-not the person who asked — so a `user`-scoped credential is the approver's.-A billing change is then made with the authority of whoever took-responsibility for it.--**They fail closed.** If no secret is set for that tenant or user, the request-is refused and never leaves the runtime. There is no fallback to the project-secret, because that fallback is the leak this prevents. Someone who has not-connected their own account can still propose a change; they cannot apply one.--Set them per installation, or per person on an installation:--```bash-# The installation's own credential-curl -X PUT ".../v1/channels/slack/apps/$APP/installations/$CONNECTION/secrets/BILLING_API_KEY" \- -H "x-api-key: $OPENCOMPUTER_API_KEY" -H "content-type: application/json" \- -d '{"value":"...","allowedOrigins":["https://api.example.com"]}'--# One person's own credential on that installation-curl -X PUT ".../v1/channels/slack/apps/$APP/installations/$CONNECTION/users/$USER/secrets/BILLING_API_KEY" \- -H "x-api-key: $OPENCOMPUTER_API_KEY" -H "content-type: application/json" \- -d '{"value":"...","allowedOrigins":["https://api.example.com"]}'-```--`GET` the same path without a name to list what is set, and `DELETE` with a-name to remove one. Values are write-only: listing returns names and allowed-origins, never a value. You can also pass `secrets` when importing an-installation, so a tenant is never live and unconfigured.-## Agent runtime variablesUse an agent runtime variable when code or a command must receive a value as adiff --git a/docs/agents/slack.mdx b/docs/agents/slack.mdxnew file mode 100644index 00000000..83c9fe64--- /dev/null+++ b/docs/agents/slack.mdx@@ -0,0 +1,75 @@+---+title: "Slack connections"+description: "Connect a deployed agent to Slack from the dashboard so people can talk to it in threads"+---++A Slack connection gives a deployed agent its own Slack app. Mention the app or+send it a direct message and OpenComputer starts a session for that thread;+follow-ups in the same thread continue the same session. There is no Slack+client, message parser or reply code to write: the agent reads the message+through [`useInput()`](/agents/inputs) and its output is posted back to the+thread.++Slack is connected per project and per environment from the dashboard.+Development and Production never share Slack credentials or thread routing, so+connecting an app in one environment does not connect it in the other.++## Connect Slack++After the project's deployment is synchronized:++1. Open the project in the dashboard and select **Development** or+ **Production**.+2. Open **Connections**. The Slack panel shows the agent that will receive+ messages.+3. Choose **Create Slack bot** and enter the bot's name.+4. Paste an **App configuration access token** from+ [your Slack apps](https://api.slack.com/apps): under **Your App+ Configuration Tokens**, choose **Generate Token**, choose the workspace the+ bot will live in, and copy the **Access Token** (not the refresh token).+5. Approve the installation in Slack. You are returned to the same project+ and environment.+6. Invite the bot to each conversation it will use and mention it.++OpenComputer creates the app with the standard configuration (mentions and+direct messages) and installs it into your workspace. The configuration token+is used once, to create the app, and is never stored.++The panel distinguishes **Connected**, meaning the installed credentials are+stored, from **First message received**, meaning a real Slack message reached+the agent. Slack's URL verification is not a message; mention the bot once to+confirm delivery.++If Slack's consent page is closed before approval, the created app is kept:+open Connections again and choose **Authorize in Slack**. When the outcome of+app creation is unknown, the panel says so and links to your Slack app list+rather than creating a second app; finish with manual setup if the app exists,+or cancel and start again if it does not. Cancelling a setup never deletes an+app in Slack.++### Set up manually++Manual setup remains available for workspaces where you cannot generate a+configuration token, or to connect an app you created yourself. In the Slack+panel choose **Set up manually**:++1. Create or update the Slack app from the generated manifest.+2. Install the app to the intended Slack workspace.+3. Enter the installed app's ID, signing secret and bot token when prompted.+4. Invite the app to each Slack conversation it will use.++Both paths produce the same app configuration and the same connection.+Credentials and disconnecting are managed in the same place afterwards.++## Current limits++- A Slack app is installed into a single workspace; organization-wide+ installations are not supported.+- Direct Slack user mapping and outbound DMs are not available.+- Proactive messages to a Slack conversation that did not start the session+ are not part of the connection. Persist pending notifications in the+ project's [database](/agents/database) and deliver them from a+ [scheduled](/agents/schedules) worker instead.++See [A coding agent in Slack](/agents/examples/slack-coder) for a complete+deployed example.diff --git a/docs/docs.json b/docs/docs.jsonindex db29d4c8..1c3bcd9a 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -45,11 +45,10 @@"agents/schedules","agents/webhooks","agents/capabilities",- "agents/channels",- "agents/outboxes","agents/secrets","agents/services","agents/github",+ "agents/slack","agents/byok","agents/deployments"]@@ -90,7 +89,6 @@"pages": ["agents/examples/gtm-engineer","agents/examples/feature-flag-hygiene",- "agents/examples/github-actions-triage","agents/examples/slack-coder","agents/examples/pr-review","agents/examples/test-coverage"@@ -396,6 +394,18 @@{"source": "/agents/examples/exa-research-session","destination": "/agents/examples/gtm-engineer"+ },+ {+ "source": "/agents/channels",+ "destination": "/agents/slack"+ },+ {+ "source": "/agents/outboxes",+ "destination": "/agents/database"+ },+ {+ "source": "/agents/examples/github-actions-triage",+ "destination": "/agents/webhooks"}],"appearance": {diff --git a/web/src/App.tsx b/web/src/App.tsxindex 411b4ed8..8db0503e 100644--- a/web/src/App.tsx+++ b/web/src/App.tsx@@ -31,7 +31,6 @@ const ManagedAgentsHome = lazy(() => import('./managed-agents/Home'))const ManagedAgentDetail = lazy(() => import('./managed-agents/Detail'))const ManagedProjectDetail = lazy(() => import('./managed-agents/Project'))const ManagedSessionDetail = lazy(() => import('./managed-agents/Session'))-const ManagedAgentChannels = lazy(() => import('./managed-agents/Channels'))const ManagedAgentConnections = lazy(() => import('./managed-agents/Connections'),)@@ -79,10 +78,6 @@ export default function App() {)}/>- <Route- path="managed-agents/channels"- element={<ManagedAgentChannels />}- /><Routepath="model-access/callback"element={<ModelAccessCallback />}diff --git a/web/src/api/mock.ts b/web/src/api/mock.tsindex 2631ad4c..c6a18ee7 100644--- a/web/src/api/mock.ts+++ b/web/src/api/mock.ts@@ -1342,10 +1342,6 @@ const ROUTES: Array<[RegExp, Handler]> = [channels: [],connections: [],createdAt: new Date(BASE).toISOString(),- // Declaring one channel of each provider so the channels tab renders- // both connect flows in preview. They are genuinely different: Slack has- // an app to install, Twilio has credentials to paste and a number to- // point at us.projectDeployment: {id: 'research-assistant:preview',digest: 'p'.repeat(64),@@ -1367,12 +1363,6 @@ const ROUTES: Array<[RegExp, Handler]> = [},},},- {- id: 'shop-sms',- type: 'twilio',- displayName: 'Customer texts',- destinations: { reply: { type: 'reply' } },- },],channelRegistrations: [],outboxes: [],diff --git a/web/src/components/app-shell-nav.ts b/web/src/components/app-shell-nav.tsindex 4939ffec..3b8eab77 100644--- a/web/src/components/app-shell-nav.ts+++ b/web/src/components/app-shell-nav.ts@@ -13,9 +13,7 @@ import {Monitor,Package,Plug,- Radio,Rocket,- Send,Webhook,type LucideIcon,} from 'lucide-react'@@ -66,16 +64,6 @@ export function managedAgentsNav(options: {label: 'Sessions',icon: MessagesSquare,},- {- to: `${projectPath}/channels`,- label: 'Channels',- icon: Radio,- },- {- to: `${projectPath}/outboxes`,- label: 'Outboxes',- icon: Send,- },{to: `${projectPath}/schedules`,label: 'Schedules',@@ -120,6 +108,8 @@ export function managedAgentsNav(options: {],},)++ return groups}if (!options.projectId) {diff --git a/web/src/components/app-shell.test.ts b/web/src/components/app-shell.test.tsindex 97b434b3..1e7942de 100644--- a/web/src/components/app-shell.test.ts+++ b/web/src/components/app-shell.test.ts@@ -31,8 +31,6 @@ describe('managed agents navigation', () => {expect(nav[1]?.items.map((item) => item.label)).toEqual(['Deployments','Sessions',- 'Channels',- 'Outboxes','Schedules','Webhooks','Memory',@@ -75,19 +73,13 @@ describe('managed agents navigation', () => {).toEqual([undefined, 'Account', 'Infrastructure'])})- it('keeps enabled advanced areas below project navigation', () => {+ it('shows only project-scoped navigation inside a project', () => {expect(managedAgentsNav({projectId: 'project-one',durableSessionsEnabled: true,infrastructureEnabled: true,}).map((group) => group.label),- ).toEqual([- undefined,- undefined,- 'Account',- 'Durable sessions',- 'Infrastructure',- ])+ ).toEqual([undefined, undefined])})})diff --git a/web/src/managed-agents/Channels.tsx b/web/src/managed-agents/Channels.tsxdeleted file mode 100644index fbdadeca..00000000--- a/web/src/managed-agents/Channels.tsx+++ /dev/null@@ -1,137 +0,0 @@-import { useQuery } from '@tanstack/react-query'-import { Link } from 'react-router-dom'-import { ArrowUpRight, Loader2, Radio } from 'lucide-react'-import { PageHeader } from '@/components/page-header'-import { Panel, PanelContent } from '@/components/panel'-import { StatusBadge } from '@/components/status-badge'-import { Button } from '@/components/ui/button'-import {- displayManagedAgentName,- getManagedAgentChannels,- getManagedAgents,- getManagedProjects,-} from './api'--function displayResourceName(value: string) {- return value- .replace(/[-_]+/g, ' ')- .replace(/\b\w/g, (character) => character.toUpperCase())-}--export default function ManagedAgentChannels() {- const channels = useQuery({- queryKey: ['managed-agent-channels'],- queryFn: getManagedAgentChannels,- })- const agents = useQuery({- queryKey: ['managed-agents'],- queryFn: getManagedAgents,- })- const projects = useQuery({- queryKey: ['managed-projects'],- queryFn: () => getManagedProjects(),- })- const agentNames = new Map(- (agents.data ?? []).map((agent) => [- agent.id,- displayManagedAgentName(agent),- ]),- )- // Setup and connection details live on the project's Connections tab.- const projectByAgent = new Map(- (projects.data ?? []).flatMap((project) =>- project.agents.map((agent) => [agent.id, project.id] as const),- ),- )-- return (- <div>- <PageHeader- title="Channels"- description="Places where agents can receive and send messages."- />-- {channels.isLoading ? (- <div className="flex min-h-48 items-center justify-center">- <Loader2 className="text-muted-foreground size-5 animate-spin" />- </div>- ) : channels.isError ? (- <Panel>- <PanelContent className="flex min-h-40 flex-col items-center justify-center gap-4 text-center">- <div>- <p className="text-sm font-medium">- Channels are temporarily unavailable- </p>- <p className="text-muted-foreground mt-1 text-sm">- Try loading this page again.- </p>- </div>- <Button variant="outline" onClick={() => void channels.refetch()}>- Try again- </Button>- </PanelContent>- </Panel>- ) : channels.data?.length ? (- <div className="grid gap-3 md:grid-cols-2">- {channels.data.map((channel) => {- const consumers = (- channel.agents.length ? channel.agents : [channel.agentId]- ).map((agentId) => agentNames.get(agentId) ?? agentId)- const projectId = projectByAgent.get(channel.agentId)- // Slack apps are set up on Connections; Twilio has no section- // there, its wizard lives on the project's Channels tab.- const tab =- channel.channel === 'twilio' ? 'channels' : 'connections'- const tabLabel = tab === 'channels' ? 'Channels' : 'Connections'- return (- <Panel key={channel.id}>- <PanelContent className="flex items-center gap-3">- <div className="bg-muted text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-md">- <Radio className="size-4" aria-hidden />- </div>- <div className="min-w-0 flex-1">- <p className="truncate text-sm font-medium">- {channel.teamName ||- `${displayResourceName(channel.channel)} workspace`}- </p>- <p className="text-muted-foreground truncate text-xs">- {displayResourceName(channel.channel)}- {' · '}- {channel.alias}- {' · '}- {consumers.join(', ')}- </p>- </div>- <StatusBadge status={channel.status} />- {projectId ? (- <Button asChild variant="ghost" size="sm">- <Link- to={`/projects/${encodeURIComponent(projectId)}/${tab}?environment=${channel.alias}`}- aria-label={`Open in project ${tabLabel}`}- >- {tabLabel} <ArrowUpRight />- </Link>- </Button>- ) : null}- </PanelContent>- </Panel>- )- })}- </div>- ) : (- <Panel>- <PanelContent className="flex min-h-40 flex-col items-center justify-center text-center">- <div className="bg-muted text-muted-foreground mb-3 flex size-10 items-center justify-center rounded-full">- <Radio className="size-4" aria-hidden />- </div>- <p className="text-sm font-medium">No channels yet</p>- <p className="text-muted-foreground mt-1 max-w-sm text-sm">- Deploy an agent, then connect Slack from its project’s Connections- tab.- </p>- </PanelContent>- </Panel>- )}- </div>- )-}diff --git a/web/src/managed-agents/Detail.tsx b/web/src/managed-agents/Detail.tsxindex 28ba1b5a..86109720 100644--- a/web/src/managed-agents/Detail.tsx+++ b/web/src/managed-agents/Detail.tsx@@ -51,7 +51,6 @@ import {displayManagedAgentName,getManagedAgentDeployment,getManagedAgentDeployments,- getManagedAgentChannels,getManagedAgentSession,getManagedAgentSessionEvents,getManagedAgents,@@ -78,9 +77,6 @@ import {} from './session-history'import { ManagedProjectSecrets } from './Secrets'import { ManagedProjectSlack } from './Slack'-import { ManagedSlackWizard } from './SlackWizard'-import { ManagedTwilioWizard } from './TwilioWizard'-import { ManagedAgentOutboxes } from './Outboxes'import { ManagedAgentSchedules } from './Schedules'import { ManagedAgentWebhooks } from './Webhooks'import { ManagedProjectMemory } from './Memory'@@ -97,8 +93,6 @@ type DetailTab =| 'playground'| 'deployments'| 'sessions'- | 'channels'- | 'outboxes'| 'schedules'| 'webhooks'| 'memory'@@ -112,8 +106,6 @@ export const PROJECT_DETAIL_TABS = new Set<DetailTab>(['playground','deployments','sessions',- 'channels',- 'outboxes','schedules','webhooks','memory',@@ -650,10 +642,6 @@ export default function ManagedAgentDetail({enabled: Boolean(projectId),refetchInterval: 5_000,})- const channels = useQuery({- queryKey: ['managed-agent-channels'],- queryFn: getManagedAgentChannels,- })const environmentSessions = project? sessionsForEnvironment(sessions.data ?? [],@@ -717,20 +705,6 @@ export default function ManagedAgentDetail({selectedPlaygroundId && selectedPlaygroundId !== adoptedPlaygroundId? selectedPlaygroundId: newSessionKey- const activeAliasChannels = (channels.data ?? []).filter(- (channel) =>- channel.agentId === agentId &&- channel.alias === (activeDeployment.data?.alias ?? agent?.activeAlias) &&- channel.status !== 'disconnected',- )- const activeAliasChannel = activeAliasChannels[0]- const declaredChannels =- activeDeployment.data?.projectDeployment?.resources.channels ?? []- // Slack apps are set up on Connections; the wizard points there when a- // manual completion is blocked by an automated setup.- const connectionsHref = project- ? `/projects/${encodeURIComponent(project.project.id)}/connections?environment=${environment}`- : undefinedconst sessionColumns: Column<ManagedAgentSessionSummary>[] = [{@@ -823,8 +797,6 @@ export default function ManagedAgentDetail({{ id: 'playground', label: project ? 'Debug playground' : 'Playground' },{ id: 'deployments', label: 'Deployments' },{ id: 'sessions', label: 'Sessions' },- { id: 'channels', label: 'Channels' },- ...(project ? ([{ id: 'outboxes', label: 'Outboxes' }] as const) : []),...(project ? ([{ id: 'schedules', label: 'Schedules' }] as const) : []),...(project ? ([{ id: 'webhooks', label: 'Webhooks' }] as const) : []),...(project ? ([{ id: 'memory', label: 'Memory' }] as const) : []),@@ -974,14 +946,6 @@ export default function ManagedAgentDetail({</nav><div className="text-muted-foreground hidden gap-5 pb-3 text-xs lg:flex"><span>{agent?.deploymentCount ?? 0} deployments</span>- <span>- {- activeAliasChannels.filter(- (channel) => channel.status === 'connected',- ).length- }{' '}- channels- </span></div></div>) : null}@@ -1225,88 +1189,6 @@ export default function ManagedAgentDetail({</Panel>) : null}- {activeTab === 'channels' ? (- <Panel className="overflow-hidden">- <PanelHeader>- <div>- <PanelTitle>Channels</PanelTitle>- <PanelDescription className="mt-1">- Messaging channels connected to this deployed agent.- </PanelDescription>- </div>- {project ? (- // Slack apps are created and installed from Connections; this- // tab keeps routing, destinations and delivery.- <Button asChild variant="outline" size="sm">- <Link- to={`/projects/${encodeURIComponent(project.project.id)}/connections?environment=${environment}`}- >- Slack setup in Connections- </Link>- </Button>- ) : null}- </PanelHeader>- {agent && activeDeployment.data ? (- declaredChannels.length ? (- // The wizard follows the channel's declared provider: Slack has- // an app to install, Twilio has credentials to paste and a- // number to point here. Nothing about connecting one resembles- // connecting the other.- declaredChannels.map((declaredChannel) =>- declaredChannel.type === 'twilio' ? (- <ManagedTwilioWizard- key={declaredChannel.id}- agentId={agent.id}- alias={activeDeployment.data.alias}- connection={activeAliasChannels.find(- (channel) => channel.channelId === declaredChannel.id,- )}- channelId={declaredChannel.id}- />- ) : (- <ManagedSlackWizard- key={declaredChannel.id}- agentId={agent.id}- alias={activeDeployment.data.alias}- agentName={displayManagedAgentName(agent)}- channelName={- declaredChannel.displayName ?? declaredChannel.id- }- connection={activeAliasChannels.find(- (channel) => channel.channelId === declaredChannel.id,- )}- channelId={declaredChannel.id}- destinations={Object.keys(declaredChannel.destinations)}- connectionsHref={connectionsHref}- />- ),- )- ) : (- <ManagedSlackWizard- agentId={agent.id}- alias={activeDeployment.data.alias}- agentName={displayManagedAgentName(agent)}- connection={activeAliasChannel}- connectionsHref={connectionsHref}- />- )- ) : (- <PanelContent className="text-muted-foreground text-sm">- Loading channels…- </PanelContent>- )}- </Panel>- ) : null}-- {activeTab === 'outboxes' && project && agent ? (- <ManagedAgentOutboxes- projectId={project.project.id}- agentId={agent.id}- environment={environment}- deployed={Boolean(projectEnvironment?.activeDeploymentId)}- />- ) : null}-{activeTab === 'schedules' && project && agent ? (<ManagedAgentSchedulesprojectId={project.project.id}diff --git a/web/src/managed-agents/Outboxes.test.ts b/web/src/managed-agents/Outboxes.test.tsdeleted file mode 100644index a09ffd99..00000000--- a/web/src/managed-agents/Outboxes.test.ts+++ /dev/null@@ -1,47 +0,0 @@-import { describe, expect, it } from 'vitest'-import type { ManagedAgentOutbox } from './api'-import { flattenOutboxDeliveries } from './Outboxes'--function route(- id: string,- items: ManagedAgentOutbox['items'],-): ManagedAgentOutbox {- return {- id,- channelId: 'team-slack',- channelName: 'Team Slack',- destination: 'pull-request-reviews',- readiness: 'ready',- items,- }-}--function item(- id: string,- createdAt: string,-): ManagedAgentOutbox['items'][number] {- return {- id,- outboxId: 'reviews',- eventType: 'pull_request.created',- contentPreview: { title: id },- status: 'delivered',- attemptCount: 1,- createdAt,- updatedAt: createdAt,- }-}--describe('flattenOutboxDeliveries', () => {- it('orders publications across routes by newest first', () => {- const deliveries = flattenOutboxDeliveries([- route('reviews', [item('older', '2026-08-15T10:00:00.000Z')]),- route('personal', [item('newer', '2026-08-15T11:00:00.000Z')]),- ])-- expect(deliveries.map(({ item: delivery }) => delivery.id)).toEqual([- 'newer',- 'older',- ])- })-})diff --git a/web/src/managed-agents/Outboxes.tsx b/web/src/managed-agents/Outboxes.tsxdeleted file mode 100644index 3f6cfcbd..00000000--- a/web/src/managed-agents/Outboxes.tsx+++ /dev/null@@ -1,418 +0,0 @@-import { useState, type ReactNode } from 'react'-import { useQuery } from '@tanstack/react-query'-import { Send } from 'lucide-react'-import { Link } from 'react-router-dom'-import { EmptyState } from '@/components/empty-state'-import {- Panel,- PanelContent,- PanelDescription,- PanelHeader,- PanelTitle,-} from '@/components/panel'-import { ResourceTable, type Column } from '@/components/resource-table'-import { StatusBadge } from '@/components/status-badge'-import {- Dialog,- DialogContent,- DialogDescription,- DialogHeader,- DialogTitle,-} from '@/components/ui/dialog'-import { getManagedAgentOutboxes, type ManagedAgentOutbox } from './api'-import { projectContextSearch } from './project-context'--function formatDate(value: string) {- return new Date(value).toLocaleString()-}--function safeExternalUrl(value?: string) {- if (!value) return undefined- try {- const url = new URL(value)- return url.protocol === 'https:' || url.protocol === 'http:'- ? url.toString()- : undefined- } catch {- return undefined- }-}--function readinessMeta(readiness: ManagedAgentOutbox['readiness']) {- return readiness === 'ready'- ? { status: 'ready', label: 'Ready' }- : readiness === 'channel_not_connected'- ? { status: 'unavailable', label: 'Connect channel' }- : { status: 'unavailable', label: 'Map destination' }-}--export type OutboxDelivery = {- outbox: ManagedAgentOutbox- item: ManagedAgentOutbox['items'][number]-}--export function flattenOutboxDeliveries(outboxes: ManagedAgentOutbox[]) {- return outboxes- .flatMap((outbox) => outbox.items.map((item) => ({ outbox, item })))- .sort((left, right) =>- right.item.createdAt.localeCompare(left.item.createdAt),- )-}--function DetailField({- label,- children,-}: {- label: string- children: ReactNode-}) {- return (- <div>- <dt className="text-muted-foreground text-xs font-medium tracking-wide uppercase">- {label}- </dt>- <dd className="mt-1 text-sm">{children}</dd>- </div>- )-}--export function ManagedAgentOutboxes({- projectId,- agentId,- environment,- deployed,-}: {- projectId: string- agentId: string- environment: 'development' | 'production'- deployed: boolean-}) {- const [selectedItemId, setSelectedItemId] = useState<string>()- const outboxes = useQuery({- queryKey: ['managed-agent-outboxes', agentId, environment],- queryFn: () => getManagedAgentOutboxes(agentId, environment),- enabled: deployed,- refetchInterval: 3_000,- })-- if (!deployed) {- return (- <Panel>- <EmptyState- icon={Send}- title={`No active ${environment} deployment`}- description="Deploy this project to the environment before publishing outbox items."- />- </Panel>- )- }-- if (outboxes.isError) {- return (- <Panel>- <EmptyState- icon={Send}- title="Outboxes are temporarily unavailable"- description="Try loading this environment again."- />- </Panel>- )- }-- if (outboxes.isLoading) {- return (- <Panel>- <PanelContent className="text-muted-foreground py-8 text-sm">- Loading outboxes…- </PanelContent>- </Panel>- )- }-- if (!outboxes.data?.outboxes.length) {- return (- <Panel>- <EmptyState- icon={Send}- title={`No ${environment} outboxes`}- description="Register an outbox for this agent and deploy it to this environment."- />- </Panel>- )- }-- const routes = outboxes.data.outboxes- const deliveries = flattenOutboxDeliveries(routes)- const selected = deliveries.find(({ item }) => item.id === selectedItemId)-- const routeColumns: Column<ManagedAgentOutbox>[] = [- {- key: 'outbox',- header: 'Outbox',- cell: (outbox) => (- <span className="text-sm font-medium">{outbox.id}</span>- ),- },- {- key: 'route',- header: 'Route',- cell: (outbox) => (- <span className="text-muted-foreground text-xs">- {outbox.channelName} → {outbox.destination}- {outbox.targetDisplayName ? ` → ${outbox.targetDisplayName}` : ''}- </span>- ),- },- {- key: 'readiness',- header: 'Readiness',- align: 'right',- cell: (outbox) => {- const readiness = readinessMeta(outbox.readiness)- return <StatusBadge status={readiness.status} label={readiness.label} />- },- },- ]-- const deliveryColumns: Column<OutboxDelivery>[] = [- {- key: 'message',- header: 'Message',- cell: ({ item }) => (- <div className="max-w-80">- <p className="truncate text-sm font-medium">- {item.contentPreview.title || item.contentPreview.body || 'Message'}- </p>- {item.contentPreview.title && item.contentPreview.body ? (- <p className="text-muted-foreground mt-1 truncate text-xs">- {item.contentPreview.body}- </p>- ) : null}- </div>- ),- },- {- key: 'route',- header: 'Route',- cell: ({ outbox }) => {- const readiness = readinessMeta(outbox.readiness)- return (- <div className="space-y-1">- <p className="text-xs font-medium">{outbox.id}</p>- <StatusBadge status={readiness.status} label={readiness.label} />- </div>- )- },- },- {- key: 'session',- header: 'Session',- cell: ({ item }) =>- item.sessionId ? (- <Link- className="font-mono text-xs underline underline-offset-2"- onClick={(event) => event.stopPropagation()}- to={{- pathname: `/projects/${encodeURIComponent(projectId)}/sessions/${encodeURIComponent(item.sessionId)}`,- search: projectContextSearch('', agentId, environment),- }}- >- {item.sessionId.slice(0, 12)}…- </Link>- ) : (- <span className="text-muted-foreground text-xs">Not recorded</span>- ),- },- {- key: 'delivery',- header: 'Delivery',- cell: ({ item }) => (- <div className="space-y-1">- <StatusBadge status={item.status} />- <p className="text-muted-foreground text-[11px]">- {item.attemptCount}{' '}- {item.attemptCount === 1 ? 'attempt' : 'attempts'}- </p>- </div>- ),- },- {- key: 'published',- header: 'Published',- align: 'right',- cell: ({ item }) => (- <time- className="text-muted-foreground text-xs"- dateTime={item.createdAt}- >- {formatDate(item.createdAt)}- </time>- ),- },- ]-- const selectedUrl = safeExternalUrl(selected?.item.contentPreview.url)- const selectedReadiness = selected- ? readinessMeta(selected.outbox.readiness)- : undefined-- return (- <div className="space-y-4">- <Panel className="overflow-hidden">- <PanelHeader className="py-3">- <div>- <PanelTitle>Configured routes</PanelTitle>- <PanelDescription className="mt-1">- Delivery readiness for this {environment} environment.- </PanelDescription>- </div>- </PanelHeader>- <ResourceTable- columns={routeColumns}- rows={routes}- rowKey={(outbox) => outbox.id}- />- </Panel>-- <Panel className="overflow-hidden">- <PanelHeader>- <div>- <PanelTitle>Publications</PanelTitle>- <PanelDescription className="mt-1">- Most recent deliveries across all outboxes in this environment.- </PanelDescription>- </div>- </PanelHeader>- <ResourceTable- columns={deliveryColumns}- rows={deliveries}- rowKey={({ item }) => item.id}- onRowClick={({ item }) => setSelectedItemId(item.id)}- empty={- <EmptyState- title="No publications in this environment"- description="New outbox items will appear here automatically."- className="py-9"- />- }- />- </Panel>-- <Dialog- open={Boolean(selected)}- onOpenChange={(open) => {- if (!open) setSelectedItemId(undefined)- }}- >- <DialogContent className="sm:max-w-2xl">- {selected ? (- <>- <DialogHeader>- <DialogTitle>- {selected.item.contentPreview.title || 'Outbox publication'}- </DialogTitle>- <DialogDescription>- Delivery and provenance for this publication.- </DialogDescription>- </DialogHeader>-- {selected.item.contentPreview.body ? (- <p className="bg-muted/40 max-h-56 overflow-y-auto rounded-md border p-3 text-sm whitespace-pre-wrap">- {selected.item.contentPreview.body}- </p>- ) : null}- {selectedUrl ? (- <a- href={selectedUrl}- target="_blank"- rel="noreferrer"- className="text-sm break-all underline underline-offset-2"- >- {selectedUrl}- </a>- ) : null}-- <dl className="grid grid-cols-1 gap-x-6 gap-y-4 border-t pt-4 sm:grid-cols-2">- <DetailField label="Delivery">- <span className="inline-flex items-center gap-2">- <StatusBadge status={selected.item.status} />- <span className="text-muted-foreground text-xs">- {selected.item.attemptCount}{' '}- {selected.item.attemptCount === 1- ? 'attempt'- : 'attempts'}- </span>- </span>- </DetailField>- <DetailField label="Route readiness">- <StatusBadge- status={selectedReadiness!.status}- label={selectedReadiness!.label}- />- </DetailField>- <DetailField label="Outbox">- <span className="font-mono text-xs">- {selected.outbox.id}- </span>- </DetailField>- <DetailField label="Event">- <span className="font-mono text-xs">- {selected.item.eventType}- </span>- </DetailField>- <DetailField label="Route">- <span className="text-xs">- {selected.outbox.channelName} ({selected.outbox.channelId})- → {selected.outbox.destination}- {selected.outbox.targetDisplayName- ? ` → ${selected.outbox.targetDisplayName}`- : ''}- </span>- </DetailField>- <DetailField label="Session">- {selected.item.sessionId ? (- <Link- className="font-mono text-xs break-all underline underline-offset-2"- to={{- pathname: `/projects/${encodeURIComponent(projectId)}/sessions/${encodeURIComponent(selected.item.sessionId)}`,- search: projectContextSearch('', agentId, environment),- }}- >- {selected.item.sessionId}- </Link>- ) : (- <span className="text-muted-foreground text-xs">- Not recorded for this historical item- </span>- )}- </DetailField>- <DetailField label="Published">- <time dateTime={selected.item.createdAt}>- {formatDate(selected.item.createdAt)}- </time>- </DetailField>- <DetailField label="Last updated">- <time dateTime={selected.item.updatedAt}>- {formatDate(selected.item.updatedAt)}- </time>- </DetailField>- <DetailField label="Publication ID">- <span className="font-mono text-xs break-all">- {selected.item.id}- </span>- </DetailField>- {selected.item.error ? (- <DetailField label="Failure">- <span className="text-status-error text-xs">- {selected.item.error}- </span>- </DetailField>- ) : null}- </dl>- </>- ) : null}- </DialogContent>- </Dialog>- </div>- )-}diff --git a/web/src/managed-agents/TwilioWizard.test.ts b/web/src/managed-agents/TwilioWizard.test.tsdeleted file mode 100644index ae876895..00000000--- a/web/src/managed-agents/TwilioWizard.test.ts+++ /dev/null@@ -1,50 +0,0 @@-import { describe, expect, it } from 'vitest'-import { z } from 'zod'--/**- * The declared-channel schema is what decides which wizard a customer sees.- * Slack has an app to install; Twilio has credentials to paste and a number to- * point here. Getting the discriminator wrong shows the wrong form entirely.- */-const declaredChannel = z.object({- id: z.string(),- type: z.enum(['slack', 'twilio', 'email']),- displayName: z.string().optional(),- destinations: z.record(- z.string(),- z.object({- type: z.enum(['conversation', 'reply']),- visibility: z.enum(['public', 'private']).optional(),- }),- ),-})--describe('declared channels drive the connect flow', () => {- it('accepts a Twilio channel, which has no scopes and no visibility', () => {- const parsed = declaredChannel.parse({- id: 'shop-sms',- type: 'twilio',- destinations: { reply: { type: 'reply' } },- })- expect(parsed.type).toBe('twilio')- expect(parsed.destinations.reply?.visibility).toBeUndefined()- })-- it('still accepts a Slack channel with a public conversation', () => {- const parsed = declaredChannel.parse({- id: 'team-slack',- type: 'slack',- displayName: 'Engineering',- destinations: {- 'pull-request-reviews': { type: 'conversation', visibility: 'public' },- },- })- expect(parsed.destinations['pull-request-reviews']?.visibility).toBe('public')- })-- it('refuses a provider the dashboard has no flow for', () => {- expect(() =>- declaredChannel.parse({ id: 'x', type: 'carrier-pigeon', destinations: {} }),- ).toThrow()- })-})diff --git a/web/src/managed-agents/TwilioWizard.tsx b/web/src/managed-agents/TwilioWizard.tsxdeleted file mode 100644index 0abe5b0b..00000000--- a/web/src/managed-agents/TwilioWizard.tsx+++ /dev/null@@ -1,333 +0,0 @@-import { useState } from 'react'-import { useMutation, useQueryClient } from '@tanstack/react-query'-import { Check, LoaderCircle, Phone, TriangleAlert } from 'lucide-react'-import { ConfirmDialog } from '@/components/confirm-dialog'-import { Field, Input } from '@/components/form'-import {- Dialog,- DialogContent,- DialogDescription,- DialogFooter,- DialogHeader,- DialogTitle,-} from '@/components/ui/dialog'-import { Button } from '@/components/ui/button'-import { StatusBadge } from '@/components/status-badge'-import { notifyError, notifySuccess } from '@/lib/errors'-import { cn } from '@/lib/utils'-import {- completeManagedAgentTwilio,- disconnectManagedAgentTwilio,- startManagedAgentTwilio,- type ManagedAgentChannel,- type ManagedTwilioSetup,-} from './api'--type Step = 'credentials' | 'number' | 'forwarding'-const STEPS = ['Credentials', 'Choose a number', 'Forward your line']--function WizardSteps({ current }: { current: number }) {- return (- <ol className="flex items-center gap-2 pt-2">- {STEPS.map((label, index) => (- <li key={label} className="flex min-w-0 items-center gap-2">- <span- className={cn(- 'flex size-5 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold',- index <= current- ? 'bg-foreground text-background'- : 'bg-secondary text-muted-foreground',- )}- >- {index < current ? <Check className="size-3" /> : index + 1}- </span>- <span- className={cn(- 'truncate text-xs',- index === current- ? 'text-foreground font-medium'- : 'text-muted-foreground',- )}- >- {label}- </span>- {index < STEPS.length - 1 ? (- <span className="bg-border h-px w-4 shrink-0" />- ) : null}- </li>- ))}- </ol>- )-}--export function ManagedTwilioWizard({- agentId,- alias,- connection,- channelId,-}: {- agentId: string- alias: string- connection?: ManagedAgentChannel- channelId?: string-}) {- const queryClient = useQueryClient()- const [open, setOpen] = useState(false)- const [step, setStep] = useState<Step>('credentials')- const [accountSid, setAccountSid] = useState('')- const [authToken, setAuthToken] = useState('')- const [setup, setSetup] = useState<ManagedTwilioSetup>()- const [numberSid, setNumberSid] = useState('')- const [connectedNumber, setConnectedNumber] = useState('')- const [confirmDisconnect, setConfirmDisconnect] = useState(false)-- const invalidate = () =>- queryClient.invalidateQueries({ queryKey: ['managed-agent-channels'] })-- const start = useMutation({- mutationFn: () =>- startManagedAgentTwilio(`${agentId}@${alias}`, {- accountSid: accountSid.trim(),- authToken: authToken.trim(),- ...(channelId ? { channelId } : {}),- }),- onSuccess: (result) => {- setSetup(result)- // Clear the token as soon as it has been exchanged; the browser has no- // further use for it.- setAuthToken('')- setNumberSid(result.numbers[0]?.sid ?? '')- setStep('number')- void invalidate()- },- onError: (error) =>- notifyError('Twilio did not accept those credentials.', error),- })-- const complete = useMutation({- mutationFn: () => {- const chosen = setup?.numbers.find((number) => number.sid === numberSid)- if (!setup || !chosen) throw new Error('Choose a number to continue')- return completeManagedAgentTwilio(setup.connection.id, {- numberSid: chosen.sid,- phoneNumber: chosen.phoneNumber,- webhookToken: setup.webhookToken,- })- },- onSuccess: (result) => {- setConnectedNumber(result.connection.phoneNumber ?? '')- setStep('forwarding')- notifySuccess('Twilio is connected.')- void invalidate()- },- onError: (error) =>- notifyError("Twilio wouldn't accept the webhook setup.", error),- })-- const disconnect = useMutation({- mutationFn: () => disconnectManagedAgentTwilio(connection!.id),- onSuccess: () => {- setConfirmDisconnect(false)- void invalidate()- },- onError: (error) => notifyError("Couldn't disconnect Twilio.", error),- })-- const begin = () => {- setStep('credentials')- setAccountSid('')- setAuthToken('')- setSetup(undefined)- setNumberSid('')- setConnectedNumber('')- setOpen(true)- }-- const isConnected = connection?.status === 'connected'-- return (- <>- <div className="flex items-center gap-2">- {isConnected ? (- <>- <StatusBadge status="active" label="Connected" />- <Button- variant="outline"- size="sm"- onClick={() => setConfirmDisconnect(true)}- >- Disconnect- </Button>- </>- ) : (- <Button size="sm" onClick={begin}>- <Phone className="size-4" />- Connect Twilio- </Button>- )}- </div>-- <Dialog open={open} onOpenChange={setOpen}>- <DialogContent className="sm:max-w-lg">- <DialogHeader>- <DialogTitle>Connect Twilio</DialogTitle>- <DialogDescription>- Calls and texts to a Twilio number reach this agent.- </DialogDescription>- <WizardSteps current={STEPS.indexOf(- step === 'credentials'- ? 'Credentials'- : step === 'number'- ? 'Choose a number'- : 'Forward your line',- )} />- </DialogHeader>-- {step === 'credentials' ? (- <div className="space-y-4">- <p className="text-muted-foreground text-sm">- Both values are on your Twilio console dashboard. We check them- with Twilio before storing anything.- </p>- <Field label="Account SID">- <Input- value={accountSid}- onChange={(event) => setAccountSid(event.target.value)}- placeholder="AC…"- autoComplete="off"- />- </Field>- <Field label="Auth token">- <Input- type="password"- value={authToken}- onChange={(event) => setAuthToken(event.target.value)}- placeholder="Your Twilio auth token"- autoComplete="off"- />- </Field>- <DialogFooter>- <Button- onClick={() => start.mutate()}- disabled={- start.isPending || !accountSid.trim() || !authToken.trim()- }- >- {start.isPending ? (- <LoaderCircle className="size-4 animate-spin" />- ) : null}- Continue- </Button>- </DialogFooter>- </div>- ) : null}-- {step === 'number' && setup ? (- <div className="space-y-4">- <p className="text-muted-foreground text-sm">- Connected to{' '}- <span className="text-foreground font-medium">- {setup.account.friendlyName}- </span>- . Choose the number this agent should answer. We'll point it at- OpenComputer for you.- </p>- {setup.numbers.length === 0 ? (- <div className="flex items-start gap-2 rounded-md border p-3 text-sm">- <TriangleAlert className="text-muted-foreground mt-0.5 size-4 shrink-0" />- <p>- This account has no number that can take both calls and- texts. Buy one in Twilio, then come back — a number without- voice can't catch a missed call.- </p>- </div>- ) : (- <div className="space-y-2">- {setup.numbers.map((number) => (- <label- key={number.sid}- className={cn(- 'flex cursor-pointer items-center gap-3 rounded-md border p-3 text-sm',- numberSid === number.sid- ? 'border-foreground'- : 'border-border',- )}- >- <input- type="radio"- name="twilio-number"- value={number.sid}- checked={numberSid === number.sid}- onChange={() => setNumberSid(number.sid)}- />- <span className="min-w-0">- <span className="block font-medium">- {number.phoneNumber}- </span>- <span className="text-muted-foreground block truncate text-xs">- {number.friendlyName}- </span>- </span>- </label>- ))}- </div>- )}- <DialogFooter>- <Button- onClick={() => complete.mutate()}- disabled={complete.isPending || !numberSid}- >- {complete.isPending ? (- <LoaderCircle className="size-4 animate-spin" />- ) : null}- Connect this number- </Button>- </DialogFooter>- </div>- ) : null}-- {step === 'forwarding' ? (- <div className="space-y-4">- <div className="flex items-start gap-2 rounded-md border p-3 text-sm">- <Check className="mt-0.5 size-4 shrink-0" />- <p>- <span className="font-medium">{connectedNumber}</span> now- reaches this agent. Texts to it start a conversation, and- calls take a voicemail the agent reads.- </p>- </div>- <div className="space-y-2 text-sm">- <p className="font-medium">- One last step, on your existing business line- </p>- <p className="text-muted-foreground">- Set busy and no-answer forwarding to {connectedNumber}. On- most carriers that is a code you dial once from the phone- itself, or a single setting if the line is VoIP. Calls you- answer are unaffected — only the ones you miss come here.- </p>- <p className="text-muted-foreground">- This replaces your carrier's voicemail with one the agent can- act on, so keep your greeting in mind before you switch it.- </p>- </div>- <DialogFooter>- <Button onClick={() => setOpen(false)}>Done</Button>- </DialogFooter>- </div>- ) : null}- </DialogContent>- </Dialog>-- <ConfirmDialog- open={confirmDisconnect}- onOpenChange={setConfirmDisconnect}- title="Disconnect Twilio?"- description="Calls and texts to this number stop reaching the agent. Your Twilio number and its history are untouched, and the forwarding on your business line stays until you remove it."- confirmLabel="Disconnect"- onConfirm={() => disconnect.mutate()}- pending={disconnect.isPending}- />- </>- )-}diff --git a/web/src/managed-agents/api.ts b/web/src/managed-agents/api.tsindex 9eb17c48..b0d46372 100644--- a/web/src/managed-agents/api.ts+++ b/web/src/managed-agents/api.ts@@ -474,45 +474,6 @@ const channelsResponseSchema = z.object({channels: z.array(channelSchema),})-const outboxItemSchema = z.object({- id: z.string(),- outboxId: z.string(),- eventType: z.string(),- sessionId: z.string().optional(),- contentPreview: z.object({- title: z.string().optional(),- body: z.string().optional(),- url: z.string().optional(),- }),- status: z.string(),- destination: z.string().optional(),- attemptCount: z.number(),- error: z.string().optional(),- createdAt: z.string(),- updatedAt: z.string(),-})--const outboxSchema = z.object({- id: z.string(),- channelId: z.string(),- channelName: z.string(),- destination: z.string(),- readiness: z.enum([- 'ready',- 'channel_not_connected',- 'destination_not_bound',- ]),- targetDisplayName: z.string().optional(),- items: z.array(outboxItemSchema),-})--const outboxesResponseSchema = z.object({- agentId: z.string(),- environment: z.enum(['development', 'production']),- deploymentId: z.string(),- outboxes: z.array(outboxSchema),-})-const scheduleSchema = z.object({id: z.string(),projectId: z.string(),@@ -823,8 +784,6 @@ export type ManagedMemoryDocumentRead = {}export type ManagedAgentConnection = z.infer<typeof connectionSchema>export type ManagedAgentChannel = z.infer<typeof channelSchema>-export type ManagedAgentOutbox = z.infer<typeof outboxSchema>-export type ManagedAgentOutboxItem = z.infer<typeof outboxItemSchema>export type ManagedAgentSchedule = z.infer<typeof scheduleSchema>export type ManagedAgentScheduleRun = z.infer<typeof scheduleRunSchema>export type ManagedAgentWebhook = z.infer<typeof webhookSchema>@@ -1367,18 +1326,6 @@ export async function getManagedAgentChannels() {).channels}-export async function getManagedAgentOutboxes(- agentId: string,- environment: 'development' | 'production',-) {- const query = new URLSearchParams({ agentId, environment })- return apiFetch(- `/managed-agents/outboxes?${query.toString()}`,- undefined,- outboxesResponseSchema,- )-}-export async function getManagedAgentSchedules(projectId: string,agentId: string,@@ -1619,74 +1566,6 @@ export async function cancelManagedSlackSetup(setupId: string) {).setup}-const twilioNumberSchema = z.object({- sid: z.string(),- phoneNumber: z.string(),- friendlyName: z.string(),- capabilities: z.object({ sms: z.boolean(), voice: z.boolean() }),-})--const twilioSetupSchema = z.object({- connection: z.object({- id: z.string(),- provider: z.string(),- status: z.string(),- }),- account: z.object({ sid: z.string(), friendlyName: z.string() }),- numbers: z.array(twilioNumberSchema),- // Shown once, held only in the browser between the two steps, and never- // stored: it is half of what authenticates the webhook.- webhookToken: z.string(),-})--const twilioConnectionSchema = z.object({- connection: z.object({- id: z.string(),- provider: z.string().optional(),- status: z.string(),- phoneNumber: z.string().optional(),- }),-})--export type ManagedTwilioNumber = z.infer<typeof twilioNumberSchema>-export type ManagedTwilioSetup = z.infer<typeof twilioSetupSchema>--/**- * Step one. The credentials are checked against Twilio before anything is- * stored, so a mistyped SID comes back as a message rather than a broken- * connection nobody can see is broken.- */-export async function startManagedAgentTwilio(- agentId: string,- input: { accountSid: string; authToken: string; channelId?: string },-) {- return apiFetch(- '/managed-agents/channels/twilio/connections',- { method: 'POST', body: JSON.stringify({ agentId, ...input }) },- twilioSetupSchema,- )-}--/** Step two. Points the chosen number at OpenComputer and opens the line. */-export async function completeManagedAgentTwilio(- connectionId: string,- input: { numberSid: string; phoneNumber: string; webhookToken: string },-) {- return apiFetch(- `/managed-agents/channels/twilio/connections/${encodeURIComponent(connectionId)}`,- { method: 'PUT', body: JSON.stringify(input) },- twilioConnectionSchema,- )-}--export async function disconnectManagedAgentTwilio(connectionId: string) {- return apiFetch(- `/managed-agents/channels/twilio/connections/${encodeURIComponent(connectionId)}`,- { method: 'DELETE' },- twilioConnectionSchema,- )-}-export async function disconnectManagedAgentSlack(connectionId: string) {return apiFetch(`/managed-agents/channels/slack/connections/${encodeURIComponent(connectionId)}`,diff --git a/web/src/managed-agents/templates.test.ts b/web/src/managed-agents/templates.test.tsindex e45f939f..899fb0e2 100644--- a/web/src/managed-agents/templates.test.ts+++ b/web/src/managed-agents/templates.test.ts@@ -30,7 +30,6 @@ describe('project creation templates', () => {expect(CURATED_TEMPLATES.map((template) => template.name)).toEqual(['Pull Request Reviewer','Test Coverage',- 'GitHub Actions Triage','Feature Flag Hygiene','GTM Engineer',])diff --git a/web/src/managed-agents/templates.ts b/web/src/managed-agents/templates.tsindex 723c7a9a..401730cb 100644--- a/web/src/managed-agents/templates.ts+++ b/web/src/managed-agents/templates.ts@@ -14,12 +14,6 @@ export const CURATED_TEMPLATES = [repositoryUrl:'https://github.com/diggerhq/opencomputer-example-test-coverage',},- {- name: 'GitHub Actions Triage',- description: 'Investigate failed CI runs and explain the likely fix.',- repositoryUrl:- 'https://github.com/diggerhq/opencomputer-example-actions-triage',- },{name: 'Feature Flag Hygiene',description: 'Audit stale feature flags across GitHub and Unleash.',