@juanbenjumea/pi-agy 0.5.7 → 0.5.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.9
4
+
5
+ - Parse the real agy 1.2.6 `/usage` schema (`command.data.groups[].buckets[]`): usage groups carry the model family in `name`, which the quota reader now honors — live runs previously fell back to dumping the raw JSON envelope and reported `quota_status: unknown`. Found by an end-to-end run against the real CLI.
6
+ - Skip disabled quota buckets (a limit not in effect carries no availability signal) and normalize window spellings (`5h` → `five-hour`) across CLI versions.
7
+
8
+ ## 0.5.8
9
+
10
+ - Port the platform-aware install hint from upstream 0.3.4: Windows `ENOENT` errors now point at the PowerShell installer instead of a bash one-liner. (Upstream's other recent changes are already covered here independently: the non-string `response` guard in `parseJsonResponse`, and the live `agy models` catalog supersedes static model-map bumps.)
11
+
3
12
  ## 0.5.7
4
13
 
5
14
  - Documentation: add a "Timeouts & cancellation" section to the README covering deadline-preserving semantics (delivered results survive, post-run steps skip with notes, conversations stay resumable after timeout/cancel); note the Node >= 20.3 requirement; refresh the upstream-comparison table and skill bullets.
@@ -21,7 +21,12 @@ import {
21
21
  export { detectVerifyCommand } from "./verify.js";
22
22
  export { parseJsonResponse } from "./parse.js";
23
23
 
24
- const INSTALL_HINT = "Install agy: curl -fsSL https://antigravity.google/cli/install.sh | bash";
24
+ // Ported from upstream pi-agy 0.3.4: Windows ENOENT errors must not suggest
25
+ // a bash one-liner.
26
+ const INSTALL_HINT =
27
+ process.platform === "win32"
28
+ ? "Install agy: irm https://antigravity.google/cli/install.ps1 | iex"
29
+ : "Install agy: curl -fsSL https://antigravity.google/cli/install.sh | bash";
25
30
 
26
31
  export type AgyModel =
27
32
  | "flash-low"
@@ -405,6 +410,10 @@ const MODEL_FIELD_KEYS = [
405
410
  "group",
406
411
  "family",
407
412
  "pool",
413
+ // agy 1.2.6 usage groups carry the family in `name` ("Gemini Models",
414
+ // "Claude and GPT models"); the looksLikeModelName gate rejects the
415
+ // non-model names ("Weekly Limit Remaining", "usage", …) that also use it.
416
+ "name",
408
417
  ];
409
418
  const REMAINING_FRACTION_KEYS = [
410
419
  "remainingFraction",
@@ -649,7 +658,10 @@ function readQuotaEntry(
649
658
  value: Record<string, unknown>,
650
659
  hintedWindow?: string,
651
660
  ): AgyQuotaEntry | undefined {
652
- const window = readString(value, WINDOW_KEYS) ?? hintedWindow;
661
+ // Normalize window spellings ("5h" → "five-hour") so reports and merge
662
+ // keys stay consistent across CLI versions.
663
+ const rawWindow = readString(value, WINDOW_KEYS);
664
+ const window = (rawWindow ? quotaWindowName(rawWindow) ?? rawWindow : undefined) ?? hintedWindow;
653
665
  const fraction = readNumber(value, REMAINING_FRACTION_KEYS);
654
666
  const percent = readNumber(value, REMAINING_PERCENT_KEYS);
655
667
  const normalizedFraction = fraction ?? (percent !== undefined ? percent / 100 : undefined);
@@ -659,11 +671,14 @@ function readQuotaEntry(
659
671
  const exhausted =
660
672
  value.exhausted === true || value.isExhausted === true || value.is_exhausted === true;
661
673
  if (
662
- normalizedFraction === undefined &&
663
- requests === undefined &&
664
- tokens === undefined &&
665
- !reset &&
666
- !exhausted
674
+ // A disabled limit is not in effect and carries no availability signal —
675
+ // recording its remaining fraction would mislead model selection.
676
+ value.disabled === true ||
677
+ (normalizedFraction === undefined &&
678
+ requests === undefined &&
679
+ tokens === undefined &&
680
+ !reset &&
681
+ !exhausted)
667
682
  ) {
668
683
  return undefined;
669
684
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juanbenjumea/pi-agy",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Enhanced Antigravity CLI (agy) bridge for Pi — streaming progress, conversation continuity, repo-aware verify, and diff summaries.",
5
5
  "type": "module",
6
6
  "license": "MIT",