Add /api-provision to app-server TUI

Wire the app-backed UI through a new internal ephemeral API-key login path so /api-provision can reuse the browser provisioning flow, persist OPENAI_API_KEY to .env, and hot-apply the key without writing auth.json.

Co-authored-by: Codex <noreply@openai.com>
(cherry picked from commit e7d7aebb48)
This commit is contained in:
Michael Fan
2026-03-24 22:00:30 +00:00
committed by Michael Fan
parent 2c08f00f65
commit a734106aff
16 changed files with 541 additions and 9 deletions

View File

@@ -832,6 +832,18 @@ impl McpProcess {
self.send_request("account/login/start", Some(params)).await
}
/// Send an `account/login/start` JSON-RPC request for ephemeral API key login.
pub async fn send_login_account_ephemeral_api_key_request(
&mut self,
api_key: &str,
) -> anyhow::Result<i64> {
let params = serde_json::json!({
"type": "ephemeralApiKey",
"apiKey": api_key,
});
self.send_request("account/login/start", Some(params)).await
}
/// Send an `account/login/start` JSON-RPC request for ChatGPT login.
pub async fn send_login_account_chatgpt_request(&mut self) -> anyhow::Result<i64> {
let params = serde_json::json!({