feat: add browser and github workflow primitives#718
Merged
khaliqgant merged 7 commits intomainfrom Apr 22, 2026
Merged
Conversation
Add packages/primitives with: - browser: Browser automation primitive with MCP server integration - github: GitHub API primitive with local/cloud adapter pattern Also include related trajectories for these implementations.
- Remove duplicate star-exports in browser barrel file - Close externally-provided BrowserClient directly so closeSession does not silently no-op when context.client is supplied Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mples
- examples/end-to-end-pr-workflow.ts: walks the full PR lifecycle
(inspect → createBranch → createFile → createPR → getPR → updatePR →
listPRs; mergePR off by default). Single runtime, illustrates how
every PR-related action composes under one workflow definition.
- examples/multi-tenant-pr-workflow.ts: opens PRs in two tenants
(AgentWorkforce + MSD) from one workflow by varying per-step
`config:` — shows how cloud routes GitHub actions to the right Nango
connection based on repo/workspace. Includes a resolver stand-in
that cloud's real implementation will replace with a DB lookup.
- README: documents both examples and adds a cloud-adoption guide —
the `githubConfigForRepo({ repo, workspaceId })` helper shape cloud
will add so workflow authors can wire the primitive to any connected
GitHub App (sage, nightcto, msd, etc.).
Addresses the cross-workspace GitHub PR creation need called out when
migrating cloud workflows off shell-invoked `gh pr create`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move packages/primitives/github -> packages/github-primitive and
packages/primitives/browser -> packages/browser-primitive so both match
the `packages/*` workspaces glob and the publish workflow's
`working-directory: packages/${{ matrix.package }}` pattern. This lets
the existing CI publish both packages without any workflow script
changes beyond adding two entries to the matrix.
Also drop two empty marker interfaces in types.ts (`GetRepoParams`,
`ReadFileParams`) to plain type aliases — ESLint caught them once the
files came into scope via workspaces.
Unblocks cloud adoption of @agent-relay/github-primitive.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # .github/workflows/publish.yml # package-lock.json
| success: false, | ||
| error: error instanceof Error ? error.message : String(error), | ||
| metadata: { | ||
| sessionId: this.session.id, |
| if (!record.metadata) { | ||
| record.metadata = { | ||
| action: action.action, | ||
| sessionId: client.getSession().id, |
|
|
||
| export function trimTrailingSlash(value: string | undefined): string | undefined { | ||
| const trimmed = nonEmpty(value); | ||
| return trimmed?.replace(/\/+$/, ''); |
Contributor
|
Preview deployed!
This preview will be cleaned up when the PR is merged or closed. |
Contributor
|
Addressed the current Devin follow-ups on this branch:
Validation run:
Head is now |
Contributor
|
Addressed review comment Fix:
Validation:
|
Member
willwashburn
left a comment
There was a problem hiding this comment.
what's with all the unrelated changes?
Member
Author
Formatting fighting it looks like |
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.
Summary
Add
packages/primitiveswith two workflow primitives:packages/primitives/browserBrowser automation primitive with MCP server integration. Provides:
packages/primitives/githubGitHub API primitive with local/cloud adapter pattern:
ghCLI (when user has gh installed and authenticated)Related Trajectories
5 trajectories included documenting the implementation decisions:
traj_05xg7j388bc4- Add browser workflow step integrationtraj_avmkyoo2s3rt- Implement Browser primitive clienttraj_530xmbfeljyb- Implement GitHub primitive adapter base layertraj_8oh4r5km5eic- Implement GitHub primitive actionstraj_tv1x9pamkqad- Add GitHub primitive workflow step integrationFiles
packages/primitives/browser/- 13 filespackages/primitives/github/- 19 files.trajectories/completed/2026-04/- 5 trajectory pairs (json + md)