Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions hn-monitor/persona.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,22 @@ export default definePersona({
'Scans Hacker News a few times a day for topics you care about and posts a digest to Slack, Telegram, or both. Retains the last ~30 days of digests — DM the agent or message it on Telegram to ask about what it recently posted.',
cloud: true,

// Optional integrations (workforce#252): each transport is `optional` and gated
// by `enabledByInput`, so its provider connection + trigger registration happen
// ONLY when the matching id input is set. Set SLACK_CHANNEL, TELEGRAM_CHAT, or
// both — a Slack-only deploy never has to wire up a Telegram bot, and vice
// versa. The handler delivers to whichever targets are configured.
integrations: {
slack: { scope: { paths: '/slack/channels/**' } },
telegram: { scope: { chats: '/telegram/chats/**', layout: '/telegram/LAYOUT.md' } }
slack: {
optional: true,
enabledByInput: 'SLACK_CHANNEL',
scope: { paths: '/slack/channels/**' }
},
telegram: {
optional: true,
enabledByInput: 'TELEGRAM_CHAT',
scope: { chats: '/telegram/chats/**', layout: '/telegram/LAYOUT.md' }
}
},

inputs: {
Expand Down
36 changes: 0 additions & 36 deletions inbox-buddy-telegram/README.md

This file was deleted.

153 changes: 0 additions & 153 deletions inbox-buddy-telegram/agent.ts

This file was deleted.

Binary file removed inbox-buddy-telegram/avatar.png
Binary file not shown.
Binary file removed inbox-buddy-telegram/banner.png
Binary file not shown.
Binary file removed inbox-buddy-telegram/card.png
Binary file not shown.
77 changes: 0 additions & 77 deletions inbox-buddy-telegram/persona.ts

This file was deleted.

35 changes: 24 additions & 11 deletions inbox-buddy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Instantly launch this agent on Agent Relay

[![Launch Agent](https://agentrelay.com/launch-agent_small.svg)](https://agentrelay.com/cloud/deploy?persona=https://github.com/AgentWorkforce/agents/blob/main/inbox-buddy/persona.ts)

Chat with this agent in a dedicated **Slack channel** to ask about your Gmail.
It holds a **multi-turn conversation** (remembers earlier turns) and reasons over
**full email threads** (not single messages).
Chat with this agent in **Slack or Telegram** to ask about your Gmail. It holds a
**multi-turn conversation** (remembers earlier turns) and reasons over **full
email threads** (not single messages). One agent, dual transport — pick Slack,
Telegram, or both via configuration.

```text
You → #your-channel: What's the latest on the Q3 export thread with Alice?
Expand All @@ -26,18 +27,26 @@ getting wrong:

## How it works

- **Channel:** the human chat path is **Slack**, not the relay inbox (the relay
inbox is agent-to-agent). This mirrors the in-production `linear-slack` agent:
a `slack` trigger watches ONE channel (`SLACK_CHANNEL`), and the handler
answers every fresh human message there and replies in Slack. It ignores bot
messages (loop guard) and message edits/joins.
- **Channels:** the human chat path is **Slack and/or Telegram**, not the relay
inbox (the relay inbox is agent-to-agent). Two webhook-driven triggers are
registered — `slack.app_mention` and `telegram.message` — and the handler
dispatches by event type, **always replying on the origin transport** (a
question asked in Slack is answered in Slack, never mirrored to Telegram). It
ignores bot messages (loop guard) and Slack message edits/joins.
- **Pick a transport (workforce#252 optional integrations):** the `slack` and
`telegram` integrations are each `optional: true` and gated by
`enabledByInput`. Setting `SLACK_CHANNEL` enables (and restricts) the Slack
transport; setting `TELEGRAM_CHAT` enables (and restricts) Telegram. A
Slack-only deploy leaves `TELEGRAM_CHAT` empty and never has to connect a
Telegram bot — the unused provider's connection + trigger are pruned at deploy.
- **Reads:** Gmail threads from the relayfile VFS at
`/google-mail/threads/<id>.json` (provider id `google-mail`). No Gmail token —
auth lives in the `google-mail` Nango connection. `lib/gmail.ts`.
- **Continuity:** the conversation transcript is persisted per-conversation in
`ctx.memory` (workspace scope) and replayed into each prompt. Keyed on the
Slack thread, or the channel itself for top-level messages, so a back-and-forth
in the channel is one continuous conversation. `lib/conversation.ts`, `lib/slack.ts`.
Slack thread / Telegram chat (plus forum topic), or the channel itself for
top-level Slack messages, so a back-and-forth is one continuous conversation.
`lib/conversation.ts`; transports in `lib/slack.ts` + `../shared/telegram.ts`.
- **Reasoning:** `ctx.llm.complete` (claude-sonnet-4-6) over a recent-thread
overview plus the full message list of any thread the question references.
`lib/prompt.ts`.
Expand All @@ -56,9 +65,13 @@ getting wrong:

## Inputs

At least one of `SLACK_CHANNEL` / `TELEGRAM_CHAT` must be set — each both
**enables** its transport and **restricts** replies to that channel/chat.

| input | required | purpose |
|---|---|---|
| `SLACK_CHANNEL` | no | Optional: restrict replies to one Slack channel id. Unset = reply wherever inbox-buddy is `@mentioned`. (`app_mention` is webhook-driven, so the id is not interpolated into a watch path.) |
| `SLACK_CHANNEL` | one of | Slack channel id to chat in. Setting it enables the Slack transport and restricts replies to that channel. Empty = skip Slack. |
| `TELEGRAM_CHAT` | one of | Telegram chat id to chat in. Setting it enables the Telegram transport and restricts replies to that chat. Empty = skip Telegram. (No chat picker yet — enter the numeric id.) |

## Local testing

Expand Down
Loading