@great-arrow/cli 0.1.56 → 0.1.58

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 +120 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9402,7 +9402,7 @@ function isNodeError(value) {
9402
9402
 
9403
9403
  // src/lib/version.ts
9404
9404
  var CLI_PACKAGE_NAME = "@great-arrow/cli";
9405
- var CLI_VERSION = "0.1.56";
9405
+ var CLI_VERSION = "0.1.58";
9406
9406
  var GAD_INSTALL_VERSION = "2026.08.08";
9407
9407
  var GAD_INSTALL_MIN_VERSION = "2026.06.22";
9408
9408
  var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
@@ -17697,6 +17697,24 @@ function normalizeGlance(raw) {
17697
17697
  goalUrl: typeof h.goalUrl === "string" ? h.goalUrl : null
17698
17698
  } : null;
17699
17699
  })(),
17700
+ ...(() => {
17701
+ const raw2 = obj.landing;
17702
+ if (typeof raw2 !== "object" || raw2 === null) return {};
17703
+ const l = raw2;
17704
+ const repos = asArray2(l.repos).flatMap((r) => {
17705
+ if (typeof r !== "object" || r === null) return [];
17706
+ const row = r;
17707
+ return typeof row.repo === "string" ? [
17708
+ {
17709
+ repo: row.repo,
17710
+ lines: asArray2(row.lines).filter(
17711
+ (x) => typeof x === "string"
17712
+ )
17713
+ }
17714
+ ] : [];
17715
+ });
17716
+ return repos.length > 0 ? { landing: { alertActive: l.alertActive === true, repos } } : {};
17717
+ })(),
17700
17718
  ...Array.isArray(obj.sections) ? { sections: normalizeTodaySections(obj.sections) } : {},
17701
17719
  ...Array.isArray(obj.degradedSections) ? {
17702
17720
  degradedSections: obj.degradedSections.filter(
@@ -19147,7 +19165,7 @@ function renderStatus2(payload, plain, apiUrl) {
19147
19165
  lines.push(c.badge(` ${payload.workspace} `));
19148
19166
  lines.push("");
19149
19167
  }
19150
- 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;
19168
+ const hasAny = payload.needsYou.length > 0 || payload.topGoal !== null || payload.integrations.length > 0 || payload.agents.length > 0 || Boolean(payload.healthTriage) || Boolean(payload.landing) || payload.warRoom !== null && payload.warRoom.priorityCount > 0;
19151
19169
  if (!hasAny) {
19152
19170
  lines.push(
19153
19171
  `${c.green("\u2713")} You're all clear \u2014 nothing needs you right now.`
@@ -19205,6 +19223,17 @@ function renderStatus2(payload, plain, apiUrl) {
19205
19223
  if (url) lines.push(` ${c.dim("\u2192")} ${link("Open the Goal", url)}`);
19206
19224
  lines.push("");
19207
19225
  }
19226
+ if (payload.landing) {
19227
+ lines.push(c.bold("Merge queue"));
19228
+ for (const r of payload.landing.repos) {
19229
+ lines.push(` ${r.repo}`);
19230
+ for (const l of r.lines) lines.push(` ${l}`);
19231
+ }
19232
+ const url = glanceItemUrl("/work/pipeline", apiUrl);
19233
+ if (url)
19234
+ lines.push(` ${c.dim("\u2192")} ${link("Open the Dev Pipeline", url)}`);
19235
+ lines.push("");
19236
+ }
19208
19237
  if (payload.integrations.length > 0) {
19209
19238
  lines.push(c.bold("Stale integrations"));
19210
19239
  for (const integration of payload.integrations) {
@@ -19469,6 +19498,94 @@ function discoverCommand() {
19469
19498
  });
19470
19499
  }
19471
19500
 
19501
+ // src/lib/call-args.ts
19502
+ var AUTH_ERROR_CODES = /* @__PURE__ */ new Set([
19503
+ "unauthorized",
19504
+ "forbidden",
19505
+ "insufficient_scope",
19506
+ "auth_required"
19507
+ ]);
19508
+ function parseCallArgs(raw) {
19509
+ if (raw === void 0 || raw.trim() === "") return {};
19510
+ let parsed;
19511
+ try {
19512
+ parsed = JSON.parse(raw);
19513
+ } catch {
19514
+ throw new CliError(
19515
+ "--args is not valid JSON.",
19516
+ 3 /* VALIDATION_ERROR */,
19517
+ `Pass an object, e.g. --args '{"query":"pricing"}'.`
19518
+ );
19519
+ }
19520
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
19521
+ throw new CliError(
19522
+ "--args must be a JSON object.",
19523
+ 3 /* VALIDATION_ERROR */,
19524
+ `Pass an object, e.g. --args '{"query":"pricing"}'.`
19525
+ );
19526
+ }
19527
+ return parsed;
19528
+ }
19529
+ function callFailure(result) {
19530
+ if (typeof result !== "object" || result === null) return null;
19531
+ const record = result;
19532
+ const message = typeof record.message === "string" ? record.message : "";
19533
+ if (typeof record.error === "string" && record.error.trim() !== "") {
19534
+ return {
19535
+ code: record.error,
19536
+ message: message || `Request failed: ${record.error}`
19537
+ };
19538
+ }
19539
+ if (typeof record.error === "object" && record.error !== null) {
19540
+ const inner = record.error;
19541
+ const code = typeof inner.code === "string" ? inner.code : "error";
19542
+ const innerMessage = typeof inner.message === "string" ? inner.message : message;
19543
+ return { code, message: innerMessage || `Request failed: ${code}` };
19544
+ }
19545
+ if (record.ok === false || record.isError === true) {
19546
+ return {
19547
+ code: "error",
19548
+ message: message || "The tool reported a failure."
19549
+ };
19550
+ }
19551
+ return null;
19552
+ }
19553
+ function gadCallArgs(tool, args) {
19554
+ return { tool_name: tool, args };
19555
+ }
19556
+
19557
+ // src/commands/call.ts
19558
+ function callCommand() {
19559
+ return new Command("call").description("Call any Great Arrow tool by name (see 'gad discover')").argument("<tool>", "Tool name, e.g. memory_search").option("--args <json>", "Tool arguments as a JSON object").option("--json", "Output as JSON").action(async (tool, opts, command) => {
19560
+ const g = globalOutputOpts(command);
19561
+ const args = parseCallArgs(opts.args);
19562
+ const auth = await resolveAuth();
19563
+ const client = new GadClient({
19564
+ token: auth.token,
19565
+ getToken: auth.getToken,
19566
+ apiUrl: auth.apiUrl
19567
+ });
19568
+ const result = await client.mcpCall("gad_call", gadCallArgs(tool, args));
19569
+ const failure = callFailure(result);
19570
+ if (failure) {
19571
+ throw new CliError(
19572
+ `${tool}: ${failure.message}`,
19573
+ AUTH_ERROR_CODES.has(failure.code) ? 1 /* AUTH_ERROR */ : 3 /* VALIDATION_ERROR */,
19574
+ failure.code === "unknown_tool" ? `Find the exact name with 'gad discover' or 'gad call tools_discover --args '{"query":"..."}''.` : void 0
19575
+ );
19576
+ }
19577
+ if (typeof result === "string") {
19578
+ process.stdout.write(result.endsWith("\n") ? result : `${result}
19579
+ `);
19580
+ return;
19581
+ }
19582
+ process.stdout.write(
19583
+ `${g.json ? JSON.stringify(result) : JSON.stringify(result, null, 2)}
19584
+ `
19585
+ );
19586
+ });
19587
+ }
19588
+
19472
19589
  // src/lib/completions.ts
19473
19590
  var COMMANDS = [
19474
19591
  "login",
@@ -23111,6 +23228,7 @@ program2.addCommand(workspace_default);
23111
23228
  program2.addCommand(todo_default);
23112
23229
  program2.addCommand(nextCommand());
23113
23230
  program2.addCommand(discoverCommand());
23231
+ program2.addCommand(callCommand());
23114
23232
  program2.addCommand(claim_default);
23115
23233
  program2.addCommand(work_default());
23116
23234
  program2.addCommand(worktree_default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-arrow/cli",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "GreatArrow.ai CLI tool",
5
5
  "type": "module",
6
6
  "bin": {