feat: add dynamic OAuth prompt system with conditional fields

- Add PromptFieldSchema supporting text and select input types
- Support conditional prompt visibility based on previous inputs
- Add inputs parameter to OAuth authorize request
- Update OAuth dialogs to render dynamic prompts
- Add OPENCODE_PUBLIC_URL config for OAuth callback URLs
- Remove redundant OAuthMethod enum in favor of backend schema
This commit is contained in:
Chris Scott committed 2026-04-15 14:10:19 -04:00
1 parent 9d94c333b4
commit 2b5e130916
12 files changed
+371 -78

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ export function createOAuthRoutes() {
const body = await c.req.json()
const validated = OAuthAuthorizeRequestSchema.parse(body)
// Proxy to OpenCode server
// Proxy to OpenCode server - only method and inputs are supported
const response = await proxyRequest(
new Request(
`${OPENCODE_SERVER_URL}/provider/${providerId}/oauth/authorize`,
@@ -23,6 +23,7 @@ import { patchOpenCodeConfig } from './proxy'
const OPENCODE_SERVER_PORT = ENV.OPENCODE.PORT
const OPENCODE_SERVER_HOST = ENV.OPENCODE.HOST
const OPENCODE_SERVER_PUBLIC_URL = ENV.OPENCODE.PUBLIC_URL
const MIN_OPENCODE_VERSION = '1.0.137'
const MAX_STDERR_SIZE = 10240
@@ -247,6 +248,7 @@ class OpenCodeServerManager {
GIT_SSH_COMMAND: gitSshCommand,
XDG_DATA_HOME: path.join(openCodeServerDirectory, '.opencode/state'),
XDG_CONFIG_HOME: path.join(openCodeServerDirectory, '.config'),
...(OPENCODE_SERVER_PUBLIC_URL ? { OPENCODE_PUBLIC_URL: OPENCODE_SERVER_PUBLIC_URL } : {}),
OPENCODE_CONFIG: openCodeConfigPath,
}
}