Class GitHubInboundMapper
java.lang.Object
io.agentscope.extensions.channel.github.GitHubInboundMapper
Maps a GitHub webhook delivery into an
InboundMessage.
MVP handles two event types:
issue_comment— comments on issues OR PRs (GitHub firesissue_commentfor both; theissueobject has apull_requestsubobject when it's a PR)pull_request_review_comment— line-anchored review comments on PR diffs
The peer model:
peerKind=PeerKind.THREADpeerId="<owner>/<repo>#<number>"— stable identifier the outbound client parses to build the comment URL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractCommenterId(com.fasterxml.jackson.databind.JsonNode payload) Returns the numeric id of the comment author.extractCommentId(com.fasterxml.jackson.databind.JsonNode payload) Returns thecomment.idused as the idempotency key.Optional<io.agentscope.harness.agent.gateway.channel.InboundMessage>Maps anissue_commentorpull_request_review_commentpayload into anInboundMessage.
-
Constructor Details
-
GitHubInboundMapper
-
-
Method Details
-
extractCommentId
Returns thecomment.idused as the idempotency key. Immutable per GitHub: edits arrive asaction=editedon the same id which we ignore in MVP. -
extractCommenterId
Returns the numeric id of the comment author. Used by the channel for bot-loop self-detection. -
map
public Optional<io.agentscope.harness.agent.gateway.channel.InboundMessage> map(String eventType, com.fasterxml.jackson.databind.JsonNode payload) Maps anissue_commentorpull_request_review_commentpayload into anInboundMessage. Returns empty for unsupported actions (only"created"is mapped) or malformed payloads.
-