copilot-api-plus 1.2.3 → 1.2.4
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.
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as forwardError, t as HTTPError } from "./error-CvwUkoEo.js";
|
|
3
|
-
import { _ as ensurePaths, a as stopCopilotTokenRefresh, c as accountManager, d as cacheVSCodeVersion, f as findModel, g as PATHS, h as sleep, i as setupGitHubToken, l as getCopilotUsage, m as rootCause, n as refreshCopilotToken, o as pollAccessToken, p as isNullish, r as setupCopilotToken, s as getDeviceCode, t as clearGithubToken, u as cacheModels } from "./token-
|
|
3
|
+
import { _ as ensurePaths, a as stopCopilotTokenRefresh, c as accountManager, d as cacheVSCodeVersion, f as findModel, g as PATHS, h as sleep, i as setupGitHubToken, l as getCopilotUsage, m as rootCause, n as refreshCopilotToken, o as pollAccessToken, p as isNullish, r as setupCopilotToken, s as getDeviceCode, t as clearGithubToken, u as cacheModels } from "./token-CMRVLQJZ.js";
|
|
4
4
|
import { a as GITHUB_BASE_URL, c as copilotHeaders, n as state, o as GITHUB_CLIENT_ID, s as copilotBaseUrl, u as standardHeaders } from "./get-user-BT7hEyDN.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { defineCommand, runMain } from "citty";
|
|
@@ -1865,7 +1865,8 @@ async function createWithSingleAccount(payload) {
|
|
|
1865
1865
|
body: bodyString
|
|
1866
1866
|
});
|
|
1867
1867
|
} catch (refreshError) {
|
|
1868
|
-
consola.
|
|
1868
|
+
consola.warn(`Failed to refresh token: ${rootCause(refreshError)}`);
|
|
1869
|
+
consola.debug("Failed to refresh token:", refreshError);
|
|
1869
1870
|
}
|
|
1870
1871
|
}
|
|
1871
1872
|
if (!response.ok) {
|
|
@@ -3058,7 +3059,7 @@ async function runServer(options) {
|
|
|
3058
3059
|
const { HTTPError } = await import("./error-DLqcVQL_.js");
|
|
3059
3060
|
if (error instanceof HTTPError && error.response.status === 401) {
|
|
3060
3061
|
consola.error("Failed to get Copilot token - GitHub token may be invalid or Copilot access revoked");
|
|
3061
|
-
const { clearGithubToken } = await import("./token-
|
|
3062
|
+
const { clearGithubToken } = await import("./token-CHJ7rYg0.js");
|
|
3062
3063
|
await clearGithubToken();
|
|
3063
3064
|
consola.info("Please restart to re-authenticate");
|
|
3064
3065
|
}
|