Skip to content

channels: Teams + generic webhook + LINE push (outbound notifiers, Wave 1) - #75

Merged
FMXExpress merged 1 commit into
mainfrom
claude/channels-wave1
May 29, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
claude/channels-wave1

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Wave 1 of the picoclaw channel catch-up. PasClaw had 3 of picoclaw's 20 channels (discord, slack, telegram). This adds three outbound notifiers that drop straight into pasclaw post and share the existing webhook pattern.

Why outbound first

My original wave-1 mapping conflated picoclaw's slack_webhook / teams_webhook (post-only outbound) with real webhook receivers (LINE, WhatsApp Cloud). The receive side needs the gateway to mount per-channel HTTP routes with signature verification — a bigger architectural change that warrants its own PR. The outbound notifiers are immediately useful for cron skills and they share the proven Slack/Discord webhook pattern.

What's in the box

Adapter Class Endpoint Auth
Microsoft Teams TTeamsWebhook user-supplied Incoming Webhook URL URL is the secret
Generic webhook TGenericWebhook user-supplied URL optional Authorization header via $PASCLAW_WEBHOOK_AUTH
LINE push TLinePush POST https://api.line.me/v2/bot/message/push Bearer $PASCLAW_LINE_TOKEN

All three are post-only — single class, single method that wraps PostJSON. No new units in PasClaw.Providers.HTTP, no gateway changes, no public-facing port.

CLI

pasclaw post teams   https://<tenant>.webhook.office.com/...  "deploy succeeded"
pasclaw post webhook https://hooks.example.com/cron-summary    "ran fine"
pasclaw post line    U1234567890abcdef                          "build done"

Cmd_Post_Run factored a tiny ReportResult helper so each Do* function stays a one-liner; dropped a chunk of copy-pasted "if posted then green else red" boilerplate at the same time.

Verification

  • make — clean build under FPC 3.2.2 (linker step ran, all six new compilation units logged).
  • pasclaw post with no args prints the new help table listing all five targets.
  • pasclaw post bogus-kind … dispatches to help with exit 1.
  • README's command-surface table updates the post row; repo-layout channels/ line spells out the full set.

Wave 1.5 (deferred to own PR)

Two-way LINE bot and WhatsApp Cloud bot receivers — both need the gateway to mount POST /webhooks/<channel> routes with HMAC-SHA256 signature verification, parse the platform's event JSON, dispatch into the agent loop, and reply via the existing push REST. That's the channel-mount API + roughly 700 LOC; better as its own focused PR.

Picoclaw channels still ahead

Remaining realistic ports (excluding Chinese-ecosystem auth, hardware-specific, and *_native variants):

  • Wave 2: LINE bot, WhatsApp Cloud bot (gateway-mounted receivers).
  • Wave 3: Matrix (REST /sync long-poll), IRC (raw TCP via TIdIRC), VK (long-poll bot API).
  • Wave 4: MQTT (Indy MQTT components).

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon


Generated by Claude Code

…ve 1)

Wave 1 of the picoclaw channel catch-up — three new post-only
adapters that drop straight into `pasclaw post`. They share the
existing Discord / Slack webhook pattern: a single class with a
`Post`/`Push` method that wraps PostJSON. No gateway changes, no
public-facing port, no new architecture.

  - **TTeamsWebhook** (`PasClaw.Channels.Teams`)
      Microsoft Teams "Incoming Webhook" connector — POST
      `{"text":"..."}` to the user-configured webhook URL. URL is
      the secret (no auth header). Mirrors the Slack webhook adapter
      verbatim; renders as a card in the configured channel.

  - **TGenericWebhook** (`PasClaw.Channels.Webhook`)
      Plain JSON sink for anything that doesn't have a specific
      adapter — Zapier hooks, n8n flows, in-house notification
      endpoints, Discord-via-DM-relays. Body is
      `{"text":"..."}`; auth via an optional Authorization header
      string (e.g. "Bearer xyz", read from
      `$PASCLAW_WEBHOOK_AUTH` in the CLI wrapper). Anything richer —
      HMAC signing, OAuth refresh, multipart — belongs in a
      dedicated adapter.

  - **TLinePush** (`PasClaw.Channels.LINE`)
      LINE Messaging API push — POST
      `{"to":"<id>","messages":[{"type":"text","text":"..."}]}` to
      `https://api.line.me/v2/bot/message/push` with
      `Authorization: Bearer <token>`. Target can be a userId,
      groupId, or roomId. Channel Access Token from
      `$PASCLAW_LINE_TOKEN`. Outbound push only — webhook receive
      (signature verify + replyToken) is Wave 2 once the gateway
      grows a channel-mount API.

`pasclaw post` grows three new subcommands matching the existing
shape:

    pasclaw post teams   <webhook-url> "<text>"
    pasclaw post webhook <url>         "<text>"   ($PASCLAW_WEBHOOK_AUTH optional)
    pasclaw post line    <userId|groupId|roomId> "<text>"   ($PASCLAW_LINE_TOKEN required)

`Cmd_Post_Run` factored a tiny `ReportResult` helper so each Do*
function stays a one-liner — drops a chunk of copy-pasted
"if posted then green else red" boilerplate too.

README's command-surface table updates the `post` row to list the
new targets; repository-layout `channels/` line spells them out.

Verified locally: `make` builds clean, `pasclaw post` with no args
prints the new help block, `pasclaw post bogus-kind …` dispatches
to help with exit 1.

Wave 1.5 (two-way LINE + WhatsApp Cloud receivers) needs the
gateway to mount channel webhook routes — own PR.

https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
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