Skip to content

feat(relay): add messenger command surfaces#56

Merged
zikolach merged 7 commits into
mainfrom
feat/messenger-command-surfaces
May 15, 2026
Merged

feat(relay): add messenger command surfaces#56
zikolach merged 7 commits into
mainfrom
feat/messenger-command-surfaces

Conversation

@zikolach
Copy link
Copy Markdown
Owner

@zikolach zikolach commented May 15, 2026

Summary

  • derive Telegram/Discord/Slack command surfaces from the canonical remote command registry
  • register Telegram bot menu commands and best-effort Discord /relay native commands without overwriting unrelated app commands
  • add Slack /relay slash-command manifest/routing while unifying text commands on relay ...
  • intentionally remove the older Slack pirelay ... text prefix; update external playbooks to relay ...
  • update setup/docs/OpenSpec tasks and add command-surface parity tests

Validation

  • npm run typecheck
  • npm test
  • openspec validate add-messenger-command-surfaces --strict

Copilot AI review requested due to automatic review settings May 15, 2026 14:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a registry-driven command-surface layer that lets the canonical PiRelay remote command set drive (a) Telegram BotCommand menu registration, (b) a best-effort Discord native /relay application command with subcommands, and (c) a Slack /relay slash-command surface (manifest entry + Socket Mode/webhook envelope handling). It also unifies all messenger text-command prefixes on relay …, dropping the legacy pirelay prefix in parsers, pairing helpers, error/help text, and docs.

Changes:

  • New extensions/relay/commands/surfaces.ts plus canonicalRemoteCommandName and a sendimage alias in commands/remote.ts; Telegram API gains setBotCommands, runtime registers menu after setup with non-fatal failure handling.
  • Discord live-client adds discordRelayApplicationCommandData and best-effort global command sync; Slack adapter adds slash_command envelope type, form/Socket-Mode parsing, slackSlashCommandMetadata, and routes responses through response_url when present. Slack manifest snippet gains /relay.
  • Wide rename from pirelay … to relay … across runtimes, pairing parsers, setup/wizard text, README, docs, OpenSpec specs/tasks, Slack live manifests, and tests; new command-surfaces parity test file.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
extensions/relay/commands/remote.ts Adds sendimage alias and canonicalRemoteCommandName; routes parsers through canonicalization.
extensions/relay/commands/surfaces.ts New module deriving Telegram/Discord/Slack command metadata from canonical registry.
extensions/relay/adapters/telegram/api.ts Adds setBotCommands API wrapper.
extensions/relay/adapters/telegram/runtime.ts Registers Telegram bot menu on startup; drops pirelay prefix.
extensions/relay/adapters/discord/live-client.ts Adds /relay application command data + best-effort sync; nested option flattening.
extensions/relay/adapters/discord/runtime.ts Drops pirelay prefix in command/pairing parsing.
extensions/relay/adapters/slack/adapter.ts Adds slash_command envelope, form/socket parsing, /relay metadata, slash→message normalization; pairing command renamed.
extensions/relay/adapters/slack/live-client.ts Adds Socket Mode slash-command envelope conversion.
extensions/relay/adapters/slack/runtime.ts Renames help/usage strings to relay; reroutes sendText through response_url when available.
extensions/relay/adapters/channel-pairing.ts Slack pairing legacy forms now relay//relay.
extensions/relay/notifications/lifecycle.ts Lifecycle disconnect text updated to relay pair.
extensions/relay/config/setup.ts, setup-wizard.ts Setup guidance, manifest snippet, Slack/Discord wizard copy updated; manifest gains /relay entry.
extensions/relay/runtime/extension-runtime.ts Slack pairing command in TUI updated to relay pair.
README.md, docs/{adapters,config,testing,slack-live-integration}.md Doc updates for new surfaces and prefix unification; state dir renamed to ~/.pi/agent/relay.
docs/slack-app-manifests/pirelay-live-bot-{a,b}.yaml Add /relay slash-command entries.
openspec/changes/add-messenger-command-surfaces/* Proposal/design/specs/tasks for the new capability and tasks marked complete.
tests/* (slack/telegram/discord/runtime/integration/relay/{setup-wizard,lifecycle,remote-command-parity,command-surfaces}) Update prefix expectations and add new parity, slash-command, and Telegram menu tests.
Comments suppressed due to low confidence (2)

README.md:269

  • After the rename the Discord and Slack columns of this command table contain the exact same string for every row (e.g. relay status / relay status, relay sessions / relay sessions, etc.). Either collapse the two columns into a single "Discord/Slack (text)" column, or differentiate them (e.g. native /relay status for Slack/Discord) so the table still carries information. As written, the table looks like a copy-paste mistake and obscures the new native /relay surfaces this PR introduces.
| help | `/help` (also Telegram menu) | `relay help` or best-effort `/relay help` | `relay help` or installed `/relay help` |
| status dashboard | `/status` | `relay status` | `relay status` |
| list sessions | `/sessions` | `relay sessions` | `relay sessions` |
| select session | `/use <session>` | `relay use <session>` | `relay use <session>` |
| forget offline session | `/forget <session>` | `relay forget <session>` | `relay forget <session>` |
| one-shot prompt | `/to <session> <prompt>` | `relay to <session> <prompt>` | `relay to <session> <prompt>` |
| progress mode | `/progress <mode>` | `relay progress <mode>` | `relay progress <mode>` |
| current progress mode | `/progress` | `relay progress` | `relay progress` |
| alias current session | `/alias <name\|clear>` | `relay alias <name\|clear>` | `relay alias <name\|clear>` |
| recent activity | `/recent` or `/activity` | `relay recent` or `relay activity` | `relay recent` or `relay activity` |
| latest summary | `/summary` | `relay summary` | `relay summary` |
| full output | `/full` | `relay full` | `relay full` |
| latest images | `/images` | `relay images` | `relay images` |
| send workspace image | `/send-image <path>` | `relay send-image <path>` | `relay send-image <path>` |
| send safe workspace file to requester | `/send-file <path> [caption]` | `relay send-file <path> [caption]` | `relay send-file <path> [caption]` |
| steer active run | `/steer <text>` | `relay steer <text>` | `relay steer <text>` |
| queue follow-up | `/followup <text>` | `relay followup <text>` | `relay followup <text>` |
| abort current run | `/abort` | `relay abort` | `relay abort` |
| compact context | `/compact` | `relay compact` | `relay compact` |
| pause delivery | `/pause` | `relay pause` | `relay pause` |
| resume delivery | `/resume` | `relay resume` | `relay resume` |
| disconnect binding | `/disconnect` | `relay disconnect` | `relay disconnect` |

README.md:325

  • Same redundancy as the command table: the sentence repeats relay sessions/relay use/relay to twice for what used to be Discord and Slack. Consider rewording to "Use /sessions (Telegram) or relay sessions (Discord/Slack)…" to avoid the apparent typo.
Use `/sessions`, `relay sessions`, or `relay sessions` to list targets. Use `/use`, `relay use`, or `relay use` to select an active target. Use `/to`, `relay to`, or `relay to` for one-shot prompts without switching sessions.

Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread extensions/relay/adapters/slack/runtime.ts Outdated
Comment thread extensions/relay/adapters/slack/runtime.ts Outdated
Comment thread extensions/relay/adapters/discord/live-client.ts
Comment thread extensions/relay/adapters/discord/live-client.ts
Comment thread extensions/relay/adapters/discord/live-client.ts
Comment thread extensions/relay/adapters/telegram/runtime.ts
Comment thread extensions/relay/adapters/slack/adapter.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Comment thread extensions/relay/adapters/slack/runtime.ts
Comment thread extensions/relay/commands/surfaces.ts
Copilot AI review requested due to automatic review settings May 15, 2026 15:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.

Comment thread extensions/relay/adapters/slack/live-client.ts Outdated
Comment thread extensions/relay/broker/process.js
Comment thread extensions/relay/broker/process.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.

Comment thread extensions/relay/adapters/discord/live-client.ts Outdated
Comment thread extensions/relay/adapters/discord/live-client.ts Outdated
Comment thread extensions/relay/adapters/slack/runtime.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Comment thread extensions/relay/commands/surfaces.ts Outdated
Comment thread tests/slack-runtime.test.ts
Comment thread extensions/relay/commands/surfaces.ts Outdated
@zikolach zikolach merged commit 7acd501 into main May 15, 2026
2 checks passed
@zikolach zikolach deleted the feat/messenger-command-surfaces branch May 15, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants