githubApp() connections: authoring, CLI, dashboard Repositories tab, api-edge - #650
Open
ZIJ wants to merge 4 commits into
Open
githubApp() connections: authoring, CLI, dashboard Repositories tab, api-edge#650ZIJ wants to merge 4 commits into
ZIJ wants to merge 4 commits into
Conversation
Public half of the GitHub App integration (serverless-agents-ws work 010):
- @opencomputer/agent: githubApp({ permissions }) credential reference for
defineConnection headers. Permissions are required, validated against the
supported key set (contents, pull_requests, issues, metadata, checks) with
read-only keys enforced; valid only on GitHub API origins. The connection
headers type widens to include the reference.
- CLI: the static connection-header parser accepts githubApp() with an
inline object-literal permissions argument (variables/spreads are rejected
with a targeted error), the bundled authoring shim gains the same helper,
and the compiled manifest carries {kind: "github_app", permissions}. The
secrets origin inference and secret-set flows now skip non-secret header
kinds. New commands: `opencomputer github status|connect`. `opencomputer
dev` warns once when compiled code uses githubApp() but the development
environment has no GitHub connection, pointing at the connect flow.
- api-edge: explicit allowlist entries for the project GitHub management
routes, and an unauthenticated public surface for the two browser
callbacks and the App webhook ingress, forwarded to the private edge which
authorizes them by one-time state / HMAC. The public origin is what gets
baked into GitHub app manifests — never the private hostname.
Compiler tests cover the literal-permissions manifest output and the
non-literal rejection; agent/cli/api-edge type-checks and suites green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ting Mirrors the OC_V3_KEY pattern: with OC_MANAGED_TARGET set, Vite forwards /api/managed-agents/* to a local `wrangler dev` of the private edge as /v1/*, which in development mode accepts unauthenticated requests as the local account. GitHub browser callbacks ride the same rewrite, so the dedicated-app manifest flow round-trips through real GitHub against localhost. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Project-level dashboard surface for the GitHub App integration (work 010 J1–J4): per-environment connection status with the full state model (not_connected / connected / auth_required / app_suspended / app_deleted / unavailable — the last renders a Retry with retained selections, never a reconnect prompt or an empty grant), the shared-OC-app install flow, an attach-existing installation picker, the dedicated-app manifest wizard (SlackWizard step pattern; form-POSTs the manifest to GitHub in a new tab and detects completion as a transition from a baselined attachment), and the all/selected scope editor with dormant no-longer-granted selections visibly retained, truncation warned once, and mode semantics (install-wide token vs per-id mint) stated inline. Scope logic re-derived namespaced in github-scope.ts rather than importing the other product's repository-access module. App management: webhook-secret and private-key re-entry, delete, Configure-on-GitHub deep link. Typecheck, build, and 189 web tests green; scope logic unit-tested (dormant retention, truncation-omission never classified as revoked). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cookie auth can't bridge localhost to the prod edge, but the vite proxy can attach an existing prod oc_session server-side — same pattern as OC_V3_KEY, the value never enters the browser bundle. Lets the dashboard shell run against prod while managed-agents traffic goes wherever OC_MANAGED_TARGET points. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Public half of the GitHub App integration (serverless-agents-ws
.agents/work/010-github-app-integration.md). Companion to diggerhq/blue#32 (private edge: mint, attachments, routes) and diggerhq/blue#31 (independent proxy fix).What ships
@opencomputer/agent:githubApp({ permissions })— a credential reference fordefineConnectionheaders. Permissions are a required argument validated against the supported set (contents,pull_requests,issues,metadata,checks; read-only keys enforced); valid only on GitHub API origins. Replaces PAT-in-secret for GitHub: the platform mints a ~1h installation token scoped to the project's repositories and the declared permissions, attached at managed egress — agent code never sees a credential, and there is no token to create, paste, or rotate.{kind: "github_app", permissions},opencomputer github status|connect, and adev-loop warning when code usesgithubApp()but development has no GitHub connection. Secrets origin-inference now skips non-secret header kinds.all/selectedrepository scope with dormant selections visibly retained and truncation honesty; the full connection state model includingunavailable→ Retry (a GitHub outage never renders as disconnected); app management (webhook-secret/private-key re-entry, delete). Scope logic lives namespaced inmanaged-agents/github-scope.ts— deliberately not shared with the legacy repository-access module.OC_MANAGED_TARGETVite proxy bypass (mirrorsOC_V3_KEY) — point the dashboard at a localwrangler devof the private edge; the dedicated-app flow round-trips real GitHub against localhost.Verification
Not in this PR
Public docs (repo rule: only after the slice is verified on default branches); OC shared-app registration per environment (ops); repo checkout/publish (explicitly deferred to its own design).
🤖 Generated with Claude Code