@hashimkarim/usagestat-darwin-arm64 2.0.0-alpha.3 → 2.3.2

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 (284) hide show
  1. package/native-manifest.json +1532 -134
  2. package/package.json +235 -2
  3. package/plugins/UPSTREAM-LICENSES.md +6 -2
  4. package/plugins/_provider-icons/LICENSE +21 -0
  5. package/plugins/_provider-icons/NOTICE +12 -0
  6. package/plugins/_provider-icons/licenses/CodexBar-MIT.txt +21 -0
  7. package/plugins/_provider-icons/licenses/LobeHub-MIT.txt +21 -0
  8. package/plugins/_provider-icons/licenses/UsageStat-Bar-MIT.txt +21 -0
  9. package/plugins/_provider-icons/manifest.json +1219 -0
  10. package/plugins/_provider-icons/provenance.json +269 -0
  11. package/plugins/_provider-icons/source.json +4 -0
  12. package/plugins/abacus-ai/icon-color.svg +18 -0
  13. package/plugins/abliteration/LICENSE +21 -0
  14. package/plugins/abliteration/icon.svg +5 -0
  15. package/plugins/abliteration/plugin.js +89 -0
  16. package/plugins/abliteration/plugin.json +24 -0
  17. package/plugins/aerostack/LICENSE +21 -0
  18. package/plugins/aerostack/icon.svg +1 -0
  19. package/plugins/aerostack/plugin.js +94 -0
  20. package/plugins/aerostack/plugin.json +24 -0
  21. package/plugins/aixy/LICENSE +21 -0
  22. package/plugins/aixy/icon.svg +1 -0
  23. package/plugins/aixy/plugin.js +266 -0
  24. package/plugins/aixy/plugin.json +32 -0
  25. package/plugins/antigravity/plugin.js +189 -65
  26. package/plugins/antigravity-cli/icon-color.svg +1 -0
  27. package/plugins/antigravity-cli/icon.svg +1 -3
  28. package/plugins/antigravity-cli/plugin.js +32 -20
  29. package/plugins/antigravity-ide/icon-color.svg +1 -0
  30. package/plugins/antigravity-ide/icon.svg +1 -3
  31. package/plugins/antigravity-ide/plugin.js +19 -7
  32. package/plugins/atlascloud/LICENSE +21 -0
  33. package/plugins/atlascloud/icon-color.svg +1 -0
  34. package/plugins/atlascloud/icon.svg +1 -0
  35. package/plugins/atlascloud/plugin.js +54 -0
  36. package/plugins/atlascloud/plugin.json +24 -0
  37. package/plugins/augment/icon-color.svg +14 -0
  38. package/plugins/bifrost/LICENSE +21 -0
  39. package/plugins/bifrost/icon.svg +3 -0
  40. package/plugins/bifrost/plugin.js +366 -0
  41. package/plugins/bifrost/plugin.json +31 -0
  42. package/plugins/chatbox/LICENSE +21 -0
  43. package/plugins/chatbox/icon.svg +4 -0
  44. package/plugins/chatbox/plugin.js +208 -0
  45. package/plugins/chatbox/plugin.json +24 -0
  46. package/plugins/claude/plugin.js +340 -153
  47. package/plugins/claude/plugin.json +1 -1
  48. package/plugins/claudeplatform/LICENSE +21 -0
  49. package/plugins/claudeplatform/icon.svg +3 -0
  50. package/plugins/claudeplatform/plugin.js +244 -0
  51. package/plugins/claudeplatform/plugin.json +25 -0
  52. package/plugins/clinepass/plugin.js +19 -3
  53. package/plugins/codebuff/icon-color.svg +92 -0
  54. package/plugins/coderabbit/plugin.js +25 -0
  55. package/plugins/coderabbit/plugin.json +12 -0
  56. package/plugins/codex/plugin.js +15 -8
  57. package/plugins/codex/plugin.json +11 -2
  58. package/plugins/command-code/icon-color.svg +3 -0
  59. package/plugins/command-code/plugin.js +7 -3
  60. package/plugins/copilot/icon.svg +1 -1
  61. package/plugins/copilot/plugin.json +1 -0
  62. package/plugins/cosmic/LICENSE +21 -0
  63. package/plugins/cosmic/icon.svg +1 -0
  64. package/plugins/cosmic/plugin.js +134 -0
  65. package/plugins/cosmic/plugin.json +32 -0
  66. package/plugins/crof/icon-color.svg +3 -0
  67. package/plugins/crofai/icon-color.svg +3 -0
  68. package/plugins/crofai/icon.svg +2 -15
  69. package/plugins/cursor/icon-color.svg +1 -0
  70. package/plugins/cursor/plugin.js +51 -14
  71. package/plugins/cursor-nightly/plugin.json +1 -1
  72. package/plugins/deepinfra/icon-color.svg +1 -0
  73. package/plugins/deepinfra/icon.svg +1 -4
  74. package/plugins/deepseek/plugin.js +150 -59
  75. package/plugins/deepseek/plugin.json +3 -1
  76. package/plugins/devin/plugin.js +3 -0
  77. package/plugins/devpass/LICENSE +21 -0
  78. package/plugins/devpass/icon.svg +3 -0
  79. package/plugins/devpass/plugin.js +120 -0
  80. package/plugins/devpass/plugin.json +24 -0
  81. package/plugins/elevenlabs/icon-color.svg +4 -0
  82. package/plugins/exa/LICENSE +21 -0
  83. package/plugins/exa/icon-color.svg +1 -0
  84. package/plugins/exa/icon.svg +1 -0
  85. package/plugins/exa/plugin.js +75 -0
  86. package/plugins/exa/plugin.json +32 -0
  87. package/plugins/factory/icon-color.svg +1 -0
  88. package/plugins/fal/LICENSE +21 -0
  89. package/plugins/fal/icon-color.svg +1 -0
  90. package/plugins/fal/icon.svg +1 -0
  91. package/plugins/fal/plugin.js +74 -0
  92. package/plugins/fal/plugin.json +24 -0
  93. package/plugins/fireworks-ai/icon-color.svg +1 -0
  94. package/plugins/fireworks-ai/icon.svg +1 -6
  95. package/plugins/flora/LICENSE +21 -0
  96. package/plugins/flora/icon.svg +4 -0
  97. package/plugins/flora/plugin.js +93 -0
  98. package/plugins/flora/plugin.json +32 -0
  99. package/plugins/futureagi/LICENSE +21 -0
  100. package/plugins/futureagi/icon.svg +24 -0
  101. package/plugins/futureagi/plugin.js +139 -0
  102. package/plugins/futureagi/plugin.json +32 -0
  103. package/plugins/gemini-apps/LICENSE +21 -0
  104. package/plugins/gemini-apps/icon-color.svg +1 -0
  105. package/plugins/gemini-apps/icon.svg +1 -0
  106. package/plugins/gemini-apps/plugin.js +141 -0
  107. package/plugins/gemini-apps/plugin.json +25 -0
  108. package/plugins/gitkraken/LICENSE +21 -0
  109. package/plugins/gitkraken/icon.svg +2 -0
  110. package/plugins/gitkraken/plugin.js +158 -0
  111. package/plugins/gitkraken/plugin.json +32 -0
  112. package/plugins/googledeveloper/LICENSE +21 -0
  113. package/plugins/googledeveloper/icon.svg +3 -0
  114. package/plugins/googledeveloper/plugin.js +204 -0
  115. package/plugins/googledeveloper/plugin.json +25 -0
  116. package/plugins/grok/icon-color.svg +1 -0
  117. package/plugins/groqcloud/icon-color.svg +1 -0
  118. package/plugins/helmcode/LICENSE +21 -0
  119. package/plugins/helmcode/icon.svg +5 -0
  120. package/plugins/helmcode/plugin.js +253 -0
  121. package/plugins/helmcode/plugin.json +32 -0
  122. package/plugins/huggingface/LICENSE +21 -0
  123. package/plugins/huggingface/icon-color.svg +1 -0
  124. package/plugins/huggingface/icon.svg +1 -0
  125. package/plugins/huggingface/plugin.js +298 -0
  126. package/plugins/huggingface/plugin.json +26 -0
  127. package/plugins/hyper/LICENSE +21 -0
  128. package/plugins/hyper/plugin.js +137 -0
  129. package/plugins/hyper/plugin.json +27 -0
  130. package/plugins/jetbrains-ai-assistant/LICENSE +22 -0
  131. package/plugins/jetbrains-ai-assistant/plugin.js +502 -16
  132. package/plugins/jetbrains-ai-assistant/plugin.json +27 -4
  133. package/plugins/kilo/icon-color.svg +1 -0
  134. package/plugins/kimi/plugin.js +54 -14
  135. package/plugins/kimi/plugin.json +46 -6
  136. package/plugins/langdock/LICENSE +21 -0
  137. package/plugins/langdock/icon.svg +4 -0
  138. package/plugins/langdock/plugin.js +106 -0
  139. package/plugins/langdock/plugin.json +25 -0
  140. package/plugins/linkup/LICENSE +21 -0
  141. package/plugins/linkup/icon.svg +10 -0
  142. package/plugins/linkup/plugin.js +46 -0
  143. package/plugins/linkup/plugin.json +24 -0
  144. package/plugins/litellm/plugin.js +54 -3
  145. package/plugins/lithosai/LICENSE +21 -0
  146. package/plugins/lithosai/icon.svg +1 -0
  147. package/plugins/lithosai/plugin.js +130 -0
  148. package/plugins/lithosai/plugin.json +26 -0
  149. package/plugins/llmman/LICENSE +21 -0
  150. package/plugins/llmman/icon.svg +4 -0
  151. package/plugins/llmman/plugin.js +138 -0
  152. package/plugins/llmman/plugin.json +31 -0
  153. package/plugins/longcat/icon-color.svg +1 -0
  154. package/plugins/longcat/icon.svg +1 -4
  155. package/plugins/manus/icon-color.svg +6 -0
  156. package/plugins/mimo/icon-color.svg +4 -0
  157. package/plugins/mimo/icon.svg +4 -1
  158. package/plugins/mistral/plugin.js +164 -27
  159. package/plugins/moonshot/icon-color.svg +1 -0
  160. package/plugins/munito/LICENSE +21 -0
  161. package/plugins/munito/icon.svg +7 -0
  162. package/plugins/munito/plugin.js +171 -0
  163. package/plugins/munito/plugin.json +24 -0
  164. package/plugins/muse/LICENSE +21 -0
  165. package/plugins/muse/icon.svg +3 -0
  166. package/plugins/muse/plugin.js +288 -0
  167. package/plugins/muse/plugin.json +34 -0
  168. package/plugins/museai/LICENSE +21 -0
  169. package/plugins/museai/icon.svg +3 -0
  170. package/plugins/museai/plugin.js +161 -0
  171. package/plugins/museai/plugin.json +26 -0
  172. package/plugins/nous/LICENSE +21 -0
  173. package/plugins/nous/icon-color.svg +1 -0
  174. package/plugins/nous/icon.svg +1 -0
  175. package/plugins/nous/plugin.js +129 -0
  176. package/plugins/nous/plugin.json +32 -0
  177. package/plugins/ollama/icon-color.svg +1 -0
  178. package/plugins/ollama/plugin.js +58 -0
  179. package/plugins/openai-api/icon-color.svg +1 -0
  180. package/plugins/opencode/icon-color.svg +1 -0
  181. package/plugins/opencode-go/icon-color.svg +1 -0
  182. package/plugins/opencode-go/plugin.js +104 -37
  183. package/plugins/opendesign/LICENSE +21 -0
  184. package/plugins/opendesign/icon.svg +4 -0
  185. package/plugins/opendesign/plugin.js +108 -0
  186. package/plugins/opendesign/plugin.json +25 -0
  187. package/plugins/openrouter/icon-color.svg +1 -0
  188. package/plugins/parallel/LICENSE +21 -0
  189. package/plugins/parallel/icon.svg +11 -0
  190. package/plugins/parallel/plugin.js +97 -0
  191. package/plugins/parallel/plugin.json +25 -0
  192. package/plugins/perplexity/LICENSE +22 -0
  193. package/plugins/perplexity/plugin.js +122 -0
  194. package/plugins/perplexity/plugin.json +36 -7
  195. package/plugins/pi/plugin.js +113 -0
  196. package/plugins/pi/plugin.json +11 -0
  197. package/plugins/qwencloud/LICENSE +21 -0
  198. package/plugins/qwencloud/icon-color.svg +1 -0
  199. package/plugins/qwencloud/icon.svg +1 -4
  200. package/plugins/qwencloud/plugin.js +197 -0
  201. package/plugins/qwencloud/plugin.json +17 -0
  202. package/plugins/raycast/LICENSE +21 -0
  203. package/plugins/raycast/icon.svg +4 -0
  204. package/plugins/raycast/plugin.js +179 -0
  205. package/plugins/raycast/plugin.json +32 -0
  206. package/plugins/replicate/LICENSE +21 -0
  207. package/plugins/replicate/icon-color.svg +1 -0
  208. package/plugins/replicate/icon.svg +1 -0
  209. package/plugins/replicate/plugin.js +170 -0
  210. package/plugins/replicate/plugin.json +25 -0
  211. package/plugins/sailresearch/LICENSE +21 -0
  212. package/plugins/sailresearch/icon.svg +4 -0
  213. package/plugins/sailresearch/plugin.js +104 -0
  214. package/plugins/sailresearch/plugin.json +24 -0
  215. package/plugins/siliconflow/LICENSE +21 -0
  216. package/plugins/siliconflow/icon.svg +3 -0
  217. package/plugins/siliconflow/plugin.js +87 -0
  218. package/plugins/siliconflow/plugin.json +32 -0
  219. package/plugins/sofya/LICENSE +21 -0
  220. package/plugins/sofya/icon.svg +3 -0
  221. package/plugins/sofya/plugin.js +86 -0
  222. package/plugins/sofya/plugin.json +24 -0
  223. package/plugins/soniox/LICENSE +21 -0
  224. package/plugins/soniox/icon.svg +3 -0
  225. package/plugins/soniox/plugin.js +103 -0
  226. package/plugins/soniox/plugin.json +24 -0
  227. package/plugins/synthetic/icon-color.svg +14 -0
  228. package/plugins/synthetic/plugin.js +12 -0
  229. package/plugins/synthetic/plugin.json +51 -9
  230. package/plugins/tavily/LICENSE +21 -0
  231. package/plugins/tavily/icon.svg +3 -0
  232. package/plugins/tavily/plugin.js +61 -0
  233. package/plugins/tavily/plugin.json +24 -0
  234. package/plugins/tinyapi/LICENSE +21 -0
  235. package/plugins/tinyapi/icon.svg +4 -0
  236. package/plugins/tinyapi/plugin.js +73 -0
  237. package/plugins/tinyapi/plugin.json +25 -0
  238. package/plugins/traecn/LICENSE +21 -0
  239. package/plugins/traecn/icon.svg +3 -0
  240. package/plugins/traecn/plugin.js +103 -0
  241. package/plugins/traecn/plugin.json +25 -0
  242. package/plugins/tripo/LICENSE +21 -0
  243. package/plugins/tripo/icon.svg +4 -0
  244. package/plugins/tripo/plugin.js +60 -0
  245. package/plugins/tripo/plugin.json +24 -0
  246. package/plugins/typesafe/LICENSE +21 -0
  247. package/plugins/typesafe/icon.svg +4 -0
  248. package/plugins/typesafe/plugin.js +181 -0
  249. package/plugins/typesafe/plugin.json +25 -0
  250. package/plugins/v0/LICENSE +21 -0
  251. package/plugins/v0/icon-color.svg +1 -0
  252. package/plugins/v0/icon.svg +1 -0
  253. package/plugins/v0/plugin.js +219 -0
  254. package/plugins/v0/plugin.json +32 -0
  255. package/plugins/venice/plugin.js +50 -1
  256. package/plugins/venice/plugin.json +2 -1
  257. package/plugins/vercel/LICENSE +21 -0
  258. package/plugins/vercel/icon-color.svg +1 -0
  259. package/plugins/vercel/icon.svg +1 -0
  260. package/plugins/vercel/plugin.js +202 -0
  261. package/plugins/vercel/plugin.json +54 -0
  262. package/plugins/windsurf/icon-color.svg +1 -0
  263. package/plugins/workbuddy/LICENSE +21 -0
  264. package/plugins/workbuddy/icon.svg +1 -0
  265. package/plugins/workbuddy/plugin.js +318 -0
  266. package/plugins/workbuddy/plugin.json +63 -0
  267. package/plugins/xai/icon-color.svg +1 -0
  268. package/plugins/xai/icon.svg +1 -7
  269. package/plugins/xai/plugin.js +9 -0
  270. package/plugins/xapi/LICENSE +21 -0
  271. package/plugins/xapi/icon.svg +1 -0
  272. package/plugins/xapi/plugin.js +90 -0
  273. package/plugins/xapi/plugin.json +25 -0
  274. package/plugins/xkiro/LICENSE +21 -0
  275. package/plugins/xkiro/icon.svg +1 -0
  276. package/plugins/xkiro/plugin.js +104 -0
  277. package/plugins/xkiro/plugin.json +24 -0
  278. package/plugins/zai/icon-color.svg +1 -0
  279. package/plugins/zai/plugin.js +5 -1
  280. package/plugins/zenmux/icon-color.svg +1 -0
  281. package/plugins/zenmux/icon.svg +1 -3
  282. package/usagestat +0 -0
  283. package/usagestatd +0 -0
  284. package/plugins/cursor-nightly/plugin.js +0 -1416
@@ -0,0 +1,208 @@
1
+ // Generated by tools/vendor-codexbar-providers.cjs; see LICENSE.
2
+ globalThis.__usagestat_bundled_options = {"labels":["Plan","Top-up credits","Additional"],"defaults":{},"autoMode":"api"};
3
+ (function(defineProvider) {
4
+ // BEGIN UPSTREAM Sources/CodexBarCore/Resources/Plugins/chatbox.js
5
+ function _nullishCoalesce(lhs, rhsFn) {
6
+ if (lhs != null) {
7
+ return lhs;
8
+ } else {
9
+ return rhsFn();
10
+ }
11
+ }
12
+ function _optionalChain(ops) {
13
+ let lastAccessLHS = undefined;
14
+ let value = ops[0];
15
+ let i = 1;
16
+ while (i < ops.length) {
17
+ const op = ops[i];
18
+ const fn = ops[i + 1];
19
+ i += 2;
20
+ if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
21
+ return undefined;
22
+ }
23
+ if (op === "access" || op === "optionalAccess") {
24
+ lastAccessLHS = value;
25
+ value = fn(value);
26
+ } else if (op === "call" || op === "optionalCall") {
27
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
28
+ lastAccessLHS = undefined;
29
+ }
30
+ }
31
+ return value;
32
+ }
33
+ defineProvider({
34
+ id: "chatbox",
35
+ name: "Chatbox AI",
36
+ endpoints: ["https://api.chatboxai.app"],
37
+ auth: { type: "header", header: "Authorization", secret: "CHATBOX_LICENSE_KEY" },
38
+ settings: [
39
+ { key: "CHATBOX_LICENSE_KEY", title: "API key", type: "secure" },
40
+ { key: "MESSAGES", title: "Chatbox AI", type: "plain" },
41
+ ],
42
+ capabilities: ["http-status"],
43
+ async fetchUsage(ctx) {
44
+ const messages = JSON.parse(ctx.settings.get("MESSAGES") || "{}");
45
+ const message = (key, status) => (messages[key] || key) + (status === undefined ? "" : ` (HTTP ${status})`);
46
+ const key = ctx.settings.getSecret("CHATBOX_LICENSE_KEY");
47
+ if (
48
+ !key ||
49
+ key.length > 4096 ||
50
+ /\s/u.test(key) ||
51
+ Array.from(key).some((character) => {
52
+ const code = character.charCodeAt(0);
53
+ return code < 32 || (code >= 127 && code <= 159);
54
+ })
55
+ ) {
56
+ throw ctx.fail.authenticationExpired(message("Chatbox AI license key is invalid. Update it in Settings."));
57
+ }
58
+ const response = await ctx.http.get("https://api.chatboxai.app/api/license/detail/realtime", {
59
+ headers: { "Cache-Control": "no-store" },
60
+ });
61
+ const record = (value) => (value && typeof value === "object" && !Array.isArray(value) ? value : undefined);
62
+ const decode = (body) => {
63
+ try {
64
+ return record(JSON.parse(body));
65
+ } catch (error) {
66
+ void error;
67
+ return undefined;
68
+ }
69
+ };
70
+ if (response.status === 401) {
71
+ throw ctx.fail.authenticationExpired(
72
+ message("Chatbox AI license key is invalid. Update it in Settings.", response.status),
73
+ );
74
+ }
75
+ if (response.status === 403) {
76
+ throw ctx.fail.permissionDenied(message("Chatbox AI denied access. Check your license.", response.status));
77
+ }
78
+ if (response.status === 429) {
79
+ const delay = Number(_nullishCoalesce(response.headers["retry-after"], () => 1));
80
+ throw ctx.fail.rateLimited(message("Chatbox AI is rate limiting requests. Try again later.", response.status), {
81
+ retryAfterSeconds: Number.isFinite(delay) && delay >= 0 ? Math.min(delay, 10) : 1,
82
+ });
83
+ }
84
+ if (response.status >= 500) {
85
+ throw ctx.fail.providerUnavailable(message("Chatbox AI request failed. Try refreshing later.", response.status));
86
+ }
87
+ if (response.status !== 200) {
88
+ throw ctx.fail.apiFailure(message("Chatbox AI request failed. Try refreshing later.", response.status));
89
+ }
90
+ const fail = () => {
91
+ throw ctx.fail.parseFailure(
92
+ message("Chatbox AI returned an unrecognized response. Update CodexBar and try again."),
93
+ );
94
+ };
95
+ const root = decode(response.bodyText);
96
+ const data = record(_optionalChain([root, "optionalAccess", (_) => _.data]));
97
+ if (!data || _optionalChain([root, "optionalAccess", (_2) => _2.error])) return fail();
98
+ const now = ctx.date.now().getTime();
99
+ const text = (value) =>
100
+ typeof value === "string"
101
+ ? Array.from(value, (character) => {
102
+ const code = character.charCodeAt(0);
103
+ return code < 32 || code === 127 ? " " : character;
104
+ })
105
+ .join("")
106
+ .trim()
107
+ .slice(0, 100) || undefined
108
+ : undefined;
109
+ const counter = (value) => {
110
+ if (value === undefined || value === null) return undefined;
111
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : fail();
112
+ };
113
+ const date = (value) => {
114
+ if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T/.test(value)) return undefined;
115
+ const parsed = new Date(value);
116
+ return Number.isFinite(parsed.getTime()) && parsed.getUTCFullYear() >= 1970 ? parsed : undefined;
117
+ };
118
+
119
+ const pool = (object, usedKey, limitKey) => {
120
+ const used = counter(object[usedKey]);
121
+ const limit = counter(object[limitKey]);
122
+ return used !== undefined && limit !== undefined ? { used, limit } : undefined;
123
+ };
124
+ const rows = [];
125
+ const addPool = (label, value) => {
126
+ if (!value || (value.used === 0 && value.limit === 0)) return;
127
+ const remaining = Math.max(value.limit - value.used, 0);
128
+ rows.push({
129
+ label,
130
+ value: `${ctx.format.number(remaining)} / ${ctx.format.number(value.limit)}`,
131
+ usageValue: value.used,
132
+ });
133
+ };
134
+ const details = data.unified_token_usage_details;
135
+ let plan;
136
+ let detailRewards;
137
+ if (details !== undefined && details !== null) {
138
+ if (!Array.isArray(details) || details.length > 100) return fail();
139
+ for (const entry of details) {
140
+ const item = record(entry);
141
+ if (!item || typeof item.type !== "string") return fail();
142
+ const value = pool(item, "token_usage", "token_limit");
143
+ if (item.type === "plan") {
144
+ if (plan) return fail();
145
+ plan = value;
146
+ } else if (value) {
147
+ const expires = date(item.expires_at);
148
+ if (expires && expires.getTime() <= now) continue;
149
+ detailRewards = {
150
+ used:
151
+ _nullishCoalesce(_optionalChain([detailRewards, "optionalAccess", (_3) => _3.used]), () => 0) +
152
+ value.used,
153
+ limit:
154
+ _nullishCoalesce(_optionalChain([detailRewards, "optionalAccess", (_4) => _4.limit]), () => 0) +
155
+ value.limit,
156
+ };
157
+ if (!Number.isSafeInteger(detailRewards.used) || !Number.isSafeInteger(detailRewards.limit)) return fail();
158
+ }
159
+ }
160
+ }
161
+ const total = pool(data, "unified_token_usage", "unified_token_limit");
162
+ const rewardRecord = record(data.aggregated_reward_details);
163
+ if (data.aggregated_reward_details != null && !rewardRecord) return fail();
164
+ const rewards = rewardRecord ? pool(rewardRecord, "token_usage", "token_limit") : detailRewards;
165
+ const expansion = pool(data, "expansion_pack_usage", "expansion_pack_limit");
166
+ const images = pool(data, "image_used_count", "image_total_quota");
167
+ if (!plan && !total && !rewards && !expansion && !images) return fail();
168
+ addPool("Plan", plan);
169
+ if (!plan) addPool("Quota", total);
170
+ addPool("Credits", rewards);
171
+ addPool("Top-up credits", expansion);
172
+ addPool("Image Generation", images);
173
+ const name = text(data.name);
174
+ const status = text(data.status);
175
+ const expires = _nullishCoalesce(date(data.token_expire_time), () => date(data.expires_at));
176
+ const next = date(data.token_next_refresh_time);
177
+ const usablePlan = (status === undefined || status === "active") && (!expires || expires.getTime() > now);
178
+ // Trial has no positive plan pool. Rewards and image totals do not share the plan's reset schedule.
179
+ const reset =
180
+ usablePlan &&
181
+ plan &&
182
+ plan.limit > 0 &&
183
+ next &&
184
+ next.getTime() > now &&
185
+ (!expires || next.getTime() < expires.getTime())
186
+ ? next
187
+ : undefined;
188
+ if (rows.length === 0) rows.push({ label: "Quota", value: "0 / 0", usageValue: 0 });
189
+ return {
190
+ primary:
191
+ usablePlan && plan && plan.limit > 0
192
+ ? {
193
+ usedPercent: ctx.pct(plan.used, plan.limit),
194
+ resetsAt: reset,
195
+ }
196
+ : undefined,
197
+ secondary:
198
+ expansion && expansion.limit > 0 ? { usedPercent: ctx.pct(expansion.used, expansion.limit) } : undefined,
199
+ identity: name ? { loginMethod: name } : undefined,
200
+ details: [{ title: "Remaining", rows }],
201
+ subscriptionExpiresAt: expires,
202
+ dataConfidence: "exact",
203
+ };
204
+ },
205
+ });
206
+
207
+ // END UPSTREAM
208
+ })(globalThis.defineProvider);
@@ -0,0 +1,24 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "chatbox",
4
+ "name": "Chatbox AI",
5
+ "version": "0.1.0",
6
+ "entry": "plugin.js",
7
+ "enabledByDefault": false,
8
+ "supportedModes": [
9
+ "api"
10
+ ],
11
+ "autoMode": "api",
12
+ "usageDashboardUrl": "https://chatboxai.app",
13
+ "envVars": [
14
+ "CHATBOX_LICENSE_KEY"
15
+ ],
16
+ "setupFields": [],
17
+ "upstream": {
18
+ "repository": "https://github.com/steipete/CodexBar",
19
+ "revision": "1f6da9bec44455288ddee5ef6f3617a803d8eb2a",
20
+ "path": "Sources/CodexBarCore/Resources/Plugins/chatbox.js",
21
+ "sha256": "cf0ae84410aa3794635c0df1edf4936ae514a070968a189dc6ef613c5445f957",
22
+ "license": "MIT"
23
+ }
24
+ }