@@ -2,26 +2,26 @@ import * as vscode from "vscode";
22
33import { formatRelativeTime } from "mux/browser/utils/ui/dateTime" ;
44
5- import { getAllWorkspacesFromFiles , getAllWorkspacesFromOrpc , WorkspaceWithContext } from "./muxConfig" ;
6- import { checkAuth , checkServerReachable } from "./orpc /connectionCheck" ;
7- import { createVscodeORPCClient } from "./orpc /client" ;
5+ import { getAllWorkspacesFromFiles , getAllWorkspacesFromApi , WorkspaceWithContext } from "./muxConfig" ;
6+ import { checkAuth , checkServerReachable } from "./api /connectionCheck" ;
7+ import { createApiClient } from "./api /client" ;
88import {
99 clearAuthTokenOverride ,
1010 discoverServerConfig ,
1111 getConnectionModeSetting ,
1212 storeAuthTokenOverride ,
1313 type ConnectionMode ,
14- } from "./orpc /discovery" ;
14+ } from "./api /discovery" ;
1515import { openWorkspace } from "./workspaceOpener" ;
1616
17- let sessionPreferredMode : "orpc " | "file" | null = null ;
17+ let sessionPreferredMode : "api " | "file" | null = null ;
1818let didShowFallbackPrompt = false ;
1919
2020const ACTION_FIX_CONNECTION_CONFIG = "Fix connection config" ;
2121const ACTION_USE_LOCAL_FILES = "Use local file access" ;
2222const ACTION_CANCEL = "Cancel" ;
2323
24- type OrpcConnectionFailure =
24+ type ApiConnectionFailure =
2525 | { kind : "unreachable" ; baseUrl : string ; error : string }
2626 | { kind : "unauthorized" ; baseUrl : string ; error : string }
2727 | { kind : "error" ; baseUrl : string ; error : string } ;
@@ -30,7 +30,7 @@ function formatError(error: unknown): string {
3030 return error instanceof Error ? error . message : String ( error ) ;
3131}
3232
33- function describeFailure ( failure : OrpcConnectionFailure ) : string {
33+ function describeFailure ( failure : ApiConnectionFailure ) : string {
3434 switch ( failure . kind ) {
3535 case "unreachable" :
3636 return `mux server is not reachable at ${ failure . baseUrl } ` ;
@@ -41,19 +41,19 @@ function describeFailure(failure: OrpcConnectionFailure): string {
4141 }
4242}
4343
44- function getWarningSuffix ( failure : OrpcConnectionFailure ) : string {
44+ function getWarningSuffix ( failure : ApiConnectionFailure ) : string {
4545 if ( failure . kind === "unauthorized" ) {
4646 return "Using local file access while mux is running can cause inconsistencies." ;
4747 }
4848 return "Using local file access can cause inconsistencies." ;
4949}
5050
51- async function tryGetWorkspacesFromOrpc (
51+ async function tryGetWorkspacesFromApi (
5252 context : vscode . ExtensionContext
53- ) : Promise < { workspaces : WorkspaceWithContext [ ] } | { failure : OrpcConnectionFailure } > {
53+ ) : Promise < { workspaces : WorkspaceWithContext [ ] } | { failure : ApiConnectionFailure } > {
5454 try {
5555 const discovery = await discoverServerConfig ( context ) ;
56- const client = createVscodeORPCClient ( { baseUrl : discovery . baseUrl , authToken : discovery . authToken } ) ;
56+ const client = createApiClient ( { baseUrl : discovery . baseUrl , authToken : discovery . authToken } ) ;
5757
5858 const reachable = await checkServerReachable ( discovery . baseUrl ) ;
5959 if ( reachable . status !== "ok" ) {
@@ -86,7 +86,7 @@ async function tryGetWorkspacesFromOrpc(
8686 } ;
8787 }
8888
89- const workspaces = await getAllWorkspacesFromOrpc ( client ) ;
89+ const workspaces = await getAllWorkspacesFromApi ( client ) ;
9090 return { workspaces } ;
9191 } catch ( error ) {
9292 return {
@@ -109,13 +109,13 @@ async function getWorkspacesForCommand(
109109 return getAllWorkspacesFromFiles ( ) ;
110110 }
111111
112- const orpcResult = await tryGetWorkspacesFromOrpc ( context ) ;
113- if ( "workspaces" in orpcResult ) {
114- sessionPreferredMode = "orpc " ;
115- return orpcResult . workspaces ;
112+ const apiResult = await tryGetWorkspacesFromApi ( context ) ;
113+ if ( "workspaces" in apiResult ) {
114+ sessionPreferredMode = "api " ;
115+ return apiResult . workspaces ;
116116 }
117117
118- const failure = orpcResult . failure ;
118+ const failure = apiResult . failure ;
119119
120120 if ( modeSetting === "server-only" ) {
121121 const selection = await vscode . window . showErrorMessage (
@@ -159,9 +159,9 @@ async function getWorkspacesForCommand(
159159
160160 await configureConnectionCommand ( context ) ;
161161
162- const retry = await tryGetWorkspacesFromOrpc ( context ) ;
162+ const retry = await tryGetWorkspacesFromApi ( context ) ;
163163 if ( "workspaces" in retry ) {
164- sessionPreferredMode = "orpc " ;
164+ sessionPreferredMode = "api " ;
165165 return retry . workspaces ;
166166 }
167167
0 commit comments