@hashimkarim/usagestat-linux-x64-gnu 2.1.0 → 2.2.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.
Files changed (81) hide show
  1. package/native-manifest.json +197 -89
  2. package/package.json +19 -1
  3. package/plugins/abliteration/plugin.json +1 -1
  4. package/plugins/aerostack/plugin.json +1 -1
  5. package/plugins/aixy/plugin.json +1 -1
  6. package/plugins/atlascloud/plugin.json +1 -1
  7. package/plugins/bifrost/plugin.json +1 -1
  8. package/plugins/chatbox/plugin.json +1 -1
  9. package/plugins/claudeplatform/plugin.json +1 -1
  10. package/plugins/codex/plugin.js +11 -6
  11. package/plugins/codex/plugin.json +10 -1
  12. package/plugins/cosmic/plugin.json +1 -1
  13. package/plugins/cursor/plugin.js +18 -6
  14. package/plugins/devpass/plugin.json +1 -1
  15. package/plugins/exa/plugin.json +1 -1
  16. package/plugins/fal/plugin.json +1 -1
  17. package/plugins/flora/plugin.json +1 -1
  18. package/plugins/futureagi/plugin.json +1 -1
  19. package/plugins/gemini-apps/plugin.json +1 -1
  20. package/plugins/gitkraken/plugin.json +1 -1
  21. package/plugins/googledeveloper/LICENSE +21 -0
  22. package/plugins/googledeveloper/icon.svg +3 -0
  23. package/plugins/googledeveloper/plugin.js +204 -0
  24. package/plugins/googledeveloper/plugin.json +25 -0
  25. package/plugins/helmcode/plugin.js +80 -23
  26. package/plugins/helmcode/plugin.json +2 -2
  27. package/plugins/huggingface/plugin.json +1 -1
  28. package/plugins/hyper/plugin.json +1 -1
  29. package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
  30. package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
  31. package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
  32. package/plugins/kimi/plugin.js +16 -1
  33. package/plugins/kimi/plugin.json +46 -6
  34. package/plugins/langdock/plugin.json +1 -1
  35. package/plugins/linkup/plugin.json +1 -1
  36. package/plugins/lithosai/plugin.json +1 -1
  37. package/plugins/llmman/plugin.json +1 -1
  38. package/plugins/munito/plugin.json +1 -1
  39. package/plugins/muse/plugin.json +1 -1
  40. package/plugins/museai/plugin.js +5 -3
  41. package/plugins/museai/plugin.json +2 -2
  42. package/plugins/nous/plugin.json +1 -1
  43. package/plugins/opencode-go/plugin.js +4 -3
  44. package/plugins/opendesign/LICENSE +21 -0
  45. package/plugins/opendesign/icon.svg +4 -0
  46. package/plugins/opendesign/plugin.js +108 -0
  47. package/plugins/opendesign/plugin.json +25 -0
  48. package/plugins/parallel/plugin.json +1 -1
  49. package/plugins/perplexity/LICENSE +22 -0
  50. package/plugins/perplexity/plugin.js +122 -0
  51. package/plugins/perplexity/plugin.json +36 -7
  52. package/plugins/qwencloud/plugin.json +1 -1
  53. package/plugins/raycast/plugin.json +1 -1
  54. package/plugins/replicate/plugin.json +1 -1
  55. package/plugins/sailresearch/plugin.json +1 -1
  56. package/plugins/siliconflow/LICENSE +21 -0
  57. package/plugins/siliconflow/icon.svg +3 -0
  58. package/plugins/siliconflow/plugin.js +87 -0
  59. package/plugins/siliconflow/plugin.json +32 -0
  60. package/plugins/sofya/plugin.json +1 -1
  61. package/plugins/soniox/plugin.json +1 -1
  62. package/plugins/synthetic/plugin.js +12 -0
  63. package/plugins/synthetic/plugin.json +51 -9
  64. package/plugins/tavily/plugin.json +1 -1
  65. package/plugins/tinyapi/plugin.json +1 -1
  66. package/plugins/traecn/plugin.js +10 -11
  67. package/plugins/traecn/plugin.json +2 -2
  68. package/plugins/tripo/LICENSE +21 -0
  69. package/plugins/tripo/icon.svg +4 -0
  70. package/plugins/tripo/plugin.js +60 -0
  71. package/plugins/tripo/plugin.json +24 -0
  72. package/plugins/typesafe/plugin.js +63 -112
  73. package/plugins/typesafe/plugin.json +2 -2
  74. package/plugins/v0/plugin.json +1 -1
  75. package/plugins/vercel/plugin.json +2 -2
  76. package/plugins/workbuddy/plugin.js +103 -17
  77. package/plugins/workbuddy/plugin.json +14 -2
  78. package/plugins/xapi/plugin.json +1 -1
  79. package/plugins/xkiro/plugin.json +1 -1
  80. package/usagestat +0 -0
  81. package/usagestatd +0 -0
@@ -59,8 +59,9 @@ defineProvider({
59
59
  return fail("invalid JSON");
60
60
  }
61
61
  };
62
- const integer = (value, field) => {
63
- if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) return fail(field);
62
+ const amount = (value, field, fractional = false) => {
63
+ const valid = fractional ? Number.isFinite(value) : Number.isSafeInteger(value);
64
+ if (typeof value !== "number" || !valid || value < 0) return fail(field);
64
65
  return value;
65
66
  };
66
67
  async function* sessions() {
@@ -93,19 +94,75 @@ defineProvider({
93
94
  };
94
95
  const get = (path, timeoutSeconds = 8) =>
95
96
  ctx.http.get(`https://cloud-api.${tenant.domain}${path}`, { headers, timeoutSeconds });
96
- const response = await get("/api/usage/quota");
97
- if ((response.status >= 300 && response.status < 400) || response.status === 401 || response.status === 403) {
98
- ctx.browser.rejectCookie(domain, session);
99
- rejected = true;
100
- continue;
97
+ const required = async (path, allowMissing = false) => {
98
+ const response = await get(path);
99
+ if ((response.status >= 300 && response.status < 400) || response.status === 401 || response.status === 403) {
100
+ ctx.browser.rejectCookie(domain, session);
101
+ rejected = true;
102
+ return undefined;
103
+ }
104
+ const seconds = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
105
+ const retryAfterSeconds = Number.isFinite(seconds) && seconds >= 0 ? Math.min(10, seconds) : 1;
106
+ if (response.status === 429) throw ctx.fail.rateLimited("Helmcode rate limit reached.", { retryAfterSeconds });
107
+ if (response.status === 408 || response.status >= 500)
108
+ throw ctx.fail.providerUnavailable("Helmcode dashboard is unavailable.", { retryAfterSeconds });
109
+ if ((response.status < 200 || response.status >= 300) && !(allowMissing && response.status === 404))
110
+ throw ctx.fail.apiFailure(`Helmcode dashboard returned HTTP ${response.status}.`);
111
+ return response;
112
+ };
113
+ const creditResponse = await required("/api/usage/credits", true);
114
+ if (!creditResponse) continue;
115
+ const credits = creditResponse.status === 404 ? undefined : parse(creditResponse.bodyText);
116
+ if (credits && typeof credits.enabled !== "boolean") return fail("enabled");
117
+ // Only an absent or explicitly disabled credit plan permits legacy token quotas.
118
+ if (_optionalChain([credits, "optionalAccess", (_) => _.enabled])) {
119
+ const allowance = amount(credits.allowanceCredits, "allowanceCredits", true);
120
+ const spent = amount(credits.usedCredits, "usedCredits", true);
121
+ if (allowance <= 0) return fail("allowanceCredits");
122
+ const start = typeof credits.periodStart === "string" ? ctx.date.iso(credits.periodStart) : undefined;
123
+ const end = typeof credits.periodEnd === "string" ? ctx.date.iso(credits.periodEnd) : undefined;
124
+ const format = (value, field) =>
125
+ value == null ? "—" : ctx.format.number(amount(value, field, true), { maximumFractionDigits: 3 });
126
+ const models = (Array.isArray(credits.models) ? credits.models : []).map((value) => {
127
+ const row = _nullishCoalesce(object(value), () => fail("credit model"));
128
+ if (typeof row.model !== "string" || !ctx.isDetailLabel(row.model)) return fail("credit model name");
129
+ return {
130
+ label: row.model,
131
+ value: format(row.creditsThisMonth, "creditsThisMonth"),
132
+ weight: format(row.approxCreditsPerMTokens, "approxCreditsPerMTokens"),
133
+ };
134
+ });
135
+ const rows = models.slice(0, 20).map(({ label, value }) => ({ label, value }));
136
+ if (models.length > 20) rows.push({ label: "Other models", value: "—" });
137
+ const planRows = [];
138
+ if (credits.packCredits != null)
139
+ planRows.push({ label: "Top-up credits", value: format(credits.packCredits, "packCredits") });
140
+ if (credits.frozen === true) planRows.push({ label: "Paused during grace period", value: "—" });
141
+ return {
142
+ primary: {
143
+ title: "Credits",
144
+ usedPercent: ctx.pct(spent, allowance),
145
+ resetsAt: end,
146
+ windowMinutes:
147
+ start && end && end > start ? Math.round((end.getTime() - start.getTime()) / 60000) : undefined,
148
+ quotaLimit: allowance,
149
+ quotaUnit: "credits",
150
+ resetDescription: `${format(spent, "usedCredits")} / ${format(allowance, "allowanceCredits")}`,
151
+ },
152
+ details: [
153
+ { title: "Credits used", rows },
154
+ {
155
+ title: "Credits per million tokens",
156
+ rows: models.slice(0, 20).map(({ label, weight }) => ({ label, value: weight })),
157
+ },
158
+ ...(planRows.length ? [{ title: "Credits", rows: planRows }] : []),
159
+ ],
160
+ identity: { organization: tenant.name, loginMethod: "Dashboard session" },
161
+ dataConfidence: "exact",
162
+ };
101
163
  }
102
- const seconds = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
103
- const retryAfterSeconds = Number.isFinite(seconds) && seconds >= 0 ? Math.min(10, seconds) : 1;
104
- if (response.status === 429) throw ctx.fail.rateLimited("Helmcode rate limit reached.", { retryAfterSeconds });
105
- if (response.status === 408 || response.status >= 500)
106
- throw ctx.fail.providerUnavailable("Helmcode dashboard is unavailable.", { retryAfterSeconds });
107
- if (response.status < 200 || response.status >= 300)
108
- throw ctx.fail.apiFailure(`Helmcode dashboard returned HTTP ${response.status}.`);
164
+ const response = await required("/api/usage/quota");
165
+ if (!response) continue;
109
166
  const quota = parse(response.bodyText);
110
167
  if (typeof quota.periodStart !== "string" || !Array.isArray(quota.models)) return fail("periodStart or models");
111
168
  const optional = async (path) => {
@@ -122,9 +179,9 @@ defineProvider({
122
179
  _optionalChain([
123
180
  object,
124
181
  "call",
125
- (_) => _(_optionalChain([billing, "optionalAccess", (_2) => _2.subscription])),
182
+ (_2) => _2(_optionalChain([billing, "optionalAccess", (_3) => _3.subscription])),
126
183
  "optionalAccess",
127
- (_3) => _3.premium,
184
+ (_4) => _4.premium,
128
185
  ]) === true;
129
186
  const start = /^(\d{4})-(\d{2})-(\d{2})(?:T|$)/.exec(quota.periodStart);
130
187
  const fallback =
@@ -135,10 +192,10 @@ defineProvider({
135
192
  .map((value) => {
136
193
  const row = _nullishCoalesce(object(value), () => fail("model"));
137
194
  if (typeof row.model !== "string" || !ctx.isDetailLabel(row.model)) return fail("model name");
138
- const cap = integer(row.cap, "cap");
139
- const used = integer(row.tokensUsed, "tokensUsed");
140
- const credit = row.creditTokens == null ? 0 : integer(row.creditTokens, "creditTokens");
141
- const hours = row.windowHours == null ? undefined : integer(row.windowHours, "windowHours");
195
+ const cap = amount(row.cap, "cap");
196
+ const used = amount(row.tokensUsed, "tokensUsed");
197
+ const credit = row.creditTokens == null ? 0 : amount(row.creditTokens, "creditTokens");
198
+ const hours = row.windowHours == null ? undefined : amount(row.windowHours, "windowHours");
142
199
  if (hours !== undefined && (hours < 1 || hours > 525600 / 60)) return fail("windowHours");
143
200
  let resetsAt = fallback;
144
201
  if (typeof row.periodEnd === "string") {
@@ -167,9 +224,9 @@ defineProvider({
167
224
  let cost;
168
225
  if (tenant.domain === "helmcode.com") {
169
226
  const credits = await optional("/api/billing/credits");
170
- const balance = _optionalChain([credits, "optionalAccess", (_4) => _4.balanceMicros]);
227
+ const balance = _optionalChain([credits, "optionalAccess", (_5) => _5.balanceMicros]);
171
228
  const currency =
172
- _optionalChain([credits, "optionalAccess", (_5) => _5.currency]) == null
229
+ _optionalChain([credits, "optionalAccess", (_6) => _6.currency]) == null
173
230
  ? "EUR"
174
231
  : typeof credits.currency === "string"
175
232
  ? credits.currency.toUpperCase()
@@ -178,7 +235,7 @@ defineProvider({
178
235
  cost = { used: Math.max(0, balance / 1e6), limit: 0, currency, period: "Prepaid balance" };
179
236
  }
180
237
  return {
181
- primary: _optionalChain([windows, "access", (_6) => _6[0], "optionalAccess", (_7) => _7.window]),
238
+ primary: _optionalChain([windows, "access", (_7) => _7[0], "optionalAccess", (_8) => _8.window]),
182
239
  extraWindows: windows.slice(1),
183
240
  cost,
184
241
  identity: { organization: tenant.name, loginMethod: "Dashboard session" },
@@ -24,9 +24,9 @@
24
24
  ],
25
25
  "upstream": {
26
26
  "repository": "https://github.com/steipete/CodexBar",
27
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
27
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
28
28
  "path": "Sources/CodexBarCore/Resources/Plugins/helmcode.js",
29
- "sha256": "9aa6a515eda5c361f340a6535342ccaba9365a06124eec1501e7744c33765430",
29
+ "sha256": "058d7d04a6d2fca8221a96aa6c451f4c6f4ad2a4653c9dd03d6b714a63f8c1dd",
30
30
  "license": "MIT"
31
31
  }
32
32
  }
@@ -18,7 +18,7 @@
18
18
  "setupFields": [],
19
19
  "upstream": {
20
20
  "repository": "https://github.com/steipete/CodexBar",
21
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
21
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
22
22
  "path": "Sources/CodexBarCore/Resources/Plugins/huggingface.js",
23
23
  "sha256": "78cb1bb09535c71f7cb9d1a6336efb4ead44b36a1d4716602c1f7a1e35821291",
24
24
  "license": "MIT"
@@ -19,7 +19,7 @@
19
19
  "setupFields": [],
20
20
  "upstream": {
21
21
  "repository": "https://github.com/steipete/CodexBar",
22
- "revision": "6070b29a1a5d51193a634dc1b0a14a67c39d0ccc",
22
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
23
23
  "path": "Sources/CodexBarCore/Resources/Plugins/hyper.js",
24
24
  "sha256": "a8201abe6997057547d6294882b27c4040ac03e151f7ac4678b7c28844170cd5",
25
25
  "license": "MIT"
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Robin Ebers (original macOS creator)
4
+ Copyright (c) 2026 barramee kottanawadee
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.