jonah-fleet 1.32.0 → 1.33.0
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 +8 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/index.js +401 -75
- package/dist/lib/runner.d.ts +3 -1
- package/dist/lib/runner.d.ts.map +1 -1
- package/dist/lib/telemetry.d.ts +59 -0
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/terminal-card.d.ts +4 -2
- package/dist/lib/terminal-card.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to `jonah-fleet` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.33.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.32.0...v1.33.0) (2026-10-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **telemetry,status,runner:** discover and report real-time provider plan quota ([#625](https://github.com/Jonah-Projects/jonah-fleet/issues/625)) ([d317b28](https://github.com/Jonah-Projects/jonah-fleet/commit/d317b28c0622fff0ba540af56f2275fd59a96a09))
|
|
14
|
+
|
|
8
15
|
## [1.32.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.31.7...v1.32.0) (2026-10-03)
|
|
9
16
|
|
|
10
17
|
|
|
@@ -23,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
23
30
|
|
|
24
31
|
### Features
|
|
25
32
|
|
|
33
|
+
* **telemetry,status,runner,terminal-card:** discover and report real-time provider plan quota (5h rolling and weekly limits with reset countdowns for Gemini and 3P models) via `agy --output-format json --print /quota` with 1-minute TTL disk caching
|
|
26
34
|
* **telemetry,runner,terminal-card,status:** report token consumption and 5-hour/weekly quota percentages on each run, terminal summary card, run report, status pacing section, and persist run usage to artifacts
|
|
27
35
|
* **telemetry,terminal-card,runner:** address peer review findings on PR #617: prioritize artifact timestamp over file mtime, prevent pacing status cross-contamination across rolling windows, render token quota section in error cards, and consolidate canonical `RunUsageMetrics`
|
|
28
36
|
* **runner,daemon:** scope skill discovery by routine to eliminate context bloat, add fast-path merge mode for approved PRs with green CI, and calibrate `peer-review` and `optimizer` to `gemini-3.8-flash-medium`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyO1E"}
|
package/dist/index.js
CHANGED
|
@@ -1448,14 +1448,17 @@ import pc3 from "picocolors";
|
|
|
1448
1448
|
// src/lib/terminal-card.ts
|
|
1449
1449
|
import fs7 from "fs";
|
|
1450
1450
|
import path7 from "path";
|
|
1451
|
-
import { execFileSync, execFile as
|
|
1452
|
-
import { promisify as
|
|
1451
|
+
import { execFileSync, execFile as execFile3 } from "child_process";
|
|
1452
|
+
import { promisify as promisify3 } from "util";
|
|
1453
1453
|
import pc2 from "picocolors";
|
|
1454
1454
|
|
|
1455
1455
|
// src/lib/telemetry.ts
|
|
1456
1456
|
import fs6 from "fs";
|
|
1457
1457
|
import path6 from "path";
|
|
1458
|
+
import { execSync, execFile as execFile2 } from "child_process";
|
|
1459
|
+
import { promisify as promisify2 } from "util";
|
|
1458
1460
|
import pc from "picocolors";
|
|
1461
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
1459
1462
|
var GLOBAL_WEEKLY_TOKEN_BUDGET = 875e4;
|
|
1460
1463
|
var GLOBAL_5H_TOKEN_BUDGET = 2e6;
|
|
1461
1464
|
function formatQuotaStatusBadge(status) {
|
|
@@ -1553,6 +1556,260 @@ function getRollingWindowTokenUsage(repoRoot, options = {}) {
|
|
|
1553
1556
|
status
|
|
1554
1557
|
};
|
|
1555
1558
|
}
|
|
1559
|
+
function parseAgyQuotaOutput(raw) {
|
|
1560
|
+
if (!raw || typeof raw !== "string") {
|
|
1561
|
+
return {
|
|
1562
|
+
available: false,
|
|
1563
|
+
groups: {},
|
|
1564
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
if (raw.includes("not logged into Antigravity") || raw.includes("error getting token source") || raw.includes("not authenticated")) {
|
|
1568
|
+
return {
|
|
1569
|
+
available: false,
|
|
1570
|
+
groups: {},
|
|
1571
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1572
|
+
error: "Not logged into Antigravity"
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
let jsonData = null;
|
|
1576
|
+
try {
|
|
1577
|
+
const trimmed = raw.trim();
|
|
1578
|
+
if (trimmed.startsWith("{") && trimmed.endsWith("}")) {
|
|
1579
|
+
jsonData = JSON.parse(trimmed);
|
|
1580
|
+
}
|
|
1581
|
+
} catch {
|
|
1582
|
+
}
|
|
1583
|
+
const groups = {};
|
|
1584
|
+
let description;
|
|
1585
|
+
if (jsonData) {
|
|
1586
|
+
const commandData = jsonData.command?.data || jsonData.data || jsonData;
|
|
1587
|
+
description = commandData.description;
|
|
1588
|
+
const rawGroups = commandData.groups || [];
|
|
1589
|
+
for (const g of rawGroups) {
|
|
1590
|
+
if (!g || !g.name) continue;
|
|
1591
|
+
const groupName = g.name;
|
|
1592
|
+
const buckets = [];
|
|
1593
|
+
let weeklyRemainingPct;
|
|
1594
|
+
let weeklyResetTime;
|
|
1595
|
+
let window5hRemainingPct;
|
|
1596
|
+
let window5hResetTime;
|
|
1597
|
+
for (const b of g.buckets || []) {
|
|
1598
|
+
const remainingFraction = typeof b.remaining_fraction === "number" ? b.remaining_fraction : 0;
|
|
1599
|
+
const remainingPercentage = remainingFraction * 100;
|
|
1600
|
+
const resetTime = b.reset_time || "";
|
|
1601
|
+
const window = b.window || (b.id?.includes("5h") ? "5h" : "weekly");
|
|
1602
|
+
const bucket = {
|
|
1603
|
+
id: b.id || "",
|
|
1604
|
+
name: b.name || "",
|
|
1605
|
+
window,
|
|
1606
|
+
remainingFraction,
|
|
1607
|
+
remainingPercentage,
|
|
1608
|
+
resetTime,
|
|
1609
|
+
description: b.description
|
|
1610
|
+
};
|
|
1611
|
+
buckets.push(bucket);
|
|
1612
|
+
if (window === "weekly" || b.id?.includes("weekly")) {
|
|
1613
|
+
weeklyRemainingPct = remainingPercentage;
|
|
1614
|
+
weeklyResetTime = resetTime;
|
|
1615
|
+
} else if (window === "5h" || b.id?.includes("5h")) {
|
|
1616
|
+
window5hRemainingPct = remainingPercentage;
|
|
1617
|
+
window5hResetTime = resetTime;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
groups[groupName] = {
|
|
1621
|
+
name: groupName,
|
|
1622
|
+
description: g.description,
|
|
1623
|
+
buckets,
|
|
1624
|
+
weeklyRemainingPct,
|
|
1625
|
+
weeklyResetTime,
|
|
1626
|
+
window5hRemainingPct,
|
|
1627
|
+
window5hResetTime
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
} else {
|
|
1631
|
+
const lines = raw.split("\n");
|
|
1632
|
+
for (const line of lines) {
|
|
1633
|
+
const match = line.match(/^\s*([A-Za-z0-9 ]+?)\t+([^\t]+)\t+(\d+)%\t+(.*)$/) || line.match(/^\s*(.+?)\s{2,}(Weekly Limit Remaining|Five Hour Limit Remaining)\s+(\d+)%\s*(.*)$/);
|
|
1634
|
+
if (match) {
|
|
1635
|
+
const groupName = match[1].trim();
|
|
1636
|
+
const bucketName = match[2].trim();
|
|
1637
|
+
const pct = parseInt(match[3], 10);
|
|
1638
|
+
const resetTime = match[4].trim();
|
|
1639
|
+
if (!groups[groupName]) {
|
|
1640
|
+
groups[groupName] = {
|
|
1641
|
+
name: groupName,
|
|
1642
|
+
buckets: []
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
const isWeekly = bucketName.toLowerCase().includes("weekly");
|
|
1646
|
+
const window = isWeekly ? "weekly" : "5h";
|
|
1647
|
+
groups[groupName].buckets.push({
|
|
1648
|
+
id: isWeekly ? `${groupName.toLowerCase().replace(/\s+/g, "-")}-weekly` : `${groupName.toLowerCase().replace(/\s+/g, "-")}-5h`,
|
|
1649
|
+
name: bucketName,
|
|
1650
|
+
window,
|
|
1651
|
+
remainingFraction: pct / 100,
|
|
1652
|
+
remainingPercentage: pct,
|
|
1653
|
+
resetTime
|
|
1654
|
+
});
|
|
1655
|
+
if (isWeekly) {
|
|
1656
|
+
groups[groupName].weeklyRemainingPct = pct;
|
|
1657
|
+
groups[groupName].weeklyResetTime = resetTime;
|
|
1658
|
+
} else {
|
|
1659
|
+
groups[groupName].window5hRemainingPct = pct;
|
|
1660
|
+
groups[groupName].window5hResetTime = resetTime;
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
const hasGroups = Object.keys(groups).length > 0;
|
|
1666
|
+
if (!hasGroups) {
|
|
1667
|
+
return {
|
|
1668
|
+
available: false,
|
|
1669
|
+
groups: {},
|
|
1670
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1671
|
+
error: raw.length > 0 ? raw.length > 200 ? raw.slice(0, 200) + "..." : raw : "No quota information found"
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
const geminiGroup = groups["Gemini Models"];
|
|
1675
|
+
const claudeGroup = groups["Claude and GPT models"];
|
|
1676
|
+
return {
|
|
1677
|
+
available: true,
|
|
1678
|
+
description,
|
|
1679
|
+
groups,
|
|
1680
|
+
geminiWeeklyRemainingPct: geminiGroup?.weeklyRemainingPct,
|
|
1681
|
+
gemini5hRemainingPct: geminiGroup?.window5hRemainingPct,
|
|
1682
|
+
geminiWeeklyResetTime: geminiGroup?.weeklyResetTime,
|
|
1683
|
+
gemini5hResetTime: geminiGroup?.window5hResetTime,
|
|
1684
|
+
claudeWeeklyRemainingPct: claudeGroup?.weeklyRemainingPct,
|
|
1685
|
+
claude5hRemainingPct: claudeGroup?.window5hRemainingPct,
|
|
1686
|
+
claudeWeeklyResetTime: claudeGroup?.weeklyResetTime,
|
|
1687
|
+
claude5hResetTime: claudeGroup?.window5hResetTime,
|
|
1688
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
function readCachedPlanQuota(cacheFile, cacheTtlMs) {
|
|
1692
|
+
if (!cacheFile || cacheTtlMs <= 0 || !fs6.existsSync(cacheFile)) return null;
|
|
1693
|
+
try {
|
|
1694
|
+
const cached = JSON.parse(fs6.readFileSync(cacheFile, "utf8"));
|
|
1695
|
+
if (cached && typeof cached.cachedAt === "number" && Date.now() - cached.cachedAt < cacheTtlMs && cached.quota) {
|
|
1696
|
+
return cached.quota;
|
|
1697
|
+
}
|
|
1698
|
+
} catch {
|
|
1699
|
+
}
|
|
1700
|
+
return null;
|
|
1701
|
+
}
|
|
1702
|
+
function writeCachedPlanQuota(cacheFile, quota) {
|
|
1703
|
+
if (!cacheFile || !quota.available) return;
|
|
1704
|
+
try {
|
|
1705
|
+
fs6.mkdirSync(path6.dirname(cacheFile), { recursive: true });
|
|
1706
|
+
fs6.writeFileSync(cacheFile, JSON.stringify({ cachedAt: Date.now(), quota }, null, 2));
|
|
1707
|
+
} catch {
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
function getActualPlanQuotaSync(options = {}) {
|
|
1711
|
+
const cacheTtlMs = options.cacheTtlMs ?? 6e4;
|
|
1712
|
+
const cacheFile = options.repoRoot ? path6.join(options.repoRoot, ".jonah-fleet", "plan-quota-cache.json") : void 0;
|
|
1713
|
+
const cached = readCachedPlanQuota(cacheFile, cacheTtlMs);
|
|
1714
|
+
if (cached) return cached;
|
|
1715
|
+
try {
|
|
1716
|
+
let rawOutput;
|
|
1717
|
+
if (options.executor) {
|
|
1718
|
+
rawOutput = options.executor();
|
|
1719
|
+
} else if (process.env.VITEST) {
|
|
1720
|
+
return {
|
|
1721
|
+
available: false,
|
|
1722
|
+
groups: {},
|
|
1723
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1724
|
+
error: "Skipped in test environment"
|
|
1725
|
+
};
|
|
1726
|
+
} else {
|
|
1727
|
+
rawOutput = execSync('agy --output-format json --print "/quota"', {
|
|
1728
|
+
encoding: "utf8",
|
|
1729
|
+
timeout: 1e4,
|
|
1730
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
const quota = parseAgyQuotaOutput(rawOutput);
|
|
1734
|
+
writeCachedPlanQuota(cacheFile, quota);
|
|
1735
|
+
return quota;
|
|
1736
|
+
} catch (err) {
|
|
1737
|
+
return {
|
|
1738
|
+
available: false,
|
|
1739
|
+
groups: {},
|
|
1740
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1741
|
+
error: err?.message || String(err)
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
async function fetchActualPlanQuota(options = {}) {
|
|
1746
|
+
const cacheTtlMs = options.cacheTtlMs ?? 6e4;
|
|
1747
|
+
const cacheFile = options.repoRoot ? path6.join(options.repoRoot, ".jonah-fleet", "plan-quota-cache.json") : void 0;
|
|
1748
|
+
const cached = readCachedPlanQuota(cacheFile, cacheTtlMs);
|
|
1749
|
+
if (cached) return cached;
|
|
1750
|
+
try {
|
|
1751
|
+
let rawOutput;
|
|
1752
|
+
if (options.executor) {
|
|
1753
|
+
rawOutput = await options.executor();
|
|
1754
|
+
} else if (process.env.VITEST) {
|
|
1755
|
+
return {
|
|
1756
|
+
available: false,
|
|
1757
|
+
groups: {},
|
|
1758
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1759
|
+
error: "Skipped in test environment"
|
|
1760
|
+
};
|
|
1761
|
+
} else {
|
|
1762
|
+
const { stdout } = await execFileAsync2("agy", ["--output-format", "json", "--print", "/quota"], {
|
|
1763
|
+
timeout: 1e4
|
|
1764
|
+
});
|
|
1765
|
+
rawOutput = stdout;
|
|
1766
|
+
}
|
|
1767
|
+
const quota = parseAgyQuotaOutput(rawOutput);
|
|
1768
|
+
writeCachedPlanQuota(cacheFile, quota);
|
|
1769
|
+
return quota;
|
|
1770
|
+
} catch (err) {
|
|
1771
|
+
return {
|
|
1772
|
+
available: false,
|
|
1773
|
+
groups: {},
|
|
1774
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1775
|
+
error: err?.message || String(err)
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
function formatPlanQuotaSummary(quota, options = {}) {
|
|
1780
|
+
if (!quota || !quota.available) {
|
|
1781
|
+
return "Plan Quota: Unavailable";
|
|
1782
|
+
}
|
|
1783
|
+
const parts = [];
|
|
1784
|
+
const fmt = (pct) => options.markdown ? `\`${pct.toFixed(1)}% remaining\`` : `${pct.toFixed(1)}% remaining`;
|
|
1785
|
+
if (quota.gemini5hRemainingPct !== void 0 || quota.geminiWeeklyRemainingPct !== void 0) {
|
|
1786
|
+
const subParts = [];
|
|
1787
|
+
if (quota.gemini5hRemainingPct !== void 0) {
|
|
1788
|
+
subParts.push(`Gemini 5h: ${fmt(quota.gemini5hRemainingPct)}`);
|
|
1789
|
+
}
|
|
1790
|
+
if (quota.geminiWeeklyRemainingPct !== void 0) {
|
|
1791
|
+
const label = quota.gemini5hRemainingPct !== void 0 ? "Weekly" : "Gemini Weekly";
|
|
1792
|
+
subParts.push(`${label}: ${fmt(quota.geminiWeeklyRemainingPct)}`);
|
|
1793
|
+
}
|
|
1794
|
+
if (subParts.length > 0) {
|
|
1795
|
+
parts.push(subParts.join(" \xB7 "));
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
if (quota.claude5hRemainingPct !== void 0 || quota.claudeWeeklyRemainingPct !== void 0) {
|
|
1799
|
+
const subParts = [];
|
|
1800
|
+
if (quota.claude5hRemainingPct !== void 0) {
|
|
1801
|
+
subParts.push(`Claude/GPT 5h: ${fmt(quota.claude5hRemainingPct)}`);
|
|
1802
|
+
}
|
|
1803
|
+
if (quota.claudeWeeklyRemainingPct !== void 0) {
|
|
1804
|
+
const label = quota.claude5hRemainingPct !== void 0 ? "Weekly" : "Claude/GPT Weekly";
|
|
1805
|
+
subParts.push(`${label}: ${fmt(quota.claudeWeeklyRemainingPct)}`);
|
|
1806
|
+
}
|
|
1807
|
+
if (subParts.length > 0) {
|
|
1808
|
+
parts.push(subParts.join(" \xB7 "));
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
return parts.join(options.markdown ? "<br>" : "\n");
|
|
1812
|
+
}
|
|
1556
1813
|
function parseLogToTelemetry(content, options = {}) {
|
|
1557
1814
|
if (!content || typeof content !== "string") return null;
|
|
1558
1815
|
const lines = content.split("\n");
|
|
@@ -1968,7 +2225,7 @@ function renderTelemetryDashboard(telemetry, options = {}) {
|
|
|
1968
2225
|
}
|
|
1969
2226
|
|
|
1970
2227
|
// src/lib/terminal-card.ts
|
|
1971
|
-
var
|
|
2228
|
+
var execFileAsync3 = promisify3(execFile3);
|
|
1972
2229
|
function stripAnsi(text) {
|
|
1973
2230
|
return text.replace(/\x1b\[[0-9;]*m/g, "");
|
|
1974
2231
|
}
|
|
@@ -2058,7 +2315,7 @@ async function fetchTargetTitleAsync(repoRoot, target) {
|
|
|
2058
2315
|
try {
|
|
2059
2316
|
const prMatch = target.match(/PR\s*#?(\d+)/i);
|
|
2060
2317
|
if (prMatch) {
|
|
2061
|
-
const { stdout } = await
|
|
2318
|
+
const { stdout } = await execFileAsync3("gh", ["pr", "view", prMatch[1], "--json", "title", "-q", ".title"], {
|
|
2062
2319
|
cwd: repoRoot,
|
|
2063
2320
|
encoding: "utf8",
|
|
2064
2321
|
timeout: 3e3
|
|
@@ -2067,7 +2324,7 @@ async function fetchTargetTitleAsync(repoRoot, target) {
|
|
|
2067
2324
|
}
|
|
2068
2325
|
const issueMatch = target.match(/Issue\s*#?(\d+)/i);
|
|
2069
2326
|
if (issueMatch) {
|
|
2070
|
-
const { stdout } = await
|
|
2327
|
+
const { stdout } = await execFileAsync3("gh", ["issue", "view", issueMatch[1], "--json", "title", "-q", ".title"], {
|
|
2071
2328
|
cwd: repoRoot,
|
|
2072
2329
|
encoding: "utf8",
|
|
2073
2330
|
timeout: 3e3
|
|
@@ -2887,11 +3144,12 @@ function renderSummaryCard(options) {
|
|
|
2887
3144
|
lines.push(border(`\u251C${horizontal}\u2524`));
|
|
2888
3145
|
lines.push(...bodyLines);
|
|
2889
3146
|
}
|
|
2890
|
-
if (typeof options.usage?.totalTokens === "number") {
|
|
3147
|
+
if (typeof options.usage?.totalTokens === "number" || options.planQuota?.available) {
|
|
2891
3148
|
lines.push(
|
|
2892
3149
|
...renderTokenQuotaSection({
|
|
2893
3150
|
usage: options.usage,
|
|
2894
3151
|
repoRoot: options.repoRoot,
|
|
3152
|
+
planQuota: options.planQuota,
|
|
2895
3153
|
width,
|
|
2896
3154
|
borderColor: border
|
|
2897
3155
|
})
|
|
@@ -2908,30 +3166,46 @@ function renderSummaryCard(options) {
|
|
|
2908
3166
|
}
|
|
2909
3167
|
function renderTokenQuotaSection(options) {
|
|
2910
3168
|
const total = options.usage?.totalTokens;
|
|
2911
|
-
|
|
3169
|
+
const hasUsage = typeof total === "number";
|
|
3170
|
+
const plan = options.planQuota;
|
|
3171
|
+
const hasPlan = Boolean(plan && plan.available);
|
|
3172
|
+
if (!hasUsage && !hasPlan) return [];
|
|
2912
3173
|
const border = options.borderColor ?? ((s) => pc2.dim(pc2.gray(s)));
|
|
2913
3174
|
const width = options.width;
|
|
2914
3175
|
const horizontal = "\u2500".repeat(width - 2);
|
|
2915
3176
|
const lines = [];
|
|
2916
|
-
const quota = calculateTokenQuotaPercentages(total);
|
|
2917
|
-
const breakdown = formatTokenBreakdown(options.usage, "prefix");
|
|
2918
3177
|
lines.push(border(`\u251C${horizontal}\u2524`));
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
const
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
3178
|
+
if (hasUsage) {
|
|
3179
|
+
const quota = calculateTokenQuotaPercentages(total);
|
|
3180
|
+
const breakdown = formatTokenBreakdown(options.usage, "prefix");
|
|
3181
|
+
const tokenLine1 = ` Tokens: ${pc2.bold(total.toLocaleString())}${breakdown ? pc2.dim(` (${breakdown})`) : ""}`;
|
|
3182
|
+
lines.push(border("\u2502") + tokenLine1 + " ".repeat(Math.max(1, width - 2 - stripAnsi(tokenLine1).length)) + border("\u2502"));
|
|
3183
|
+
const tokenLine2 = ` \u21B3 ${pc2.cyan(quota.pctOf5hLimit.toFixed(2) + "% of 5h limit")} \xB7 ${pc2.cyan(quota.pctOfWeeklyLimit.toFixed(2) + "% of weekly limit")}`;
|
|
3184
|
+
lines.push(border("\u2502") + tokenLine2 + " ".repeat(Math.max(1, width - 2 - stripAnsi(tokenLine2).length)) + border("\u2502"));
|
|
3185
|
+
if (options.repoRoot) {
|
|
3186
|
+
try {
|
|
3187
|
+
const rolling = getRollingWindowTokenUsage(options.repoRoot);
|
|
3188
|
+
if (rolling.windowTokens > 0 || rolling.weeklyTokens > 0) {
|
|
3189
|
+
const badge5h = formatQuotaStatusBadge(rolling.windowStatus);
|
|
3190
|
+
const badgeWeekly = formatQuotaStatusBadge(rolling.weeklyStatus);
|
|
3191
|
+
const rollingLine1 = ` Rolling 5h: ${rolling.windowTokens.toLocaleString()} / ${rolling.windowLimit.toLocaleString()} tokens (${rolling.windowPercentage.toFixed(1)}% \xB7 ${badge5h})`;
|
|
3192
|
+
lines.push(border("\u2502") + rollingLine1 + " ".repeat(Math.max(1, width - 2 - stripAnsi(rollingLine1).length)) + border("\u2502"));
|
|
3193
|
+
const rollingLine2 = ` Rolling 7d: ${rolling.weeklyTokens.toLocaleString()} / ${rolling.weeklyLimit.toLocaleString()} tokens (${rolling.weeklyPercentage.toFixed(1)}% \xB7 ${badgeWeekly})`;
|
|
3194
|
+
lines.push(border("\u2502") + rollingLine2 + " ".repeat(Math.max(1, width - 2 - stripAnsi(rollingLine2).length)) + border("\u2502"));
|
|
3195
|
+
}
|
|
3196
|
+
} catch {
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
if (hasPlan && plan) {
|
|
3201
|
+
const summary = formatPlanQuotaSummary(plan);
|
|
3202
|
+
if (summary && summary !== "Plan Quota: Unavailable") {
|
|
3203
|
+
const summaryLines = summary.split("\n");
|
|
3204
|
+
for (let i = 0; i < summaryLines.length; i++) {
|
|
3205
|
+
const prefix = i === 0 ? " Plan Quota: " : " ";
|
|
3206
|
+
const planLine = `${prefix}${summaryLines[i]}`;
|
|
3207
|
+
lines.push(border("\u2502") + planLine + " ".repeat(Math.max(1, width - 2 - stripAnsi(planLine).length)) + border("\u2502"));
|
|
2933
3208
|
}
|
|
2934
|
-
} catch {
|
|
2935
3209
|
}
|
|
2936
3210
|
}
|
|
2937
3211
|
return lines;
|
|
@@ -2970,11 +3244,12 @@ function renderErrorCard(options) {
|
|
|
2970
3244
|
} else {
|
|
2971
3245
|
lines.push(pc2.red("\u2502") + pc2.dim(" (No daemon.log found)") + " ".repeat(Math.max(1, width - 26)) + pc2.red("\u2502"));
|
|
2972
3246
|
}
|
|
2973
|
-
if (typeof options.usage?.totalTokens === "number") {
|
|
3247
|
+
if (typeof options.usage?.totalTokens === "number" || options.planQuota?.available) {
|
|
2974
3248
|
lines.push(
|
|
2975
3249
|
...renderTokenQuotaSection({
|
|
2976
3250
|
usage: options.usage,
|
|
2977
3251
|
repoRoot: options.repoRoot,
|
|
3252
|
+
planQuota: options.planQuota,
|
|
2978
3253
|
width,
|
|
2979
3254
|
borderColor: (s) => pc2.red(s)
|
|
2980
3255
|
})
|
|
@@ -3834,6 +4109,7 @@ async function runStatus(options = {}) {
|
|
|
3834
4109
|
tokenUsage = computeTokenSpendFromLogs(logContents);
|
|
3835
4110
|
}
|
|
3836
4111
|
const rollingQuota = getRollingWindowTokenUsage(cwd);
|
|
4112
|
+
const planQuota = getActualPlanQuotaSync({ repoRoot: cwd });
|
|
3837
4113
|
if (options.json) {
|
|
3838
4114
|
console.log(
|
|
3839
4115
|
JSON.stringify(
|
|
@@ -3850,6 +4126,7 @@ async function runStatus(options = {}) {
|
|
|
3850
4126
|
repositories: manifest.repositories || [],
|
|
3851
4127
|
tokenUsage,
|
|
3852
4128
|
quotaPacing: rollingQuota,
|
|
4129
|
+
planQuota: planQuota.available ? planQuota : void 0,
|
|
3853
4130
|
drift: {
|
|
3854
4131
|
hasDrift,
|
|
3855
4132
|
...drift
|
|
@@ -3949,6 +4226,37 @@ async function runStatus(options = {}) {
|
|
|
3949
4226
|
` \u2022 7-Day Spend: ${pc8.bold(formatTokens2(rollingQuota.weeklyTokens))} / ${formatTokens2(rollingQuota.weeklyLimit)} tokens (${pc8.cyan(rollingQuota.weeklyPercentage.toFixed(1) + "%")}) ${badgeWeekly}`
|
|
3950
4227
|
);
|
|
3951
4228
|
}
|
|
4229
|
+
if (planQuota.available) {
|
|
4230
|
+
console.log(pc8.bold("\n \u26A1 Real-Time Plan Quota (Google Antigravity):"));
|
|
4231
|
+
if (planQuota.gemini5hRemainingPct !== void 0 || planQuota.geminiWeeklyRemainingPct !== void 0) {
|
|
4232
|
+
const parts = [];
|
|
4233
|
+
if (planQuota.gemini5hRemainingPct !== void 0) {
|
|
4234
|
+
const reset5h = planQuota.gemini5hResetTime ? pc8.dim(` (resets ${planQuota.gemini5hResetTime})`) : "";
|
|
4235
|
+
parts.push(`${pc8.bold(planQuota.gemini5hRemainingPct.toFixed(1) + "% 5h remaining")}${reset5h}`);
|
|
4236
|
+
}
|
|
4237
|
+
if (planQuota.geminiWeeklyRemainingPct !== void 0) {
|
|
4238
|
+
const resetWk = planQuota.geminiWeeklyResetTime ? pc8.dim(` (resets ${planQuota.geminiWeeklyResetTime})`) : "";
|
|
4239
|
+
parts.push(`${pc8.bold(planQuota.geminiWeeklyRemainingPct.toFixed(1) + "% weekly remaining")}${resetWk}`);
|
|
4240
|
+
}
|
|
4241
|
+
if (parts.length > 0) {
|
|
4242
|
+
console.log(` \u2022 Gemini Models: ${parts.join(" \xB7 ")}`);
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
if (planQuota.claude5hRemainingPct !== void 0 || planQuota.claudeWeeklyRemainingPct !== void 0) {
|
|
4246
|
+
const parts = [];
|
|
4247
|
+
if (planQuota.claude5hRemainingPct !== void 0) {
|
|
4248
|
+
const reset5h = planQuota.claude5hResetTime ? pc8.dim(` (resets ${planQuota.claude5hResetTime})`) : "";
|
|
4249
|
+
parts.push(`${pc8.bold(planQuota.claude5hRemainingPct.toFixed(1) + "% 5h remaining")}${reset5h}`);
|
|
4250
|
+
}
|
|
4251
|
+
if (planQuota.claudeWeeklyRemainingPct !== void 0) {
|
|
4252
|
+
const resetWk = planQuota.claudeWeeklyResetTime ? pc8.dim(` (resets ${planQuota.claudeWeeklyResetTime})`) : "";
|
|
4253
|
+
parts.push(`${pc8.bold(planQuota.claudeWeeklyRemainingPct.toFixed(1) + "% weekly remaining")}${resetWk}`);
|
|
4254
|
+
}
|
|
4255
|
+
if (parts.length > 0) {
|
|
4256
|
+
console.log(` \u2022 Claude/GPT Models: ${parts.join(" \xB7 ")}`);
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
3952
4260
|
console.log(pc8.bold("\n Drift / Health:"));
|
|
3953
4261
|
if (!hasDrift) {
|
|
3954
4262
|
console.log(pc8.green(" \u2713 All prompts, workflows, and skills are healthy and match fleet templates.\n"));
|
|
@@ -3963,7 +4271,7 @@ async function runStatus(options = {}) {
|
|
|
3963
4271
|
}
|
|
3964
4272
|
|
|
3965
4273
|
// src/commands/contribute.ts
|
|
3966
|
-
import { execSync } from "child_process";
|
|
4274
|
+
import { execSync as execSync2 } from "child_process";
|
|
3967
4275
|
import pc9 from "picocolors";
|
|
3968
4276
|
function prepareContributionPayload(options = {}) {
|
|
3969
4277
|
const repo = options.repo || "Jonah-Projects/jonah-fleet";
|
|
@@ -4023,7 +4331,7 @@ async function runContribute(options = {}) {
|
|
|
4023
4331
|
};
|
|
4024
4332
|
} else {
|
|
4025
4333
|
try {
|
|
4026
|
-
|
|
4334
|
+
execSync2("gh auth status", { stdio: "pipe" });
|
|
4027
4335
|
} catch {
|
|
4028
4336
|
const errorMsg = "GitHub CLI (`gh`) is not authenticated. Run `gh auth login` first.";
|
|
4029
4337
|
console.error(pc9.red(`\u274C ${errorMsg}`));
|
|
@@ -4168,15 +4476,15 @@ import pc12 from "picocolors";
|
|
|
4168
4476
|
import fs13 from "fs";
|
|
4169
4477
|
import path13 from "path";
|
|
4170
4478
|
import os2 from "os";
|
|
4171
|
-
import { spawn, execSync as
|
|
4172
|
-
import { promisify as
|
|
4479
|
+
import { spawn, execSync as execSync3, execFile as execFile5 } from "child_process";
|
|
4480
|
+
import { promisify as promisify5 } from "util";
|
|
4173
4481
|
|
|
4174
4482
|
// src/lib/worktree.ts
|
|
4175
4483
|
import fs12 from "fs";
|
|
4176
4484
|
import path12 from "path";
|
|
4177
|
-
import { execFile as
|
|
4178
|
-
import { promisify as
|
|
4179
|
-
var
|
|
4485
|
+
import { execFile as execFile4 } from "child_process";
|
|
4486
|
+
import { promisify as promisify4 } from "util";
|
|
4487
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
4180
4488
|
function getWorktreesBaseDir(repoRoot) {
|
|
4181
4489
|
return path12.join(repoRoot, ".jonah-fleet", "worktrees");
|
|
4182
4490
|
}
|
|
@@ -4187,10 +4495,10 @@ async function createWorktree(repoRoot, options) {
|
|
|
4187
4495
|
const worktreePath = path12.join(baseDir, sanitizedDirName);
|
|
4188
4496
|
if (fs12.existsSync(worktreePath)) {
|
|
4189
4497
|
try {
|
|
4190
|
-
await
|
|
4498
|
+
await execFileAsync4("git", ["worktree", "remove", "--force", worktreePath], { cwd: repoRoot });
|
|
4191
4499
|
} catch {
|
|
4192
4500
|
fs12.rmSync(worktreePath, { recursive: true, force: true });
|
|
4193
|
-
await
|
|
4501
|
+
await execFileAsync4("git", ["worktree", "prune"], { cwd: repoRoot }).catch(() => {
|
|
4194
4502
|
});
|
|
4195
4503
|
}
|
|
4196
4504
|
}
|
|
@@ -4200,7 +4508,7 @@ async function createWorktree(repoRoot, options) {
|
|
|
4200
4508
|
baseRef = "HEAD";
|
|
4201
4509
|
for (const candidate of candidates) {
|
|
4202
4510
|
try {
|
|
4203
|
-
await
|
|
4511
|
+
await execFileAsync4("git", ["rev-parse", "--verify", candidate], { cwd: repoRoot });
|
|
4204
4512
|
baseRef = candidate;
|
|
4205
4513
|
break;
|
|
4206
4514
|
} catch {
|
|
@@ -4208,10 +4516,10 @@ async function createWorktree(repoRoot, options) {
|
|
|
4208
4516
|
}
|
|
4209
4517
|
}
|
|
4210
4518
|
try {
|
|
4211
|
-
await
|
|
4519
|
+
await execFileAsync4("git", ["branch", "-D", options.branchName], { cwd: repoRoot });
|
|
4212
4520
|
} catch {
|
|
4213
4521
|
}
|
|
4214
|
-
await
|
|
4522
|
+
await execFileAsync4("git", ["worktree", "add", worktreePath, "-b", options.branchName, baseRef], {
|
|
4215
4523
|
cwd: repoRoot
|
|
4216
4524
|
});
|
|
4217
4525
|
return { worktreePath, branchName: options.branchName };
|
|
@@ -4219,24 +4527,24 @@ async function createWorktree(repoRoot, options) {
|
|
|
4219
4527
|
async function removeWorktree(repoRoot, worktreePath, options = {}) {
|
|
4220
4528
|
try {
|
|
4221
4529
|
if (fs12.existsSync(worktreePath)) {
|
|
4222
|
-
await
|
|
4530
|
+
await execFileAsync4("git", ["worktree", "remove", "--force", worktreePath], { cwd: repoRoot });
|
|
4223
4531
|
}
|
|
4224
4532
|
} catch {
|
|
4225
4533
|
if (fs12.existsSync(worktreePath)) {
|
|
4226
4534
|
fs12.rmSync(worktreePath, { recursive: true, force: true });
|
|
4227
4535
|
}
|
|
4228
4536
|
} finally {
|
|
4229
|
-
await
|
|
4537
|
+
await execFileAsync4("git", ["worktree", "prune"], { cwd: repoRoot }).catch(() => {
|
|
4230
4538
|
});
|
|
4231
4539
|
}
|
|
4232
4540
|
if (options.deleteBranch && options.branchName) {
|
|
4233
|
-
await
|
|
4541
|
+
await execFileAsync4("git", ["branch", "-D", options.branchName], { cwd: repoRoot }).catch(() => {
|
|
4234
4542
|
});
|
|
4235
4543
|
}
|
|
4236
4544
|
}
|
|
4237
4545
|
async function listActiveWorktrees(repoRoot) {
|
|
4238
4546
|
try {
|
|
4239
|
-
const { stdout } = await
|
|
4547
|
+
const { stdout } = await execFileAsync4("git", ["worktree", "list", "--porcelain"], { cwd: repoRoot });
|
|
4240
4548
|
const entries = stdout.trim().split("\n\n");
|
|
4241
4549
|
const worktrees = [];
|
|
4242
4550
|
const baseDir = path12.resolve(getWorktreesBaseDir(repoRoot));
|
|
@@ -4281,7 +4589,7 @@ async function cleanupStaleWorktrees(repoRoot, options = {}) {
|
|
|
4281
4589
|
const isInsideBaseDir = wtResolved === baseDir || wtResolved.startsWith(baseDir + path12.sep);
|
|
4282
4590
|
if (isInsideBaseDir && wtResolved !== keepNormalized) {
|
|
4283
4591
|
try {
|
|
4284
|
-
await
|
|
4592
|
+
await execFileAsync4("git", ["worktree", "remove", "--force", wt.path], { cwd: repoRoot });
|
|
4285
4593
|
} catch {
|
|
4286
4594
|
if (fs12.existsSync(wt.path)) {
|
|
4287
4595
|
fs12.rmSync(wt.path, { recursive: true, force: true });
|
|
@@ -4291,7 +4599,7 @@ async function cleanupStaleWorktrees(repoRoot, options = {}) {
|
|
|
4291
4599
|
}
|
|
4292
4600
|
}
|
|
4293
4601
|
}
|
|
4294
|
-
await
|
|
4602
|
+
await execFileAsync4("git", ["worktree", "prune"], { cwd: repoRoot }).catch(() => {
|
|
4295
4603
|
});
|
|
4296
4604
|
if (fs12.existsSync(baseDir)) {
|
|
4297
4605
|
const remainingActive = await listActiveWorktrees(repoRoot);
|
|
@@ -4305,7 +4613,7 @@ async function cleanupStaleWorktrees(repoRoot, options = {}) {
|
|
|
4305
4613
|
}
|
|
4306
4614
|
}
|
|
4307
4615
|
}
|
|
4308
|
-
await
|
|
4616
|
+
await execFileAsync4("git", ["worktree", "prune"], { cwd: repoRoot }).catch(() => {
|
|
4309
4617
|
});
|
|
4310
4618
|
} catch {
|
|
4311
4619
|
}
|
|
@@ -4581,7 +4889,7 @@ function formatLoopGuardReport(options) {
|
|
|
4581
4889
|
|
|
4582
4890
|
// src/lib/runner.ts
|
|
4583
4891
|
import pc11 from "picocolors";
|
|
4584
|
-
var
|
|
4892
|
+
var execFileAsync5 = promisify5(execFile5);
|
|
4585
4893
|
var LineBufferedStreamParser = class {
|
|
4586
4894
|
buffer = "";
|
|
4587
4895
|
onLine;
|
|
@@ -4741,7 +5049,7 @@ _Running via Jonah Fleet CLI runner._`;
|
|
|
4741
5049
|
const tmpFile = path13.join(os2.tmpdir(), `jonah-fleet-run-issue-${Date.now()}.md`);
|
|
4742
5050
|
fs13.writeFileSync(tmpFile, body, "utf8");
|
|
4743
5051
|
try {
|
|
4744
|
-
const out =
|
|
5052
|
+
const out = execSync3(`gh issue create --title ${JSON.stringify(title)} --body-file ${JSON.stringify(tmpFile)} --label ${JSON.stringify(labels)}`, {
|
|
4745
5053
|
cwd,
|
|
4746
5054
|
encoding: "utf8",
|
|
4747
5055
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -4776,7 +5084,7 @@ function tryPostLocalRunMilestone(cwd, issueNumber, cardContent) {
|
|
|
4776
5084
|
const tmpFile = path13.join(os2.tmpdir(), `jonah-fleet-milestone-${issueNumber}-${Date.now()}.md`);
|
|
4777
5085
|
fs13.writeFileSync(tmpFile, cardContent, "utf8");
|
|
4778
5086
|
try {
|
|
4779
|
-
|
|
5087
|
+
execSync3(`gh issue comment ${issueNumber} --body-file ${JSON.stringify(tmpFile)}`, {
|
|
4780
5088
|
cwd,
|
|
4781
5089
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4782
5090
|
});
|
|
@@ -4792,7 +5100,7 @@ async function tryPostLocalRunMilestoneAsync(cwd, issueNumber, cardContent) {
|
|
|
4792
5100
|
const tmpFile = path13.join(os2.tmpdir(), `jonah-fleet-milestone-${issueNumber}-${Date.now()}.md`);
|
|
4793
5101
|
try {
|
|
4794
5102
|
await fs13.promises.writeFile(tmpFile, cardContent, "utf8");
|
|
4795
|
-
await
|
|
5103
|
+
await execFileAsync5("gh", ["issue", "comment", String(issueNumber), "--body-file", tmpFile], {
|
|
4796
5104
|
cwd
|
|
4797
5105
|
});
|
|
4798
5106
|
return true;
|
|
@@ -4845,11 +5153,11 @@ _Generated by Jonah Fleet local runner on ${hostname}._`;
|
|
|
4845
5153
|
const tmpFile2 = path13.join(os2.tmpdir(), `jonah-fleet-run-${issueNumber}-${Date.now()}.md`);
|
|
4846
5154
|
fs13.writeFileSync(tmpFile2, finalBody2, "utf8");
|
|
4847
5155
|
try {
|
|
4848
|
-
|
|
5156
|
+
execSync3(`gh issue edit ${issueNumber} --body-file ${JSON.stringify(tmpFile2)}`, {
|
|
4849
5157
|
cwd,
|
|
4850
5158
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4851
5159
|
});
|
|
4852
|
-
|
|
5160
|
+
execSync3(`gh issue edit ${issueNumber} --add-label "status:quota-paused" --remove-label "status:running"`, {
|
|
4853
5161
|
cwd,
|
|
4854
5162
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4855
5163
|
});
|
|
@@ -4875,21 +5183,21 @@ _Generated by Jonah Fleet local runner on ${hostname}._`;
|
|
|
4875
5183
|
const tmpFile = path13.join(os2.tmpdir(), `jonah-fleet-run-${issueNumber}-${Date.now()}.md`);
|
|
4876
5184
|
fs13.writeFileSync(tmpFile, finalBody, "utf8");
|
|
4877
5185
|
try {
|
|
4878
|
-
|
|
5186
|
+
execSync3(`gh issue edit ${issueNumber} --body-file ${JSON.stringify(tmpFile)}`, {
|
|
4879
5187
|
cwd,
|
|
4880
5188
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4881
5189
|
});
|
|
4882
5190
|
if (exitCode === 0) {
|
|
4883
|
-
|
|
5191
|
+
execSync3(`gh issue edit ${issueNumber} --add-label "status:success" --remove-label "status:running"`, {
|
|
4884
5192
|
cwd,
|
|
4885
5193
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4886
5194
|
});
|
|
4887
|
-
|
|
5195
|
+
execSync3(`gh issue close ${issueNumber} --reason completed`, {
|
|
4888
5196
|
cwd,
|
|
4889
5197
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4890
5198
|
});
|
|
4891
5199
|
} else {
|
|
4892
|
-
|
|
5200
|
+
execSync3(`gh issue edit ${issueNumber} --add-label "status:failure,needs-attention" --remove-label "status:running"`, {
|
|
4893
5201
|
cwd,
|
|
4894
5202
|
stdio: ["ignore", "ignore", "ignore"]
|
|
4895
5203
|
});
|
|
@@ -4911,7 +5219,7 @@ async function tryMarkLocalRunInterruptedAsync(cwd, issueNumber, hostname, reaso
|
|
|
4911
5219
|
step: "Local execution interrupted before completion"
|
|
4912
5220
|
});
|
|
4913
5221
|
await tryPostLocalRunMilestoneAsync(cwd, issueNumber, interruptionCard);
|
|
4914
|
-
await
|
|
5222
|
+
await execFileAsync5(
|
|
4915
5223
|
"gh",
|
|
4916
5224
|
["issue", "edit", String(issueNumber), "--add-label", "status:failure,needs-attention", "--remove-label", "status:running"],
|
|
4917
5225
|
{ cwd }
|
|
@@ -4940,8 +5248,8 @@ _Generated by Jonah Fleet local runner on ${hostname}._`;
|
|
|
4940
5248
|
const tmpFile2 = path13.join(os2.tmpdir(), `jonah-fleet-run-${issueNumber}-${Date.now()}.md`);
|
|
4941
5249
|
await fs13.promises.writeFile(tmpFile2, finalBody2, "utf8");
|
|
4942
5250
|
try {
|
|
4943
|
-
await
|
|
4944
|
-
await
|
|
5251
|
+
await execFileAsync5("gh", ["issue", "edit", String(issueNumber), "--body-file", tmpFile2], { cwd });
|
|
5252
|
+
await execFileAsync5("gh", ["issue", "edit", String(issueNumber), "--add-label", "status:quota-paused", "--remove-label", "status:running"], { cwd });
|
|
4945
5253
|
return true;
|
|
4946
5254
|
} finally {
|
|
4947
5255
|
try {
|
|
@@ -4967,22 +5275,22 @@ _Generated by Jonah Fleet local runner on ${hostname}._`;
|
|
|
4967
5275
|
const tmpFile = path13.join(os2.tmpdir(), `jonah-fleet-run-${issueNumber}-${Date.now()}.md`);
|
|
4968
5276
|
await fs13.promises.writeFile(tmpFile, finalBody, "utf8");
|
|
4969
5277
|
try {
|
|
4970
|
-
await
|
|
5278
|
+
await execFileAsync5("gh", ["issue", "edit", String(issueNumber), "--body-file", tmpFile], {
|
|
4971
5279
|
cwd
|
|
4972
5280
|
});
|
|
4973
5281
|
if (exitCode === 0) {
|
|
4974
|
-
await
|
|
5282
|
+
await execFileAsync5(
|
|
4975
5283
|
"gh",
|
|
4976
5284
|
["issue", "edit", String(issueNumber), "--add-label", "status:success", "--remove-label", "status:running"],
|
|
4977
5285
|
{ cwd }
|
|
4978
5286
|
);
|
|
4979
|
-
await
|
|
5287
|
+
await execFileAsync5(
|
|
4980
5288
|
"gh",
|
|
4981
5289
|
["issue", "close", String(issueNumber), "--reason", "completed"],
|
|
4982
5290
|
{ cwd }
|
|
4983
5291
|
);
|
|
4984
5292
|
} else {
|
|
4985
|
-
await
|
|
5293
|
+
await execFileAsync5(
|
|
4986
5294
|
"gh",
|
|
4987
5295
|
["issue", "edit", String(issueNumber), "--add-label", "status:failure,needs-attention", "--remove-label", "status:running"],
|
|
4988
5296
|
{ cwd }
|
|
@@ -5118,6 +5426,13 @@ function formatFallbackRunReport(options) {
|
|
|
5118
5426
|
}
|
|
5119
5427
|
}
|
|
5120
5428
|
}
|
|
5429
|
+
if (options.planQuota && options.planQuota.available) {
|
|
5430
|
+
const quotaSummary = formatPlanQuotaSummary(options.planQuota, { markdown: true });
|
|
5431
|
+
if (quotaSummary && quotaSummary !== "Plan Quota: Unavailable") {
|
|
5432
|
+
reportContent += `| Real Plan Quota | ${quotaSummary} |
|
|
5433
|
+
`;
|
|
5434
|
+
}
|
|
5435
|
+
}
|
|
5121
5436
|
if (options.exitCode !== 0) {
|
|
5122
5437
|
const errorChunks = [options.output?.trim(), options.stderr?.trim()].filter(Boolean);
|
|
5123
5438
|
const combinedError = errorChunks.join("\n");
|
|
@@ -5137,17 +5452,17 @@ ${sanitizedOutput}
|
|
|
5137
5452
|
async function preserveUncommittedWork(worktreePath, routine) {
|
|
5138
5453
|
try {
|
|
5139
5454
|
if (!fs13.existsSync(worktreePath)) return { preserved: false };
|
|
5140
|
-
const { stdout: statusOut } = await
|
|
5455
|
+
const { stdout: statusOut } = await execFileAsync5("git", ["status", "--porcelain"], { cwd: worktreePath });
|
|
5141
5456
|
const trimmed = statusOut.trim();
|
|
5142
5457
|
if (!trimmed) return { preserved: false };
|
|
5143
5458
|
const fileCount = trimmed.split("\n").filter(Boolean).length;
|
|
5144
|
-
await
|
|
5145
|
-
await
|
|
5459
|
+
await execFileAsync5("git", ["add", "-A"], { cwd: worktreePath });
|
|
5460
|
+
await execFileAsync5(
|
|
5146
5461
|
"git",
|
|
5147
5462
|
["commit", "-m", `wip(${routine}): preserve uncommitted work (${fileCount} files) before session termination`],
|
|
5148
5463
|
{ cwd: worktreePath }
|
|
5149
5464
|
);
|
|
5150
|
-
const { stdout: shaOut } = await
|
|
5465
|
+
const { stdout: shaOut } = await execFileAsync5("git", ["rev-parse", "--short", "HEAD"], { cwd: worktreePath });
|
|
5151
5466
|
return { preserved: true, commitSha: shaOut.trim(), fileCount };
|
|
5152
5467
|
} catch {
|
|
5153
5468
|
return { preserved: false };
|
|
@@ -5553,6 +5868,7 @@ Timeout: ${printTimeout}`,
|
|
|
5553
5868
|
exitCode = 1;
|
|
5554
5869
|
}
|
|
5555
5870
|
}
|
|
5871
|
+
const planQuota = await fetchActualPlanQuota({ repoRoot: targetDir });
|
|
5556
5872
|
if (loopGuardTrip) {
|
|
5557
5873
|
exitCode = 1;
|
|
5558
5874
|
reportContent = formatLoopGuardReport({
|
|
@@ -5583,6 +5899,7 @@ Timeout: ${printTimeout}`,
|
|
|
5583
5899
|
output,
|
|
5584
5900
|
stderr: [accumulatedStderr, prematureError].filter(Boolean).join("\n"),
|
|
5585
5901
|
usage: sessionUsage,
|
|
5902
|
+
planQuota,
|
|
5586
5903
|
repoRoot: targetDir
|
|
5587
5904
|
});
|
|
5588
5905
|
}
|
|
@@ -5605,7 +5922,13 @@ Timeout: ${printTimeout}`,
|
|
|
5605
5922
|
target: targetLabel,
|
|
5606
5923
|
issueNumber: routineIssueNumber,
|
|
5607
5924
|
durationMs,
|
|
5608
|
-
usage: sessionUsage
|
|
5925
|
+
usage: sessionUsage,
|
|
5926
|
+
planQuota: planQuota.available ? {
|
|
5927
|
+
gemini5hRemainingPct: planQuota.gemini5hRemainingPct,
|
|
5928
|
+
geminiWeeklyRemainingPct: planQuota.geminiWeeklyRemainingPct,
|
|
5929
|
+
claude5hRemainingPct: planQuota.claude5hRemainingPct,
|
|
5930
|
+
claudeWeeklyRemainingPct: planQuota.claudeWeeklyRemainingPct
|
|
5931
|
+
} : void 0
|
|
5609
5932
|
},
|
|
5610
5933
|
null,
|
|
5611
5934
|
2
|
|
@@ -5633,7 +5956,8 @@ Timeout: ${printTimeout}`,
|
|
|
5633
5956
|
pr: effectivePR,
|
|
5634
5957
|
title: targetTitle,
|
|
5635
5958
|
durationMs,
|
|
5636
|
-
usage: sessionUsage
|
|
5959
|
+
usage: sessionUsage,
|
|
5960
|
+
planQuota
|
|
5637
5961
|
}) + "\n"
|
|
5638
5962
|
);
|
|
5639
5963
|
} else {
|
|
@@ -5645,7 +5969,8 @@ Timeout: ${printTimeout}`,
|
|
|
5645
5969
|
issue: effectiveIssue,
|
|
5646
5970
|
pr: effectivePR,
|
|
5647
5971
|
durationMs,
|
|
5648
|
-
usage: sessionUsage
|
|
5972
|
+
usage: sessionUsage,
|
|
5973
|
+
planQuota
|
|
5649
5974
|
}) + "\n"
|
|
5650
5975
|
);
|
|
5651
5976
|
}
|
|
@@ -5664,6 +5989,7 @@ Timeout: ${printTimeout}`,
|
|
|
5664
5989
|
transientServiceError,
|
|
5665
5990
|
durationMs,
|
|
5666
5991
|
usage: sessionUsage,
|
|
5992
|
+
planQuota,
|
|
5667
5993
|
outcome: routine === "peer-review" && exitCode === 0 ? detectPeerReviewOutcome({
|
|
5668
5994
|
output,
|
|
5669
5995
|
prNumber: effectivePR,
|
|
@@ -5754,8 +6080,8 @@ import pc15 from "picocolors";
|
|
|
5754
6080
|
import fs15 from "fs";
|
|
5755
6081
|
import path15 from "path";
|
|
5756
6082
|
import os3 from "os";
|
|
5757
|
-
import { spawn as spawn2, execFile as
|
|
5758
|
-
import { promisify as
|
|
6083
|
+
import { spawn as spawn2, execFile as execFile6 } from "child_process";
|
|
6084
|
+
import { promisify as promisify6 } from "util";
|
|
5759
6085
|
|
|
5760
6086
|
// src/lib/daemon-keys.ts
|
|
5761
6087
|
import readline2 from "readline";
|
|
@@ -6144,7 +6470,7 @@ function formatDaemonStatusLine(options = {}) {
|
|
|
6144
6470
|
|
|
6145
6471
|
// src/lib/daemon.ts
|
|
6146
6472
|
import pc14 from "picocolors";
|
|
6147
|
-
var
|
|
6473
|
+
var execFileAsync6 = promisify6(execFile6);
|
|
6148
6474
|
function getDaemonStatePath(repoRoot) {
|
|
6149
6475
|
return path15.join(repoRoot, ".jonah-fleet", "daemon.json");
|
|
6150
6476
|
}
|
|
@@ -6322,7 +6648,7 @@ function filterReviewablePRs(prs, options = {}) {
|
|
|
6322
6648
|
}
|
|
6323
6649
|
async function getOpenReviewablePRs(repoRoot, options = {}) {
|
|
6324
6650
|
try {
|
|
6325
|
-
const { stdout } = await
|
|
6651
|
+
const { stdout } = await execFileAsync6(
|
|
6326
6652
|
"gh",
|
|
6327
6653
|
[
|
|
6328
6654
|
"pr",
|
|
@@ -6475,7 +6801,7 @@ function classifyBacklogIssues(issues, openPRs = []) {
|
|
|
6475
6801
|
}
|
|
6476
6802
|
async function getBacklogIssues(repoRoot) {
|
|
6477
6803
|
try {
|
|
6478
|
-
const { stdout } = await
|
|
6804
|
+
const { stdout } = await execFileAsync6(
|
|
6479
6805
|
"gh",
|
|
6480
6806
|
["issue", "list", "--state", "open", "--json", "number,title,labels,assignees,url", "--limit", "50"],
|
|
6481
6807
|
{ cwd: repoRoot, timeout: 5e3 }
|
|
@@ -6487,7 +6813,7 @@ async function getBacklogIssues(repoRoot) {
|
|
|
6487
6813
|
}
|
|
6488
6814
|
async function getOpenPRsForBacklog(repoRoot) {
|
|
6489
6815
|
try {
|
|
6490
|
-
const { stdout } = await
|
|
6816
|
+
const { stdout } = await execFileAsync6(
|
|
6491
6817
|
"gh",
|
|
6492
6818
|
["pr", "list", "--state", "open", "--json", "number,title,body,headRefName,isDraft,labels,assignees,url", "--limit", "50"],
|
|
6493
6819
|
{ cwd: repoRoot, timeout: 5e3 }
|
|
@@ -6565,7 +6891,7 @@ async function stopDaemon(repoRoot) {
|
|
|
6565
6891
|
}
|
|
6566
6892
|
async function queryOrphanedLocalRunIssues(repoRoot) {
|
|
6567
6893
|
try {
|
|
6568
|
-
const { stdout } = await
|
|
6894
|
+
const { stdout } = await execFileAsync6(
|
|
6569
6895
|
"gh",
|
|
6570
6896
|
["issue", "list", "--state", "open", "--label", "runner:local,status:running", "--json", "number,title,createdAt", "--limit", "20"],
|
|
6571
6897
|
{ cwd: repoRoot }
|
package/dist/lib/runner.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PeerReviewOutcome } from './terminal-card.js';
|
|
2
|
-
import { type RunUsageMetrics } from './telemetry.js';
|
|
2
|
+
import { type RunUsageMetrics, type ActualPlanQuota } from './telemetry.js';
|
|
3
3
|
export interface RunLocalRoutineOptions {
|
|
4
4
|
targetDir: string;
|
|
5
5
|
routine: string;
|
|
@@ -32,6 +32,7 @@ export interface RunLocalRoutineResult {
|
|
|
32
32
|
durationMs?: number;
|
|
33
33
|
outcome?: PeerReviewOutcome;
|
|
34
34
|
usage?: RunUsageMetrics;
|
|
35
|
+
planQuota?: ActualPlanQuota;
|
|
35
36
|
}
|
|
36
37
|
export interface StreamJsonEvent {
|
|
37
38
|
event?: string;
|
|
@@ -218,6 +219,7 @@ export interface FallbackReportOptions {
|
|
|
218
219
|
output?: string;
|
|
219
220
|
stderr?: string;
|
|
220
221
|
usage?: RunUsageMetrics;
|
|
222
|
+
planQuota?: ActualPlanQuota;
|
|
221
223
|
repoRoot?: string;
|
|
222
224
|
}
|
|
223
225
|
/**
|
package/dist/lib/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lib/runner.ts"],"names":[],"mappings":"AAQA,OAAO,EAgBL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uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CA4D9E;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBzE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAymBrG"}
|
package/dist/lib/telemetry.d.ts
CHANGED
|
@@ -25,6 +25,39 @@ export interface TokenQuotaWindowUsage {
|
|
|
25
25
|
weeklyStatus: QuotaHealthStatus;
|
|
26
26
|
status: QuotaHealthStatus;
|
|
27
27
|
}
|
|
28
|
+
export interface PlanQuotaBucket {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
window: '5h' | 'weekly' | string;
|
|
32
|
+
remainingFraction: number;
|
|
33
|
+
remainingPercentage: number;
|
|
34
|
+
resetTime: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PlanQuotaGroup {
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
buckets: PlanQuotaBucket[];
|
|
41
|
+
weeklyRemainingPct?: number;
|
|
42
|
+
weeklyResetTime?: string;
|
|
43
|
+
window5hRemainingPct?: number;
|
|
44
|
+
window5hResetTime?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ActualPlanQuota {
|
|
47
|
+
available: boolean;
|
|
48
|
+
description?: string;
|
|
49
|
+
groups: Record<string, PlanQuotaGroup>;
|
|
50
|
+
geminiWeeklyRemainingPct?: number;
|
|
51
|
+
gemini5hRemainingPct?: number;
|
|
52
|
+
geminiWeeklyResetTime?: string;
|
|
53
|
+
gemini5hResetTime?: string;
|
|
54
|
+
claudeWeeklyRemainingPct?: number;
|
|
55
|
+
claude5hRemainingPct?: number;
|
|
56
|
+
claudeWeeklyResetTime?: string;
|
|
57
|
+
claude5hResetTime?: string;
|
|
58
|
+
fetchedAt: string;
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
|
28
61
|
/**
|
|
29
62
|
* Formats a styled quota status badge.
|
|
30
63
|
*/
|
|
@@ -48,6 +81,32 @@ export declare function getRollingWindowTokenUsage(repoRoot: string, options?: {
|
|
|
48
81
|
weeklyLimit?: number;
|
|
49
82
|
now?: number;
|
|
50
83
|
}): TokenQuotaWindowUsage;
|
|
84
|
+
/**
|
|
85
|
+
* Parses structured JSON or tabular text output from `agy --output-format json --print /quota`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseAgyQuotaOutput(raw: string): ActualPlanQuota;
|
|
88
|
+
/**
|
|
89
|
+
* Synchronously retrieves actual plan quota from disk cache or by invoking `agy --output-format json --print /quota`.
|
|
90
|
+
*/
|
|
91
|
+
export declare function getActualPlanQuotaSync(options?: {
|
|
92
|
+
repoRoot?: string;
|
|
93
|
+
cacheTtlMs?: number;
|
|
94
|
+
executor?: () => string;
|
|
95
|
+
}): ActualPlanQuota;
|
|
96
|
+
/**
|
|
97
|
+
* Asynchronously retrieves actual plan quota from disk cache or by invoking `agy --output-format json --print /quota`.
|
|
98
|
+
*/
|
|
99
|
+
export declare function fetchActualPlanQuota(options?: {
|
|
100
|
+
repoRoot?: string;
|
|
101
|
+
cacheTtlMs?: number;
|
|
102
|
+
executor?: () => Promise<string> | string;
|
|
103
|
+
}): Promise<ActualPlanQuota>;
|
|
104
|
+
/**
|
|
105
|
+
* Formats a clean human-readable summary of plan quota for display.
|
|
106
|
+
*/
|
|
107
|
+
export declare function formatPlanQuotaSummary(quota: ActualPlanQuota, options?: {
|
|
108
|
+
markdown?: boolean;
|
|
109
|
+
}): string;
|
|
51
110
|
export interface RoutineTelemetrySummary {
|
|
52
111
|
schemaVersion: '1.0.0';
|
|
53
112
|
routine: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AAIjE,eAAO,MAAM,0BAA0B,UAAY,CAAC;AACpD,eAAO,MAAM,sBAAsB,UAAY,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,iBAAiB,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,iBAAiB,CAAC;IAChC,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5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,CACpC,UAAU,EAAE,MAAM,EAClB,aAAa,GAAE,MAAmC,GACjD,kBAAkB,CAwBpB;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,uBAAuB,EAAE,EACpC,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,mBAAmB,CA0HrB;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,GAAE,OAAO,KAAwB,GAC3C,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB/C;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,GAAE,MAAgB,GAAG,uBAAuB,EAAE,CA6BlH;AAED,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,QAAQ,GAAE,UAA8B,EACxC,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/C,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAgEpC;AAyBD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAsFR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type RunUsageMetrics } from './telemetry.js';
|
|
2
|
-
export type { RunUsageMetrics } from './telemetry.js';
|
|
1
|
+
import { type RunUsageMetrics, type ActualPlanQuota } from './telemetry.js';
|
|
2
|
+
export type { RunUsageMetrics, ActualPlanQuota } from './telemetry.js';
|
|
3
3
|
export interface SummaryCardOptions {
|
|
4
4
|
routine: string;
|
|
5
5
|
output?: string;
|
|
@@ -9,6 +9,7 @@ export interface SummaryCardOptions {
|
|
|
9
9
|
title?: string;
|
|
10
10
|
durationMs?: number;
|
|
11
11
|
usage?: RunUsageMetrics;
|
|
12
|
+
planQuota?: ActualPlanQuota;
|
|
12
13
|
}
|
|
13
14
|
export interface ErrorCardOptions {
|
|
14
15
|
routine: string;
|
|
@@ -19,6 +20,7 @@ export interface ErrorCardOptions {
|
|
|
19
20
|
durationMs?: number;
|
|
20
21
|
error?: Error;
|
|
21
22
|
usage?: RunUsageMetrics;
|
|
23
|
+
planQuota?: ActualPlanQuota;
|
|
22
24
|
}
|
|
23
25
|
export interface ParsedRunSummary {
|
|
24
26
|
routine?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIvE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,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