Skip to content

Add inbound Fediverse plugin hooks#2

Merged
gabek merged 2 commits into
mainfrom
gek/fediverse-hooks
Jul 11, 2026
Merged

Add inbound Fediverse plugin hooks#2
gabek merged 2 commits into
mainfrom
gek/fediverse-hooks

Conversation

@gabek

@gabek gabek commented Jul 10, 2026

Copy link
Copy Markdown
Member

This exposes the inbound Fediverse events implemented by owncast/owncast#5039 to JavaScript and Python plugin authors.

This PR follows owncast/owncast#5039, which is now merged into develop.

  • Add the fediverse.inbound permission to examples that subscribe to inbound activity.
  • Add typed follow, like, repost, quote, mention, and reply handlers.
  • Add onFediverse and @plugin.on_fediverse for verified raw ActivityPub objects, including activity types Owncast does not otherwise handle.
  • Keep JavaScript and Python handler registration in sync.
  • Update the engagement bot scenarios to exercise all seven inbound event subscriptions.
  • Update the author guide, wire protocol, architecture notes, scaffolder guidance, and example instructions.

The quote handler uses FediverseTargetedEngagement, so target.url is required. The catch-all payload is intentionally open-shaped because ActivityPub extensions can add arbitrary fields.

I ran the JavaScript and Python engagement-bot and Fediverse bridge suites directly through the host test binary. All four suites pass with the rebuilt engines from the Owncast core branch.

Copilot AI review requested due to automatic review settings July 10, 2026 23:35

Copilot AI left a comment

Copy link
Copy Markdown

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 exposes inbound Fediverse (ActivityPub) events to plugin authors across both the JavaScript and Python SDKs, aligning permissions, handler registration, examples, and documentation with the new fediverse.inbound gate.

Changes:

  • Add fediverse.activity (catch-all raw activity) and fediverse.quote events plus the fediverse.inbound permission to the JS and Python SDK surfaces.
  • Update JS/Python examples (engagement bot + fediverse chat bridge) to declare fediverse.inbound, implement the new handlers, and expand scenario coverage.
  • Document the new permission and event semantics in the wire protocol, architecture notes, author guide, and scaffolder/template guidance.

Reviewed changes

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

Show a summary per file
File Description
sdks/python/owncast_plugin/template/AGENTS.md Update permissions guidance and capability map to include inbound Fediverse hooks + fediverse.inbound.
sdks/python/owncast_plugin/template/.agents/skills/create-owncast-plugin-py/SKILL.md Update scaffolder skill docs to include @plugin.on_fediverse and inbound permission guidance.
sdks/python/owncast_plugin/init.py Register new Python handler mappings for fediverse.activity and fediverse.quote.
sdks/js/index.js Add new event constants (fediverse.activity, fediverse.quote) and permission constant (fediverse.inbound); register new handlers.
sdks/js/index.d.ts Add typings for new events/permissions/handlers and introduce FediverseTargetedEngagement for target-required engagement events.
sdks/js/create-owncast-plugin/template/AGENTS.md Update JS template guidance/capability map for inbound Fediverse + fediverse.inbound.
sdks/js/create-owncast-plugin/template/.agents/skills/create-owncast-plugin-js/SKILL.md Update JS scaffolder skill docs for new inbound Fediverse handlers and permission guidance.
examples/python/fediverse-chat-bridge/README.md Clarify inbound subscription scope and mention fediverse.inbound gating.
examples/python/fediverse-chat-bridge/plugin.manifest.json Add fediverse.inbound permission.
examples/python/fediverse-chat-bridge/INSTRUCTIONS.md Document why fediverse.inbound is requested.
examples/python/engagement-bot/src/plugin.py Add like/repost/quote/raw-activity handlers.
examples/python/engagement-bot/README.md Update description to reflect all inbound subscriptions.
examples/python/engagement-bot/plugin.manifest.json Add fediverse.inbound permission.
examples/python/engagement-bot/INSTRUCTIONS.md Update behavior and permissions documentation for inbound Fediverse.
examples/python/engagement-bot/tests/mod.test.json Add scenarios for like/repost/quote/raw activity events.
examples/js/fediverse-chat-bridge/README.md Clarify inbound subscription scope and mention fediverse.inbound gating.
examples/js/fediverse-chat-bridge/plugin.manifest.json Add fediverse.inbound permission.
examples/js/fediverse-chat-bridge/INSTRUCTIONS.md Document why fediverse.inbound is requested.
examples/js/engagement-bot/src/plugin.js Add like/repost/quote/raw-activity handlers.
examples/js/engagement-bot/README.md Update description to reflect all inbound subscriptions.
examples/js/engagement-bot/plugin.manifest.json Add fediverse.inbound permission.
examples/js/engagement-bot/INSTRUCTIONS.md Update behavior and permissions documentation for inbound Fediverse.
examples/js/engagement-bot/tests/mod.test.json Add scenarios for like/repost/quote/raw activity events.
docs/WIRE_PROTOCOL.md Define fediverse.inbound permission semantics and the inbound event set it gates.
docs/PLUGIN_AUTHOR_GUIDE.md Document new Fediverse engagement/quote and raw activity hook behavior and permission requirements.
docs/ARCHITECTURE.md Note inbound Fediverse subscriptions are internal notify events gated by fediverse.inbound.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/PLUGIN_AUTHOR_GUIDE.md Outdated
Comment thread sdks/python/owncast_plugin/template/AGENTS.md Outdated
@gabek gabek merged commit 74d4708 into main Jul 11, 2026
241 of 246 checks passed
@gabek gabek deleted the gek/fediverse-hooks branch July 11, 2026 02:36
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