Add inbound Fediverse plugin hooks#2
Merged
Merged
Conversation
There was a problem hiding this comment.
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) andfediverse.quoteevents plus thefediverse.inboundpermission 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.
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.
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.fediverse.inboundpermission to examples that subscribe to inbound activity.onFediverseand@plugin.on_fediversefor verified raw ActivityPub objects, including activity types Owncast does not otherwise handle.The quote handler uses
FediverseTargetedEngagement, sotarget.urlis 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.