@@ -257,33 +257,38 @@ export function getUserAgent(
257257}
258258
259259/**
260- * All the types of ENVs the extension can run in.
260+ * Kinds of machines/environments the extension can run in.
261261 *
262262 * NOTES:
263- * - append `-amzn` for any environment internal to Amazon
263+ * - Append `-amzn` for any environment internal to Amazon.
264+ * - Append `-web` for web browser (*without* compute).
264265 */
265266export type EnvType =
266267 | 'cloud9'
268+ | 'cloud9-web'
267269 | 'cloudDesktop-amzn'
268270 | 'codecatalyst'
269- | 'local'
270271 | 'ec2'
271272 | 'ec2-amzn' // ec2 but with an internal Amazon OS
273+ | 'local'
272274 | 'sagemaker'
275+ | 'sagemaker-web'
273276 | 'test'
277+ | 'remote' // Generic (unknown) remote env.
278+ | 'web' // Generic (unknown) web env.
274279 | 'wsl'
275- | 'unknown'
276280
277281/**
278282 * Returns the identifier for the environment that the extension is running in.
279283 */
280284export async function getComputeEnvType ( ) : Promise < EnvType > {
285+ const web = isWeb ( )
281286 if ( isCloud9 ( ) ) {
282- return 'cloud9'
287+ return web ? 'cloud9-web' : 'cloud9'
283288 } else if ( isInDevEnv ( ) ) {
284289 return 'codecatalyst'
285290 } else if ( isSageMaker ( ) ) {
286- return 'sagemaker'
291+ return web ? 'sagemaker-web' : 'sagemaker'
287292 } else if ( isRemoteWorkspace ( ) ) {
288293 if ( isAmazonInternalOs ( ) ) {
289294 if ( await isCloudDesktop ( ) ) {
@@ -292,14 +297,16 @@ export async function getComputeEnvType(): Promise<EnvType> {
292297 return 'ec2-amzn'
293298 }
294299 return 'ec2'
295- } else if ( env . remoteName ) {
300+ } else if ( env . remoteName === 'wsl' ) {
296301 return 'wsl'
297302 } else if ( isAutomation ( ) ) {
298303 return 'test'
299- } else if ( ! env . remoteName ) {
300- return 'local'
304+ } else if ( web ) {
305+ return 'web'
306+ } else if ( env . remoteName ) {
307+ return 'remote' // Generic (unknown) remote env.
301308 } else {
302- return 'unknown'
309+ return 'local' // Generic (unknown) local env.
303310 }
304311}
305312
0 commit comments