Repository navigation
channels: Teams + generic webhook + LINE push (outbound notifiers, Wave 1) - #75
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 intopasclaw postand 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
TTeamsWebhookTGenericWebhookAuthorizationheader via$PASCLAW_WEBHOOK_AUTHTLinePushPOST https://api.line.me/v2/bot/message/pushBearer $PASCLAW_LINE_TOKENAll three are post-only — single class, single method that wraps
PostJSON. No new units inPasClaw.Providers.HTTP, no gateway changes, no public-facing port.CLI
Cmd_Post_Runfactored a tinyReportResulthelper so eachDo*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 postwith no args prints the new help table listing all five targets.pasclaw post bogus-kind …dispatches to help with exit 1.postrow; repo-layoutchannels/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
*_nativevariants):/synclong-poll), IRC (raw TCP via TIdIRC), VK (long-poll bot API).https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code