Rename oauth to be at the front of oauth_send_http_request

Richard Feldman created

Change summary

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(-)

Detailed changes

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,

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<string>,
     }
 
@@ -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-http-response, string>;
+    oauth-send-http-request: func(request: oauth-http-request) -> result<oauth-http-response, string>;
 
     /// Open a URL in the user's default browser.
     ///

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<Result<llm_provider::OauthHttpResponse, String>> {

extensions/copilot-chat/src/copilot_chat.rs 🔗

@@ -456,7 +456,7 @@ impl zed::Extension for CopilotChatProvider {
         _provider_id: &str,
     ) -> Result<String, String> {
         // 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![