MCPcopy Index your code
hub / github.com/anomalyco/opencode / assertPayloadKeyword

Function assertPayloadKeyword

github/index.ts:244–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242}
243
244function assertPayloadKeyword() {
245 const payload = useContext().payload as IssueCommentEvent | PullRequestReviewCommentEvent
246 const body = payload.comment.body.trim()
247 if (!body.match(/(?:^|\s)(?:\/opencode|\/oc)(?=$|\s)/)) {
248 throw new Error("Comments must mention `/opencode` or `/oc`")
249 }
250}
251
252function getReviewCommentContext() {
253 const context = useContext()

Callers 1

index.tsFile · 0.85

Calls 1

useContextFunction · 0.85

Tested by

no test coverage detected