@staff0rd/assist 0.539.0 → 0.540.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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.539.0",
9
+ version: "0.540.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -35245,6 +35245,8 @@ import chalk215 from "chalk";
35245
35245
  // src/shared/rateLimitLevel.ts
35246
35246
  var FIVE_HOUR_SECONDS = 5 * 3600;
35247
35247
  var SEVEN_DAY_SECONDS = 7 * 86400;
35248
+ var RATE_LIMIT_WARN_PCT = 75;
35249
+ var RATE_LIMIT_OVER_PCT = 100;
35248
35250
  function rateLimitElapsedFraction(resetsAt, windowSeconds, now) {
35249
35251
  if (resetsAt == null) return void 0;
35250
35252
  const timeRemaining = Math.max(0, resetsAt - now);
@@ -35269,8 +35271,8 @@ function projectUsage(pct, resetsAt, windowSeconds, now) {
35269
35271
  function rateLimitLevel(pct, resetsAt, windowSeconds, now) {
35270
35272
  const projected = projectUsage(pct, resetsAt, windowSeconds, now);
35271
35273
  if (projected == null) return "ok";
35272
- if (projected > 100) return "over";
35273
- if (projected > 75) return "warn";
35274
+ if (projected > RATE_LIMIT_OVER_PCT) return "over";
35275
+ if (projected > RATE_LIMIT_WARN_PCT) return "warn";
35274
35276
  return "ok";
35275
35277
  }
35276
35278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.539.0",
3
+ "version": "0.540.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {