@github/copilot-language-server 1.565.3 → 1.565.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,25 +5,49 @@
5
5
  import {
6
6
  runActivationCli,
7
7
  runSessionStartActivation,
8
+ verifyBrowserConnection,
8
9
  waitForBrowserConnection,
9
10
  } from "./nativeMessagingRegistration.mjs";
10
11
 
11
12
  const args = process.argv.slice(2);
12
13
  const sessionStart = args.length === 1 && args[0] === "--session-start";
13
14
  if (sessionStart) {
14
- const activated = await runSessionStartActivation();
15
- if (activated) {
15
+ const outcome = await runSessionStartActivation();
16
+ if (shouldVerifyConnection(outcome)) {
16
17
  await waitForBrowserConnection();
17
18
  }
18
19
  process.exitCode = 0;
19
20
  } else {
20
- const activated = await runActivationCli(args);
21
- if (activated) {
22
- const connected = await waitForBrowserConnection();
23
- console.log(
24
- connected
25
- ? "Browser runtime connected with a compatible RPC version."
26
- : "Browser runtime not connected. Run /browser-use:doctor for details.",
27
- );
21
+ const outcome = await runActivationCli(args);
22
+ if (shouldVerifyConnection(outcome)) {
23
+ await waitForBrowserConnection();
24
+ try {
25
+ const { runDoctorCli } = await import("./doctor.mjs");
26
+ const report = await runDoctorCli([]);
27
+ const available = await verifyBrowserConnection();
28
+ if (available && report.status !== "fail") {
29
+ console.log("Browser runtime connected with a compatible RPC version.");
30
+ console.log("Browser activation verified. Browser is available.");
31
+ } else {
32
+ console.error(
33
+ "[copilot-browser] Browser verification failed. Browser registration remains installed.",
34
+ );
35
+ console.error(
36
+ available
37
+ ? "Follow the diagnostics above to complete Browser setup."
38
+ : "No compatible Browser connection was confirmed. Follow the diagnostics above and open Chrome or Edge with the matching extension enabled.",
39
+ );
40
+ process.exitCode = 1;
41
+ }
42
+ } catch (error) {
43
+ console.error(
44
+ "[copilot-browser] Browser verification could not complete. Browser registration remains installed. Reinstall the plugin and run /browser-use:doctor.",
45
+ );
46
+ throw error;
47
+ }
28
48
  }
29
49
  }
50
+
51
+ function shouldVerifyConnection(outcome) {
52
+ return outcome && outcome.status !== "repair_required";
53
+ }
@@ -0,0 +1,59 @@
1
+ export type BrowserPrerequisiteStatus = "pass" | "warn" | "fail";
2
+
3
+ export interface BrowserPrerequisiteCheck {
4
+ id: string;
5
+ status: BrowserPrerequisiteStatus;
6
+ message: string;
7
+ }
8
+
9
+ export interface BrowserExtensionState {
10
+ state: "enabled" | "disabled" | "unknown";
11
+ version?: string;
12
+ rpcVersion?: number;
13
+ protocolRange?: string;
14
+ protocolMetadataInvalid?: boolean;
15
+ }
16
+
17
+ export interface BrowserExtensionInstallUrls {
18
+ chromeWebStore?: string;
19
+ }
20
+
21
+ export function diagnoseInstalledExtensions(
22
+ extensionId: string,
23
+ extensionInstallUrls?: BrowserExtensionInstallUrls,
24
+ ): Promise<{ checks: BrowserPrerequisiteCheck[]; states: BrowserExtensionState[] }>;
25
+
26
+ export function classifyInstalledExtensionChecks(
27
+ states: BrowserExtensionState[],
28
+ browserStatus: BrowserPrerequisiteStatus,
29
+ extensionInstallUrls?: BrowserExtensionInstallUrls,
30
+ ): BrowserPrerequisiteCheck[];
31
+
32
+ export function classifyExtensionInstallations(
33
+ states: BrowserExtensionState[],
34
+ browserStatus: BrowserPrerequisiteStatus,
35
+ extensionInstallUrls?: BrowserExtensionInstallUrls,
36
+ ): BrowserPrerequisiteCheck;
37
+
38
+ export function classifyExtensionVersions(
39
+ states: BrowserExtensionState[],
40
+ ): BrowserPrerequisiteCheck;
41
+
42
+ export function classifyExtensionRpcVersions(
43
+ states: BrowserExtensionState[],
44
+ ): BrowserPrerequisiteCheck;
45
+
46
+ export function firstIncompatibleExtensionProtocolRange(
47
+ states: BrowserExtensionState[],
48
+ pluginRange: string,
49
+ ): string | undefined;
50
+
51
+ export function allEnabledExtensionsSupportProtocolRange(
52
+ states: BrowserExtensionState[],
53
+ pluginRange: string,
54
+ ): boolean;
55
+
56
+ export function readExtensionStates(
57
+ profileRoots: string[],
58
+ extensionId: string,
59
+ ): Promise<BrowserExtensionState[]>;