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

+101 -11
View File
@@ -3552,16 +3552,22 @@
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"method": {
"description": "Auth method index",
"type": "number"
}
},
"required": [
"method"
"schema": {
"type": "object",
"properties": {
"method": {
"description": "Auth method index",
"type": "number"
},
"inputs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"method"
]
}
}
@@ -10399,6 +10405,90 @@
},
"label": {
"type": "string"
},
"prompts": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"key": {
"type": "string"
},
"message": {
"type": "string"
},
"placeholder": {
"type": "string"
}
},
"required": [
"type",
"key",
"message"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "select"
},
"key": {
"type": "string"
},
"message": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"label",
"value"
]
}
},
"when": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
]
}
},
"required": [
"type",
"key",
"message",
"options"
]
}
]
}
}
},
"required": [
@@ -10932,4 +11022,4 @@
}
}
}
}
}