feat(ai): added Synthetic usage provider

/usage and omp usage now report Synthetic (synthetic.new) quota state
via GET /v2/quotas (free, does not consume quota): the rolling 5-hour
request limit with per-tick regeneration rate, and the weekly credit
quota in USD. Applies to API-key credentials for the synthetic
provider; every payload section is parsed defensively since only
subscription is documented.
This commit is contained in:
Gareth-Rouse
2026-07-10 08:14:09 +01:00
parent 7504d4c24d
commit e2839d1288
9 changed files with 416 additions and 9 deletions
+1 -1
View File
@@ -409,7 +409,7 @@ function formatLimitLine(limit: UsageLimit, labelWidth: number, nowMs: number):
const details: string[] = [describeAmount(limit)];
const resetsAt = limit.window?.resetsAt;
if (resetsAt !== undefined && resetsAt > nowMs) {
details.push(`resets in ${formatDuration(resetsAt - nowMs)}`);
details.push(`${limit.window?.resetLabel ?? "resets"} in ${formatDuration(resetsAt - nowMs)}`);
}
const lines = [
` ${STATUS_COLOR[status]("●")} ${padded} ${renderBar(limit)} ${chalk.dim(details.join(" · "))}`,