Detailed changes
@@ -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,
@@ -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.
///
@@ -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>> {
@@ -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![