opencode-usage-coach 0.9.0 → 0.9.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -10
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -1169,17 +1169,15 @@ function fetchQuota(provider) {
1169
1169
  });
1170
1170
  });
1171
1171
  }
1172
- function fetchQuotaWithRetry(provider, maxRetries = 3) {
1173
- return new Promise(async (resolve2) => {
1174
- for (let attempt = 0; attempt < maxRetries; attempt++) {
1175
- const q = await fetchQuota(provider);
1176
- if (q) return resolve2(q);
1177
- if (attempt < maxRetries - 1) {
1178
- await new Promise((r) => setTimeout(r, 1e3 * (attempt + 1)));
1179
- }
1172
+ async function fetchQuotaWithRetry(provider, maxRetries = 3) {
1173
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
1174
+ const q = await fetchQuota(provider);
1175
+ if (q) return q;
1176
+ if (attempt < maxRetries - 1) {
1177
+ await new Promise((r) => setTimeout(r, 1e3 * (attempt + 1)));
1180
1178
  }
1181
- resolve2(null);
1182
- });
1179
+ }
1180
+ return null;
1183
1181
  }
1184
1182
  function coach(q, lighter) {
1185
1183
  if (!q) return { decision: "GO", advice: "quota unavailable \u2014 retrying. proceeding cautiously.", weekly: -2, monthly: -2, fiveHour: -2 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-usage-coach",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "opencode closed-loop usage coach — quota SENSE -> coaching DECIDE -> loop ACT + TUI integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,6 +53,7 @@
53
53
  "@opencode-ai/plugin": "*",
54
54
  "@opentui/core": ">=0.4.0",
55
55
  "@opentui/solid": ">=0.4.0",
56
+ "@types/node": "^26.1.1",
56
57
  "c8": "^11.0.0",
57
58
  "esbuild-plugin-solid": "^0.6.0",
58
59
  "eslint": "^10.6.0",