@great-arrow/cli 0.1.42 → 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.
Files changed (2) hide show
  1. package/dist/index.js +59 -14
  2. 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.42";
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/commands/login.ts
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 = config.api_url || DEFAULT_API_URL;
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 || DEFAULT_API_URL2;
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 DEFAULT_API_URL3 = "https://www.greatarrow.ai";
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 || DEFAULT_API_URL3;
15153
+ return config.api_url || DEFAULT_API_URL2;
15135
15154
  } catch {
15136
- return DEFAULT_API_URL3;
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(auth.apiUrl, repoUrl));
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
- auth.apiUrl,
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
- auth.apiUrl,
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
- auth.apiUrl,
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
- return { kind: "error", message: record.error };
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") {
@@ -16687,6 +16714,16 @@ function normalizeGlance(raw) {
16687
16714
  const sp = raw2;
16688
16715
  return typeof sp.line === "string" && sp.line !== "" && typeof sp.totalCostUsd === "number" && Number.isFinite(sp.totalCostUsd) ? { line: sp.line, totalCostUsd: sp.totalCostUsd } : null;
16689
16716
  })(),
16717
+ healthTriage: (() => {
16718
+ const raw2 = obj.healthTriage;
16719
+ if (typeof raw2 !== "object" || raw2 === null) return null;
16720
+ const h = raw2;
16721
+ return typeof h.summaryLine === "string" && h.summaryLine !== "" ? {
16722
+ summaryLine: h.summaryLine,
16723
+ incomplete: h.incomplete === true,
16724
+ goalUrl: typeof h.goalUrl === "string" ? h.goalUrl : null
16725
+ } : null;
16726
+ })(),
16690
16727
  ...Array.isArray(obj.sections) ? { sections: normalizeTodaySections(obj.sections) } : {},
16691
16728
  ...Array.isArray(obj.degradedSections) ? {
16692
16729
  degradedSections: obj.degradedSections.filter(
@@ -18113,7 +18150,7 @@ function renderStatus2(payload, plain, apiUrl) {
18113
18150
  lines.push(c.badge(` ${payload.workspace} `));
18114
18151
  lines.push("");
18115
18152
  }
18116
- const hasAny = payload.needsYou.length > 0 || payload.topGoal !== null || payload.integrations.length > 0 || payload.agents.length > 0 || payload.warRoom !== null && payload.warRoom.priorityCount > 0;
18153
+ const hasAny = payload.needsYou.length > 0 || payload.topGoal !== null || payload.integrations.length > 0 || payload.agents.length > 0 || Boolean(payload.healthTriage) || payload.warRoom !== null && payload.warRoom.priorityCount > 0;
18117
18154
  if (!hasAny) {
18118
18155
  lines.push(
18119
18156
  `${c.green("\u2713")} You're all clear \u2014 nothing needs you right now.`
@@ -18163,6 +18200,14 @@ function renderStatus2(payload, plain, apiUrl) {
18163
18200
  lines.push(` ${c.dim("\u2192")} ${c.cyan("gad todo list")}`);
18164
18201
  lines.push("");
18165
18202
  }
18203
+ if (payload.healthTriage) {
18204
+ const h = payload.healthTriage;
18205
+ lines.push(c.bold("Platform health"));
18206
+ lines.push(` ${h.incomplete ? `${c.yellow("!")} ` : ""}${h.summaryLine}`);
18207
+ const url = glanceItemUrl(h.goalUrl, apiUrl);
18208
+ if (url) lines.push(` ${c.dim("\u2192")} ${link("Open the Goal", url)}`);
18209
+ lines.push("");
18210
+ }
18166
18211
  if (payload.integrations.length > 0) {
18167
18212
  lines.push(c.bold("Stale integrations"));
18168
18213
  for (const integration of payload.integrations) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-arrow/cli",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "GreatArrow.ai CLI tool",
5
5
  "type": "module",
6
6
  "bin": {