From d1f085c063583a67b96aff5d99bdd908c2a8fd4e Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 12 Dec 2025 12:16:10 -0500 Subject: [PATCH] Rename oauth to be at the front of oauth_send_http_request --- crates/extension_api/src/extension_api.rs | 5 ++--- crates/extension_api/wit/since_v0.8.0/llm-provider.wit | 6 +++--- crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs | 2 +- extensions/copilot-chat/src/copilot_chat.rs | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/extension_api/src/extension_api.rs b/crates/extension_api/src/extension_api.rs index 8680ecbd886b379d686825968a1d8a43425920a6..cd1c8828e3b195820b068ea086e20a20c89bda61 100644 --- a/crates/extension_api/src/extension_api.rs +++ b/crates/extension_api/src/extension_api.rs @@ -45,10 +45,9 @@ pub use wit::{ ToolUseJsonParseError as LlmToolUseJsonParseError, delete_credential as llm_delete_credential, get_credential as llm_get_credential, get_env_var as llm_get_env_var, oauth_open_browser as llm_oauth_open_browser, + oauth_send_http_request as llm_oauth_send_http_request, oauth_start_web_auth as llm_oauth_start_web_auth, - request_credential as llm_request_credential, - send_oauth_http_request as llm_oauth_http_request, - store_credential as llm_store_credential, + request_credential as llm_request_credential, store_credential as llm_store_credential, }, zed::extension::nodejs::{ node_binary_path, npm_install_package, npm_package_installed_version, diff --git a/crates/extension_api/wit/since_v0.8.0/llm-provider.wit b/crates/extension_api/wit/since_v0.8.0/llm-provider.wit index a3f1258fc78850603a2a71d6aafecbb52b339a16..dc78c0cde2685482850007930b50635e2b61408c 100644 --- a/crates/extension_api/wit/since_v0.8.0/llm-provider.wit +++ b/crates/extension_api/wit/since_v0.8.0/llm-provider.wit @@ -1,11 +1,11 @@ interface llm-provider { /// Information about a language model provider. record provider-info { - /// Unique identifier for the provider (e.g., "my-extension.my-provider"). + /// Unique identifier for the provider (e.g. "my-extension.my-provider"). id: string, /// Display name for the provider. name: string, - /// Path to an SVG icon file relative to the extension root (e.g., "icons/provider.svg"). + /// Path to an SVG icon file relative to the extension root (e.g. "icons/provider.svg"). icon: option, } @@ -338,7 +338,7 @@ interface llm-provider { /// /// This is a simple HTTP client for OAuth flows, allowing the extension /// to handle token exchange with full control over serialization. - send-oauth-http-request: func(request: oauth-http-request) -> result; + oauth-send-http-request: func(request: oauth-http-request) -> result; /// Open a URL in the user's default browser. /// diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs index a7fc76ffb6d489881dfdc977b0814847e1ea7c00..1774f180edd22d10e17f8cede377a8bd351ed0af 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs @@ -1383,7 +1383,7 @@ impl llm_provider::Host for WasmState { .to_wasmtime_result() } - async fn send_oauth_http_request( + async fn oauth_send_http_request( &mut self, request: llm_provider::OauthHttpRequest, ) -> wasmtime::Result> { diff --git a/extensions/copilot-chat/src/copilot_chat.rs b/extensions/copilot-chat/src/copilot_chat.rs index f0198213a0e523788cb9185957a836b19a8a3827..bdeb59b01d810709a6c73af8b513a8ede00a8dfd 100644 --- a/extensions/copilot-chat/src/copilot_chat.rs +++ b/extensions/copilot-chat/src/copilot_chat.rs @@ -456,7 +456,7 @@ impl zed::Extension for CopilotChatProvider { _provider_id: &str, ) -> Result { // Step 1: Request device and user verification codes - let device_code_response = llm_oauth_http_request(&LlmOauthHttpRequest { + let device_code_response = llm_oauth_send_http_request(&LlmOauthHttpRequest { url: GITHUB_DEVICE_CODE_URL.to_string(), method: "POST".to_string(), headers: vec![ @@ -525,7 +525,7 @@ impl zed::Extension for CopilotChatProvider { for _ in 0..max_attempts { thread::sleep(poll_interval); - let token_response = llm_oauth_http_request(&LlmOauthHttpRequest { + let token_response = llm_oauth_send_http_request(&LlmOauthHttpRequest { url: GITHUB_ACCESS_TOKEN_URL.to_string(), method: "POST".to_string(), headers: vec![