@letterstory/cli 0.149.0 → 0.149.1
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/lib/cli.mjs +1 -1
- package/lib/commands/org.mjs +31 -24
- package/lib/commands/repo.mjs +2 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
|
|
67
67
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
68
68
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
69
|
-
export const VERSION = "0.149.
|
|
69
|
+
export const VERSION = "0.149.1";
|
|
70
70
|
|
|
71
71
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
72
72
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
package/lib/commands/org.mjs
CHANGED
|
@@ -158,33 +158,40 @@ async function orgBilling(ctx) {
|
|
|
158
158
|
}
|
|
159
159
|
refuseUnknownFlags(ctx, {}, []);
|
|
160
160
|
const result = await client.callTool("get_billing_payments", {});
|
|
161
|
-
printResult(io, flags, result,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
r.
|
|
172
|
-
|
|
161
|
+
printResult(io, flags, result, billingAccountText);
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** `org billing` as text (MCP get_billing_payments): the plan, this period, the cap and failed payments. */
|
|
166
|
+
export function billingAccountText(r) {
|
|
167
|
+
const ended = r.status === "ended";
|
|
168
|
+
const u = r.usage;
|
|
169
|
+
return [
|
|
170
|
+
r.plan
|
|
171
|
+
? `Plan: ${r.plan.name}${r.plan.ratio !== 1 ? ` (${r.plan.ratio}x)` : ""}${ended ? `, cancelled${r.canceledAt ? ` on ${r.canceledAt.slice(0, 10)}` : ""}.` : ""}`
|
|
172
|
+
: "Not billed by usage yet.",
|
|
173
|
+
...(u
|
|
174
|
+
? [
|
|
175
|
+
`This period (${u.periodFrom.slice(0, 10)} to ${u.periodTo.slice(0, 10)}): ${u.usedTokens} of ${u.allowanceTokens} tokens included${u.overageUsd > 0 ? `, ${usd(u.overageUsd)} of overage so far${u.overageChargedUsd ? ` (${usd(u.overageChargedUsd)} of it already charged to the card)` : ""}` : ""}${u.runningTokens ? `; ${u.runningTokens} more held by running work${u.runningOverageUsd > 0 ? ` (${usd(u.runningOverageUsd)} against the cap)` : ""}` : ""}.`,
|
|
176
|
+
]
|
|
177
|
+
: []),
|
|
178
|
+
ended
|
|
179
|
+
? null
|
|
180
|
+
: r.spendCap
|
|
181
|
+
? `Spend cap: ${usd(r.spendCap.usd)} of overage a month${u?.availableTokens != null ? `, ${Math.max(0, u.availableTokens)} tokens left under it` : ""}.`
|
|
173
182
|
: r.plan
|
|
174
183
|
? "No spend cap: overage is on."
|
|
175
184
|
: null,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
);
|
|
187
|
-
return 0;
|
|
185
|
+
...(r.pastDueAt ? [`Past due since ${r.pastDueAt}.`] : []),
|
|
186
|
+
...(r.payments.length
|
|
187
|
+
? r.payments.map(
|
|
188
|
+
(p) =>
|
|
189
|
+
` ${p.invoiceNumber ?? p.invoiceId} $${(p.amountCents / 100).toFixed(2)} ${p.status}${p.nextAttemptAt ? `, next try ${p.nextAttemptAt}` : ""}${p.payUrl ? ` pay: ${p.payUrl}` : ""}`
|
|
190
|
+
)
|
|
191
|
+
: ["No failed payments."]),
|
|
192
|
+
]
|
|
193
|
+
.filter((line) => line !== null)
|
|
194
|
+
.join("\n");
|
|
188
195
|
}
|
|
189
196
|
|
|
190
197
|
const tokensOrQty = (p) => `${p.billableQuantity}${p.tokens === null ? "" : ` ${p.tokens} tokens`}`;
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -71,6 +71,8 @@ const ARGS = {
|
|
|
71
71
|
with_preview: { flag: "with-preview", type: "bool" },
|
|
72
72
|
// --harness claude-code|letterpress-1: the coding agent; omitted, the deployment's default.
|
|
73
73
|
harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
|
|
74
|
+
// --again: start it even when an open change already asks for the same thing.
|
|
75
|
+
again: { flag: "again", type: "bool" },
|
|
74
76
|
// --verifier / --no-verifier: review the change before it goes out; omitted, the deployment's choice.
|
|
75
77
|
verifier: { value: (flags) => (flags["no-verifier"] ? false : flags.verifier ? true : undefined) },
|
|
76
78
|
},
|