feat(connector-github): GitHub connector on @gemstack/connectors#93
Merged
Conversation
First real connector (epic #86, #88). Read and act on GitHub issues, PRs, and repo files over the REST API via global fetch (no SDK dep). Tools: get-repo, list-issues, get-issue, list-pull-requests, get-pull-request, get-file, search-issues, comment-on-issue, create-issue. Reads annotated readOnly; writes are not. Responses are slimmed to the fields an agent needs. Consumes a bearer token (PAT or OAuth) from ctx.auth.token via the mount credentials seam; declares auth { type: pat, env: GITHUB_TOKEN }. 7 tests over a mocked fetch (filtering, base64 decode, POST bodies, missing-token + non-2xx errors).
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.
Closes #88. The first real connector on the kit (epic #86), built right after the kit (#87 / #91) landed.
@gemstack/connector-githubreads and acts on GitHub issues, pull requests, and repo files over the GitHub REST API (globalfetch, no SDK dependency).Tools
get-repo,list-issues,get-issue,list-pull-requests,get-pull-request,get-file,search-issuesreadOnly)comment-on-issue,create-issueResponses are slimmed to the fields an agent needs (no raw API envelopes) to keep token usage down.
Auth
Declares
auth: { type: 'pat', env: 'GITHUB_TOKEN' }and consumes a bearer token fromctx.auth.token— a PAT or an OAuth bearer, both sent asAuthorization: Bearer. The connector does no OAuth handshake itself; the orchestrator supplies the token via the mountcredentialsseam (and can protect a web endpoint with@gemstack/mcp'soauth2McpMiddleware).Verify
pnpm --filter @gemstack/connector-github test— 7 tests over a mockedfetch: PR filtering, base64 file decode, POST bodies for comment/create, and the missing-token + non-2xx error paths.Next:
@gemstack/connector-google-drive(#89) on the same contract.