feat: GitHub plugin source capability in plugin SDK (TEN-61)#6
Open
marvin-tensorleap wants to merge 4 commits into
Open
feat: GitHub plugin source capability in plugin SDK (TEN-61)#6marvin-tensorleap wants to merge 4 commits into
marvin-tensorleap wants to merge 4 commits into
Conversation
…nual-origin issues Add recoverPullRequestMappingFromIssueComments as a final fallback in resolvePullRequestLinks. When no work product, legacy mapping, or GitHub issue reference resolves a PR, scan active Paperclip issues for any that have the PR URL in their comments. On match, build a PullRequestLink from the issue directly (bypassing the originKind gate), then immediately persist a work product so subsequent events resolve via the fast path. Add issue.comments.read capability to the manifest so listComments can be called in the recovery path. Add a test covering the full scenario: manually-created Paperclip issue, agent posts PR URL in comments, pull_request_review webhook wakes the issue. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Member
|
@marvin-tensorleap resolve conflicts |
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.
Why this change exists
The plugin SDK lacked the ability for plugins to pull data from GitHub as a source (fetch issues, PRs, comments). TEN-61 identified this gap — without a standardised GitHub source in the SDK, every plugin had to re-implement its own fetch logic with inconsistent error handling and no shared protocol.
How this PR fixes it
Extends the plugin SDK with a GitHub-source capability type, adds the protocol definitions and host-client factory for the new capability, and introduces a working
plugin-github-pr-eventsexample that demonstrates end-to-end import of GitHub PR data into Paperclip work products.Technical summary
packages/plugins/sdk/src/types.ts,protocol.ts— newgithub-sourcecapability type and protocol messagespackages/plugins/sdk/src/host-client-factory.ts— factory integration for GitHub-source capabilitypackages/plugins/sdk/src/worker-rpc-host.ts,testing.ts,index.ts— SDK wiring and test harnesspackages/shared/src/constants.ts— shared GitHub capability constantsserver/src/services/plugin-capability-validator.ts— server-side capability validationserver/src/services/plugin-host-services.ts— host service registration for GitHub sourceserver/src/services/work-products.ts,routes/issues.ts— work-product persistence for imported datapackages/plugins/examples/plugin-github-pr-events/— reference implementationplugin-orchestration-apis.test.ts,plugin-sdk-orchestration-contract.test.ts,work-products.test.tsVerification
Three test suites cover the orchestration contract, SDK protocol, and work-product persistence. The example plugin exercises the full import flow end-to-end.