@getpaseo/cli 0.12.0-beta.2 → 0.12.0-beta.3

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.
@@ -34,8 +34,17 @@ function summary(entry) {
34
34
  const lines = [failureText(report)];
35
35
  for (const login of entry.loginErrors ?? [])
36
36
  lines.push(`${login.harness}: ${failureText(login.report)}`);
37
+ if (entry.lastSuccessful) {
38
+ lines.push(`Last successful: ${entry.lastSuccessful.fetchedAt}`);
39
+ lines.push(...availableSummary(entry.lastSuccessful.report).map((line) => `Retained: ${line}`));
40
+ }
41
+ else
42
+ lines.push("No successful update");
37
43
  return lines;
38
44
  }
45
+ return [...availableSummary(report), `Last successful: ${successfulTime(entry)}`];
46
+ }
47
+ function availableSummary(report) {
39
48
  const lines = report.windows.map(windowText);
40
49
  lines.push(...(report.balances ?? []).map(balanceText));
41
50
  return lines.length ? lines : ["-"];
@@ -48,7 +57,7 @@ const summarySchema = {
48
57
  { header: "ACCOUNT", field: "account" },
49
58
  { header: "STATUS", field: "status" },
50
59
  { header: "USAGE", field: "usage" },
51
- { header: "FETCHED", field: "fetched" },
60
+ { header: "FETCHED (LATEST ATTEMPT)", field: "fetched" },
52
61
  ],
53
62
  };
54
63
  function inspect(entry) {
@@ -58,34 +67,17 @@ function inspect(entry) {
58
67
  `Source ID: ${entry.sourceId}`,
59
68
  `Account: ${value(entry.account.label)}`,
60
69
  `Status: ${entry.report.status}`,
61
- `Fetched: ${value(entry.fetchedAt)}`,
70
+ `Latest attempt: ${value(entry.fetchedAt)}`,
62
71
  ];
63
- const { report } = entry;
64
- if (report.status === "available") {
65
- lines.push(`Plan: ${value(report.planLabel)}`, "Windows:");
66
- if (!report.windows.length)
67
- lines.push(" -");
68
- for (const window of report.windows) {
69
- lines.push(` ${windowText(window)} [${window.id}]`, ` Resets: ${value(window.resetsAt)}`);
70
- if (window.runsOutAt != null)
71
- lines.push(` Runs out: ${window.runsOutAt}`);
72
- if (window.shortfallPct != null)
73
- lines.push(` Shortfall: ${percent(window.shortfallPct)}`);
74
- }
75
- lines.push("Balances:");
76
- if (!report.balances?.length)
77
- lines.push(" -");
78
- for (const balance of report.balances ?? []) {
79
- lines.push(` ${balanceText(balance)} [${balance.id}]`, ` Resets: ${value(balance.resetsAt)}`);
80
- }
81
- lines.push("Details:");
82
- if (!report.details?.length)
83
- lines.push(" -");
84
- for (const detail of report.details ?? [])
85
- lines.push(` ${detail.label}: ${detail.value}`);
86
- }
87
- else {
88
- lines.push(`Reason: ${failureText(report)}`);
72
+ const report = entry.report.status === "available" ? entry.report : entry.lastSuccessful?.report;
73
+ const successfulAt = successfulTime(entry);
74
+ lines.push(successfulAt ? `Last successful: ${successfulAt}` : "No successful update");
75
+ if (entry.report.status !== "available")
76
+ lines.push(`Reason: ${failureText(entry.report)}`);
77
+ if (report) {
78
+ if (entry.report.status !== "available")
79
+ lines.push("Retained usage:");
80
+ lines.push(...availableDetails(report));
89
81
  }
90
82
  if (entry.loginErrors?.length) {
91
83
  lines.push("Login failures:");
@@ -119,4 +111,36 @@ export const usageSchema = {
119
111
  return renderTable({ type: "list", data: rows, schema: summarySchema }, options);
120
112
  },
121
113
  };
114
+ function availableDetails(report) {
115
+ const lines = [];
116
+ lines.push(`Plan: ${value(report.planLabel)}`, "Windows:");
117
+ if (!report.windows.length)
118
+ lines.push(" -");
119
+ for (const window of report.windows) {
120
+ lines.push(` ${windowText(window)} [${window.id}]`, ` Resets: ${value(window.resetsAt)}`);
121
+ if (window.runsOutAt != null)
122
+ lines.push(` Runs out: ${window.runsOutAt}`);
123
+ if (window.shortfallPct != null)
124
+ lines.push(` Shortfall: ${percent(window.shortfallPct)}`);
125
+ }
126
+ lines.push("Balances:");
127
+ if (!report.balances?.length)
128
+ lines.push(" -");
129
+ for (const balance of report.balances ?? []) {
130
+ lines.push(` ${balanceText(balance)} [${balance.id}]`, ` Resets: ${value(balance.resetsAt)}`);
131
+ }
132
+ lines.push("Details:");
133
+ if (!report.details?.length)
134
+ lines.push(" -");
135
+ for (const detail of report.details ?? [])
136
+ lines.push(` ${detail.label}: ${detail.value}`);
137
+ return lines;
138
+ }
139
+ function successfulTime(entry) {
140
+ // COMPAT(usageSuccessfulAt): added in v0.12.0, remove after 2027-04-17 once daemon floor >= v0.12.0.
141
+ // Only available reports from older daemons can use their attempt timestamp as freshness.
142
+ if (entry.report.status === "available")
143
+ return entry.successfulAt ?? entry.fetchedAt;
144
+ return entry.lastSuccessful?.fetchedAt;
145
+ }
122
146
  //# sourceMappingURL=presentation.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/cli",
3
- "version": "0.12.0-beta.2",
3
+ "version": "0.12.0-beta.3",
4
4
  "description": "Paseo CLI - control your AI coding agents from the command line",
5
5
  "bin": {
6
6
  "paseo": "bin/paseo"
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@clack/prompts": "^1.0.0",
31
- "@getpaseo/client": "0.12.0-beta.2",
32
- "@getpaseo/protocol": "0.12.0-beta.2",
33
- "@getpaseo/server": "0.12.0-beta.2",
31
+ "@getpaseo/client": "0.12.0-beta.3",
32
+ "@getpaseo/protocol": "0.12.0-beta.3",
33
+ "@getpaseo/server": "0.12.0-beta.3",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
36
36
  "mime-types": "^2.1.35",