Skip to content

feat: GitHub plugin source capability in plugin SDK (TEN-61)#6

Open
marvin-tensorleap wants to merge 4 commits into
masterfrom
paperclip-ten-61-github-plugin-source
Open

feat: GitHub plugin source capability in plugin SDK (TEN-61)#6
marvin-tensorleap wants to merge 4 commits into
masterfrom
paperclip-ten-61-github-plugin-source

Conversation

@marvin-tensorleap

Copy link
Copy Markdown
Collaborator

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-events example that demonstrates end-to-end import of GitHub PR data into Paperclip work products.

Technical summary

  • packages/plugins/sdk/src/types.ts, protocol.ts — new github-source capability type and protocol messages
  • packages/plugins/sdk/src/host-client-factory.ts — factory integration for GitHub-source capability
  • packages/plugins/sdk/src/worker-rpc-host.ts, testing.ts, index.ts — SDK wiring and test harness
  • packages/shared/src/constants.ts — shared GitHub capability constants
  • server/src/services/plugin-capability-validator.ts — server-side capability validation
  • server/src/services/plugin-host-services.ts — host service registration for GitHub source
  • server/src/services/work-products.ts, routes/issues.ts — work-product persistence for imported data
  • packages/plugins/examples/plugin-github-pr-events/ — reference implementation
  • Tests updated in plugin-orchestration-apis.test.ts, plugin-sdk-orchestration-contract.test.ts, work-products.test.ts

Verification

Three test suites cover the orchestration contract, SDK protocol, and work-product persistence. The example plugin exercises the full import flow end-to-end.

marvin-tensorleap and others added 3 commits April 29, 2026 13:24
…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>
@marvin-tensorleap marvin-tensorleap self-assigned this May 4, 2026
Co-Authored-By: Paperclip <noreply@paperclip.ing>
@lavie

lavie commented May 5, 2026

Copy link
Copy Markdown
Member

@marvin-tensorleap resolve conflicts

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.

3 participants