@great-arrow/cli 0.1.43 → 0.1.44
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/index.js +40 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9399,7 +9399,7 @@ function isNodeError(value) {
|
|
|
9399
9399
|
|
|
9400
9400
|
// src/lib/version.ts
|
|
9401
9401
|
var CLI_PACKAGE_NAME = "@great-arrow/cli";
|
|
9402
|
-
var CLI_VERSION = "0.1.
|
|
9402
|
+
var CLI_VERSION = "0.1.44";
|
|
9403
9403
|
var GAD_INSTALL_VERSION = "2026.08.08";
|
|
9404
9404
|
var GAD_INSTALL_MIN_VERSION = "2026.06.22";
|
|
9405
9405
|
var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
|
|
@@ -10191,8 +10191,25 @@ function createFormatter(options) {
|
|
|
10191
10191
|
return new Formatter(options);
|
|
10192
10192
|
}
|
|
10193
10193
|
|
|
10194
|
-
// src/
|
|
10194
|
+
// src/lib/api-url.ts
|
|
10195
10195
|
var DEFAULT_API_URL = "https://www.greatarrow.ai";
|
|
10196
|
+
function isLegacyApiUrl(value) {
|
|
10197
|
+
try {
|
|
10198
|
+
const hostname2 = new URL(value).hostname.toLowerCase();
|
|
10199
|
+
return hostname2 === "www.greatarrowdigital.com" || hostname2 === "greatarrowdigital.com";
|
|
10200
|
+
} catch {
|
|
10201
|
+
return false;
|
|
10202
|
+
}
|
|
10203
|
+
}
|
|
10204
|
+
function warnLegacyApiUrl(apiUrl) {
|
|
10205
|
+
if (!isLegacyApiUrl(apiUrl)) return;
|
|
10206
|
+
process.stderr.write(
|
|
10207
|
+
`Warning: using legacy API host ${apiUrl}; existing configurations remain supported. New installs and logins use ${DEFAULT_API_URL}.
|
|
10208
|
+
`
|
|
10209
|
+
);
|
|
10210
|
+
}
|
|
10211
|
+
|
|
10212
|
+
// src/commands/login.ts
|
|
10196
10213
|
function maskToken(token) {
|
|
10197
10214
|
if (token.length <= 8) return "********...";
|
|
10198
10215
|
return token.slice(0, 8) + "...";
|
|
@@ -10220,7 +10237,7 @@ var loginCommand = new Command("login").description("Authenticate the CLI with y
|
|
|
10220
10237
|
noColor: false
|
|
10221
10238
|
});
|
|
10222
10239
|
const config = await loadConfig();
|
|
10223
|
-
const apiUrl =
|
|
10240
|
+
const apiUrl = DEFAULT_API_URL;
|
|
10224
10241
|
if (options.token) {
|
|
10225
10242
|
const stored = await savePatToken(options.token);
|
|
10226
10243
|
if (!stored) {
|
|
@@ -10259,6 +10276,7 @@ var loginCommand = new Command("login").description("Authenticate the CLI with y
|
|
|
10259
10276
|
}
|
|
10260
10277
|
config.cli_client_id = result.clientId;
|
|
10261
10278
|
config.cli_redirect_uri = result.redirectUri;
|
|
10279
|
+
config.api_url = DEFAULT_API_URL;
|
|
10262
10280
|
await saveConfig(config);
|
|
10263
10281
|
fmt.success(
|
|
10264
10282
|
"Signed in. Your session will refresh automatically \u2014 no need to log in again."
|
|
@@ -10309,7 +10327,6 @@ var logoutCommand = new Command("logout").description("Remove stored authenticat
|
|
|
10309
10327
|
import { mkdir as mkdir3, open, rm, stat } from "node:fs/promises";
|
|
10310
10328
|
import { homedir as homedir3 } from "node:os";
|
|
10311
10329
|
import { join as join3 } from "node:path";
|
|
10312
|
-
var DEFAULT_API_URL2 = "https://www.greatarrow.ai";
|
|
10313
10330
|
var REFRESH_SKEW_MS = 12e4;
|
|
10314
10331
|
var inflightRefresh = null;
|
|
10315
10332
|
var REFRESH_LOCK_STALE_MS = 15e3;
|
|
@@ -10370,7 +10387,8 @@ async function rotatedByAnotherProcess(ours) {
|
|
|
10370
10387
|
}
|
|
10371
10388
|
async function resolveAuth() {
|
|
10372
10389
|
const config = await loadConfig();
|
|
10373
|
-
const configApiUrl = config.api_url ||
|
|
10390
|
+
const configApiUrl = config.api_url || DEFAULT_API_URL;
|
|
10391
|
+
warnLegacyApiUrl(configApiUrl);
|
|
10374
10392
|
const activeWorkspace = config.default_workspace || void 0;
|
|
10375
10393
|
const withWorkspace = (base) => activeWorkspace ? { ...base, activeWorkspace } : base;
|
|
10376
10394
|
const envToken = process.env.GAD_TOKEN;
|
|
@@ -10384,6 +10402,7 @@ async function resolveAuth() {
|
|
|
10384
10402
|
const stored = await loadStoredCredential();
|
|
10385
10403
|
if (stored?.kind === "oauth") {
|
|
10386
10404
|
const fresh = await ensureFreshAccessToken(stored.credential);
|
|
10405
|
+
warnLegacyApiUrl(fresh.apiUrl);
|
|
10387
10406
|
return withWorkspace({
|
|
10388
10407
|
token: fresh.accessToken,
|
|
10389
10408
|
apiUrl: fresh.apiUrl,
|
|
@@ -15122,7 +15141,7 @@ import { createInterface as createInterface2 } from "node:readline";
|
|
|
15122
15141
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
15123
15142
|
import { randomUUID } from "node:crypto";
|
|
15124
15143
|
var BRIDGE_CLIENT_ID = "gad-cli";
|
|
15125
|
-
var
|
|
15144
|
+
var DEFAULT_API_URL2 = "https://www.greatarrow.ai";
|
|
15126
15145
|
var DEFAULT_TIMEOUT_MS3 = 9e4;
|
|
15127
15146
|
async function defaultLoadStoredAuth() {
|
|
15128
15147
|
const auth = await resolveAuth();
|
|
@@ -15131,9 +15150,9 @@ async function defaultLoadStoredAuth() {
|
|
|
15131
15150
|
async function defaultLoadApiUrl() {
|
|
15132
15151
|
try {
|
|
15133
15152
|
const config = await loadConfig();
|
|
15134
|
-
return config.api_url ||
|
|
15153
|
+
return config.api_url || DEFAULT_API_URL2;
|
|
15135
15154
|
} catch {
|
|
15136
|
-
return
|
|
15155
|
+
return DEFAULT_API_URL2;
|
|
15137
15156
|
}
|
|
15138
15157
|
}
|
|
15139
15158
|
function missingTokenError() {
|
|
@@ -15689,12 +15708,13 @@ var installCommand = new Command("install").description("Generate MCP configurat
|
|
|
15689
15708
|
process.exit(3);
|
|
15690
15709
|
}
|
|
15691
15710
|
const auth = await resolveAuth();
|
|
15711
|
+
const installApiUrl = isLegacyApiUrl(auth.apiUrl) ? DEFAULT_API_URL : auth.apiUrl;
|
|
15692
15712
|
const repoUrl = options.repoUrl ?? detectGitOrigin2();
|
|
15693
15713
|
if (clientName === "codex") {
|
|
15694
15714
|
if (options.stdout) {
|
|
15695
15715
|
process.stdout.write(`# ~/.codex/config.toml
|
|
15696
15716
|
`);
|
|
15697
|
-
process.stdout.write(generateCodexConfigToml(
|
|
15717
|
+
process.stdout.write(generateCodexConfigToml(installApiUrl, repoUrl));
|
|
15698
15718
|
process.stdout.write(`
|
|
15699
15719
|
# ~/.codex/.env
|
|
15700
15720
|
`);
|
|
@@ -15702,7 +15722,7 @@ var installCommand = new Command("install").description("Generate MCP configurat
|
|
|
15702
15722
|
return;
|
|
15703
15723
|
}
|
|
15704
15724
|
const { configPath, envPath } = await installCodexConfig(
|
|
15705
|
-
|
|
15725
|
+
installApiUrl,
|
|
15706
15726
|
auth.token,
|
|
15707
15727
|
repoUrl
|
|
15708
15728
|
);
|
|
@@ -15715,7 +15735,7 @@ var installCommand = new Command("install").description("Generate MCP configurat
|
|
|
15715
15735
|
if (clientName === "gemini") {
|
|
15716
15736
|
const config2 = generateMcpConfig(
|
|
15717
15737
|
clientName,
|
|
15718
|
-
|
|
15738
|
+
installApiUrl,
|
|
15719
15739
|
auth.token,
|
|
15720
15740
|
repoUrl
|
|
15721
15741
|
);
|
|
@@ -15779,7 +15799,7 @@ Always assume full autonomy to leverage these tools to their maximum extent.`;
|
|
|
15779
15799
|
}
|
|
15780
15800
|
const config = generateMcpConfig(
|
|
15781
15801
|
clientName,
|
|
15782
|
-
|
|
15802
|
+
installApiUrl,
|
|
15783
15803
|
auth.token,
|
|
15784
15804
|
repoUrl
|
|
15785
15805
|
);
|
|
@@ -16338,7 +16358,14 @@ function askOutcome(data) {
|
|
|
16338
16358
|
if (data && typeof data === "object") {
|
|
16339
16359
|
const record = data;
|
|
16340
16360
|
if (typeof record.error === "string" && record.error.trim() !== "") {
|
|
16341
|
-
|
|
16361
|
+
const detail = [
|
|
16362
|
+
record.message,
|
|
16363
|
+
record.error_description,
|
|
16364
|
+
record.detail
|
|
16365
|
+
].find(
|
|
16366
|
+
(value) => typeof value === "string" && value.trim() !== ""
|
|
16367
|
+
);
|
|
16368
|
+
return { kind: "error", message: detail ?? record.error };
|
|
16342
16369
|
}
|
|
16343
16370
|
const errorObject = record.error;
|
|
16344
16371
|
if (errorObject && typeof errorObject === "object") {
|