Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
fix(integrations): prefer GitHub OAuth
Rahmanf82df80ce00d
diff --git a/claude-skills/integrations/SKILL.md b/claude-skills/integrations/SKILL.mdindex 261817b0..1b993402 100644--- a/claude-skills/integrations/SKILL.md+++ b/claude-skills/integrations/SKILL.md@@ -63,6 +63,8 @@ Do not claim an OAuth/provider-MCP account is connected merely because routing mUse the provider catalog to choose a valid source and auth method. Create a stable named connection, then open private setup only when the source is direct and secret fields are required. For Composio or provider-owned MCP, follow the hosted/provider authorization route instead of collecting OAuth secrets locally.+For **GitHub**, present OAuth-capable sources before the manual token fallback. `composio/oauth2` is the hosted executable OAuth route; `native-mcp/provider-oauth` keeps the provider session client-owned. A direct PAT is an explicit fallback only. Never silently replace a failed OAuth/MCP identity with an existing PAT, even when that PAT is verified or default. Reauthorization must preserve the intended credential user and named connection.+Multiple deployment/account connections under one provider are first-class. Never overwrite `production` with `staging` merely because they use the same auth method.### Transfer identitiesdiff --git a/docs/PROGRESS.md b/docs/PROGRESS.mdindex 64ff7864..725b531a 100644--- a/docs/PROGRESS.md+++ b/docs/PROGRESS.md@@ -1,3 +1,7 @@+## 2026-09-17 — GitHub OAuth-first Integrations routing++GitHub Connections now present hosted OAuth and provider-owned OAuth/MCP before the manual PAT fallback. The direct GitHub path remains available without capability loss, but it is explicitly labeled as a fallback and recommends an expiring fine-grained token when a direct credential is deliberately required. `/integrations` now states the no-silent-fallback rule: a failed OAuth/MCP identity must never be replaced by another PAT/principal implicitly. This complements Baton tenant OAuth, which remains a separate user/workspace trust boundary instead of copying customer OAuth tokens into the MSO operator vault.+## 2026-09-17 — Isolated shell bundle and first-open performance improvementsReduced eager shell work without removing applications or changing authorization, persistence, native terminal sessions, service-worker recovery, or deployment behavior. Organization's public view now has a lazy facade (the descriptor stays cheap); ReactFlow CSS follows the shared graph canvas rather than the root stylesheet. Search, Inspector, mobile Alfa/Control Center and clipboard presentation load on demand through an effect/state boundary, while lock protection, capture, hotkeys and notifications remain active from startup. The Inspector keeps its selected tab across close/reopen. Settings section bodies are split behind the existing selection and Owner-role checks. App-module prefetch now requires 250 ms of intent, cancels pending requests on leave/blur/close, respects constrained connections, deduplicates loads, and lets expensive app descriptors opt out. The existing local Geist Mono stays available without global preloading.diff --git a/lib/infra/additional-providers.ts b/lib/infra/additional-providers.tsindex 958cc7de..ddd36a01 100644--- a/lib/infra/additional-providers.ts+++ b/lib/infra/additional-providers.ts@@ -31,9 +31,9 @@ export const ADDITIONAL_PROVIDERS = {github: {id: "github",title: "GitHub",- description: "Verify a GitHub personal access token for API access.",+ description: "Connect GitHub through OAuth where available; keep personal access tokens as an explicit manual fallback.",feature: false,- fields: [{ key: "owner", label: "Repository owner", secret: false, required: false, description: "Optional connection-specific configuration; retained during JSON transfer." }, { key: "apiKey", label: "Personal access token (classic)", secret: true, required: true, description: "A GitHub classic personal access token. Repository access depends on the token's scopes and organization policy." }],+ fields: [{ key: "owner", label: "Repository owner", secret: false, required: false, description: "Optional connection-specific configuration; retained during JSON transfer." }, { key: "apiKey", label: "Personal access token (manual fallback)", secret: true, required: true, description: "A GitHub personal access token used only for an explicitly selected direct connection. Prefer a fine-grained token with expiry and the minimum repository access; classic tokens remain supported only when required by the intended operation." }],},vercel: {id: "vercel",@@ -105,7 +105,7 @@ export type AdditionalProviderId = keyof typeof ADDITIONAL_PROVIDERS;export const ADDITIONAL_GUIDANCE = {mcp: { url: "https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization", reference: "https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization", steps: ["Sign in to the target application's account that the assistant should use.", "Create a dedicated expiring MCP token with the least required scope. For Baton: Settings → External access → MCP → Advanced token management.", "Enter the exact MCP URL and token only in this private MSO form. Set an optional exact tool allowlist.", "Bind the project MCP declaration to this named MSO user/connection; MSO verifies tool discovery, while the downstream server enforces its token identity and live project roles."] },- github: { url: "https://github.com/settings/tokens/new", reference: "https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens", steps: ["Open GitHub token settings while signed in to the intended account.", "Choose Generate new token (classic).", "Set an expiry and select only the scopes required for the intended automation; repository access generally requires the repo scope.", "Copy the token once and store it here. Organization policies can still limit its access."] },+ github: { url: "https://github.com/settings/personal-access-tokens/new", reference: "https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens", steps: ["Prefer GitHub OAuth from the Integrations connection source picker. Use this manual token path only when an explicit direct fallback is required.", "Open GitHub fine-grained token settings while signed in to the intended account.", "Set an expiry and grant only the intended repositories and minimum permissions. Use a classic token only when the required operation cannot be expressed with a fine-grained token.", "Copy the token once into this private form. This connection never substitutes for an OAuth/provider-MCP identity and organization policy can still limit access."] },vercel: { url: "https://vercel.com/account/tokens", reference: "https://vercel.com/docs/rest-api#creating-an-access-token", steps: ["Open Account Settings → Tokens in Vercel.", "Create a token with an expiry appropriate for this integration.", "Use the account or team that owns the intended Vercel resources.", "Copy the token into this form; its permissions are determined by that account or team membership."] },"convex-cloud": { url: "https://dashboard.convex.dev", reference: "https://docs.convex.dev/management-api", steps: ["Open the Convex dashboard for the intended account or deployment.", "Create the personal access token or deployment key appropriate to the operation you intend to perform.", "For a deployment key, also enter its exact deployment name.", "Copy the credential once and keep it scoped to the minimum needed access."] },convex: { url: "https://docs.convex.dev/self-hosting", reference: "https://docs.convex.dev/self-hosting", steps: ["Open the administration settings for your self-hosted Convex deployment.", "Generate an admin key using the official self-hosting instructions; never use a cloud project key for a different deployment.", "Enter the deployment's HTTPS URL; loopback HTTP is only suitable for a deployment on this VPS.", "Copy the admin key into this form and restrict network access to the deployment." ] },diff --git a/lib/infra/connection-model.test.ts b/lib/infra/connection-model.test.tsindex 6033eca7..823a5bff 100644--- a/lib/infra/connection-model.test.ts+++ b/lib/infra/connection-model.test.ts@@ -28,6 +28,13 @@ describe("native credential identity core",()=>{expect(await fs.readFile(file+".v1-backup.json","utf8")).toBe(original);expect((await fs.stat(file+".v1-backup.json")).mode&0o777).toBe(0o600);expect((await readIntegrationState()).instanceId).toBe(state.instanceId);});+ it("defaults new GitHub connections to hosted OAuth while preserving explicit direct fallback",async()=>{+ const f=await fixture();+ const oauth=await f.manage({action:"connection.create",confirm:true,user:"alice",provider:"github",connection:"oauth-default"}) as {connection:{source:string;authMethod:string}};+ expect(oauth.connection).toMatchObject({source:"composio",authMethod:"oauth2"});+ const direct=await f.manage({action:"connection.create",confirm:true,user:"alice",provider:"github",connection:"manual",source:"direct",authMethod:"direct"}) as {connection:{source:string;authMethod:string}};+ expect(direct.connection).toMatchObject({source:"direct",authMethod:"direct"});+ });it("isolates two users and five named Convex account/deployment connections",async()=>{const f=await fixture();await f.add("alice","convex-cloud","admin","personal",{personalToken:KEY_A});for(const id of ["baton","mimin-production","mimin-staging","play-together"]){await f.add("alice","convex-cloud",id,"deployment",{deployKey:KEY_A+id,deploymentName:id});}diff --git a/lib/infra/connection-registry.test.ts b/lib/infra/connection-registry.test.tsnew file mode 100644index 00000000..faf17402--- /dev/null+++ b/lib/infra/connection-registry.test.ts@@ -0,0 +1,19 @@+import { describe, expect, it } from "vitest";+import { connectionCatalog, connectionMethods, connectionSources } from "./connection-registry";++describe("integration connection registry", () => {+ it("presents GitHub OAuth routes before the explicit manual token fallback", () => {+ expect(connectionSources("github")).toEqual(["composio", "native-mcp", "direct"]);+ const github = connectionCatalog().find((row) => row.id === "github");+ expect(github?.sources.map((row) => [row.id, row.label])).toEqual([+ ["composio", "Hosted OAuth (Composio)"],+ ["native-mcp", "Provider OAuth / MCP"],+ ["direct", "Manual token fallback"],+ ]);+ expect(connectionMethods("github", "direct")[0]?.label).toBe("Personal access token fallback");+ });++ it("does not reorder unrelated providers", () => {+ expect(connectionSources("vercel")).toEqual(["direct", "composio", "native-mcp"]);+ });+});diff --git a/lib/infra/connection-registry.ts b/lib/infra/connection-registry.tsindex 7088e367..dba5e5b3 100644--- a/lib/infra/connection-registry.ts+++ b/lib/infra/connection-registry.ts@@ -17,7 +17,7 @@ export function providerDefinition(provider:string) {}export function connectionMethods(provider:string, source:ConnectionSource) {const p=providerDefinition(provider);- if(source==="direct") return setupMethods(p.id).map(m=>({id:m.id as string,label:m.label,scope:provider==="convex-cloud"?(m.id==="deployment"?"deployment":"account"):provider==="composio"?m.id:provider==="dokploy"?"server":provider==="hostinger"&&m.id==="mail"?"mail-order":provider==="doku"?"merchant":"account",fields:setupFields(p.id,m.id),guidance:setupGuidance(p.id,m.id)}));+ if(source==="direct") return setupMethods(p.id).map(m=>({id:m.id as string,label:provider==="github"?"Personal access token fallback":m.label,scope:provider==="convex-cloud"?(m.id==="deployment"?"deployment":"account"):provider==="composio"?m.id:provider==="dokploy"?"server":provider==="hostinger"&&m.id==="mail"?"mail-order":provider==="doku"?"merchant":"account",fields:setupFields(p.id,m.id),guidance:setupGuidance(p.id,m.id)}));if(source==="composio" && COMPOSIO[provider]) return COMPOSIO[provider].methods.map(id=>({id,label:id==="oauth2"?"OAuth2":"Hosted API key",scope:"account",fields:[],guidance:{url:"https://platform.composio.dev",reference:`https://docs.composio.dev/toolkits/${COMPOSIO[provider].toolkit}`,steps:["Configure a Composio project key under this same credential user.","Choose a matching authentication configuration for this provider and method.","Open the hosted authorization link. Enter credentials only on the provider/Composio page.","Return and refresh status. MSO stores routing identifiers, not provider OAuth tokens."]}}));if(source==="native-mcp" && NATIVE[provider])return[{id:"provider-oauth",label:"Provider-owned MCP / OAuth",scope:"account",fields:[],guidance:{url:NATIVE[provider].reference,reference:NATIVE[provider].reference,steps:["Connect the provider-owned MCP server in your client.","Complete authorization in that provider's browser flow.","Use this named MSO connection to identify the intended provider route; the authenticated MCP session remains client-owned.","MSO does not copy provider access/refresh tokens or silently fall back to a local key."]}}];throw new IntegrationError("unsupported_connection_source");@@ -26,8 +26,17 @@ export function connectionMethod(provider:string,source:ConnectionSource,method?const methods=connectionMethods(provider,source), selected=method?methods.find(m=>m.id===method):methods[0];if(!selected)throw new IntegrationError("unsupported_auth_method");return selected;}-export function connectionSources(provider:string){return ["direct",...(COMPOSIO[provider]?["composio"]:[]),...(NATIVE[provider]?["native-mcp"]:[])] as ConnectionSource[];}-export function connectionCatalog(){return listInfraProviderDefinitions().map(p=>({id:p.id,title:p.title,description:p.description,sources:connectionSources(p.id).map(id=>({id,label:id==="direct"?"MSO direct":id==="composio"?"Composio":"Provider MCP",methods:connectionMethods(p.id,id)}))}));}+export function connectionSources(provider:string){+ const oauthFirst = provider === "github";+ return (oauthFirst+ ? [...(COMPOSIO[provider]?["composio"]:[]),...(NATIVE[provider]?["native-mcp"]:[]),"direct"]+ : ["direct",...(COMPOSIO[provider]?["composio"]:[]),...(NATIVE[provider]?["native-mcp"]:[])]) as ConnectionSource[];+}+function sourceLabel(provider:string,id:ConnectionSource){+ if(provider==="github") return id==="composio"?"Hosted OAuth (Composio)":id==="native-mcp"?"Provider OAuth / MCP":"Manual token fallback";+ return id==="direct"?"MSO direct":id==="composio"?"Composio":"Provider MCP";+}+export function connectionCatalog(){return listInfraProviderDefinitions().map(p=>({id:p.id,title:p.title,description:p.description,sources:connectionSources(p.id).map(id=>({id,label:sourceLabel(p.id,id),methods:connectionMethods(p.id,id)}))}));}export function connectionSummary(user:string,c:IntegrationConnection,isDefault=false,values:Record<string,string>=c.values){const method=connectionMethod(c.provider,c.source,c.authMethod),missing=method.fields.filter(f=>f.required&&!values[f.key]).map(f=>f.key);return {user,id:c.id,label:c.label,provider:c.provider,source:c.source,authMethod:c.authMethod,scope:c.scope,revision:c.revision,isDefault,missing,fields:method.fields.map(f=>({...f,stored:Boolean(values[f.key])})),state:c.source==="direct"?(missing.length?"incomplete":c.lastCheck?(c.lastCheck.revision===c.revision?c.lastCheck.result:"configured"):c.verifiedAt?"verified":"configured"):c.external?.status??"authorization-required",verifiedAt:c.verifiedAt??null,lastCheck:c.lastCheck?.revision===c.revision?c.lastCheck:null,sharedFrom:c.sharedFrom??null,external:c.external??null};diff --git a/lib/infra/connection-service.ts b/lib/infra/connection-service.tsindex 7b80e94a..c14c0ad4 100644--- a/lib/infra/connection-service.ts+++ b/lib/infra/connection-service.ts@@ -1,6 +1,6 @@import { randomUUID } from "node:crypto";import { AsyncLocalStorage } from "node:async_hooks";-import { connectionCatalog, connectionMethod, connectionSummary, nativeDefinition } from "./connection-registry";+import { connectionCatalog, connectionMethod, connectionSources, connectionSummary, nativeDefinition } from "./connection-registry";import { readIntegrationState, mutateIntegrationState } from "./connection-storage";import { IntegrationError, identity, connectionLabel, selectConnection, resolveUser, folderBinding, metadataOnly, assertNotBusy, resolveSharedConnection, type ConnectionSelector, type IntegrationState, type IntegrationConnection, type ConnectionSource } from "./identity";import { normalizeInfraValues, isInfraProviderId } from "./catalog";@@ -27,7 +27,7 @@ export async function integrationSnapshot(selector:ConnectionSelector={}){}export function createConnectionIn(state:IntegrationState,input:{user:string;provider:string;connection:string;label?:string;source?:ConnectionSource;authMethod?:string;makeDefault?:boolean}){const user=identity(input.user,"user"),provider=identity(input.provider,"provider"),id=identity(input.connection,"connection"),profile=state.users[user];if(!profile)throw new IntegrationError("user_not_found",404);- const source=input.source??"direct",method=connectionMethod(provider,source,input.authMethod),rows=profile.connections[provider]??{};+ const source=input.source??connectionSources(provider)[0]??"direct",method=connectionMethod(provider,source,input.authMethod),rows=profile.connections[provider]??{};if(Object.hasOwn(rows,id))throw new IntegrationError("connection_exists",409);const c:IntegrationConnection={id,uid:randomUUID(),label:connectionLabel(input.label??id),provider,source,authMethod:method.id,scope:method.scope,revision:1,values:{},createdAt:Date.now(),updatedAt:Date.now()};profile.connections[provider]={...rows,[id]:c};if(input.makeDefault||!Object.keys(rows).length)profile.defaults[provider]=id;return c;